Class OrgUnitServiceImpl
java.lang.Object
ru.cg.webbpm.modules.security.api.impl.service.OrgUnitServiceImpl
- All Implemented Interfaces:
OrgUnitService
- Author:
- krylov
-
Nested Class Summary
Nested classes/interfaces inherited from interface ru.cg.webbpm.modules.security.api.service.OrgUnitService
OrgUnitService.OrgUnitFilter
-
Constructor Summary
ConstructorsConstructorDescriptionOrgUnitServiceImpl
(OrgUnitDao orgUnitDao) Org unit service constructor - creates new org unit service. -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(Collection<String> ids) Removes org units from database according to collection of org units ids.Gets org unit by org unit id.get
(OrgUnitService.OrgUnitFilter filter, boolean searchOnlyActual) Gets org units by passed org unit filter according to offset and limit parameters.Gets org unit by org unit code.getChildIds
(Collection<String> ids) Gets org unit child ids according to collection of org unit ids.getInChildren
(String parentId, OrgUnitService.OrgUnitFilter filter) Gets org units by passed parent id and org unit filter according to offset and limit parameters.getParentIds
(String id) Gets parents ids by org unit id.getWithParents
(NonPageableLoadOptions loadOptions) Gets org units according to load options.Inserts org unit into database.void
markRemoved
(Collection<String> ids) Marks org unit "remove" field with true value.void
Updates the org unit in database.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ru.cg.webbpm.modules.security.api.service.OrgUnitService
get, get
-
Constructor Details
-
OrgUnitServiceImpl
Org unit service constructor - creates new org unit service.- Parameters:
orgUnitDao
- org unit data access object. Instance ofOrgUnitDao
type.
-
-
Method Details
-
getParentIds
Gets parents ids by org unit id.- Specified by:
getParentIds
in interfaceOrgUnitService
- Parameters:
id
- org unit id which parents to receive. Instance ofString
type.- Returns:
- list of org unit parent ids. Instance of
List
type. - See Also:
-
getChildIds
Gets org unit child ids according to collection of org unit ids.- Specified by:
getChildIds
in interfaceOrgUnitService
- Parameters:
ids
- ids collection of org units whose child ids to receive. Instance ofCollection
type.- Returns:
- list of org units child ids. Instance of
List
type. - See Also:
-
get
Gets org unit by org unit id.- Specified by:
get
in interfaceOrgUnitService
- Parameters:
id
- id of org unit to receive. Instance ofString
type.- Returns:
- requested org unit or null if does not exist. Instance of
OrgUnit
type. - See Also:
-
getByCode
@Cacheable(value="org-unit-service-code", unless="#result == null") public OrgUnit getByCode(String code) Gets org unit by org unit code.- Specified by:
getByCode
in interfaceOrgUnitService
- Parameters:
code
- code of org unit to receive. Instance ofString
type.- Returns:
- requested org unit or null if does not exist. Instance of
OrgUnit
type. - See Also:
-
getInChildren
Gets org units by passed parent id and org unit filter according to offset and limit parameters.- Specified by:
getInChildren
in interfaceOrgUnitService
- Parameters:
parentId
- parent org unit id of org units to receive. Instance ofString
type.filter
- indicates filter properties. Instance ofOrgUnitService.OrgUnitFilter
type.- Returns:
- list of org units. Instance of
List
type. - See Also:
-
get
Gets org units by passed org unit filter according to offset and limit parameters.- Specified by:
get
in interfaceOrgUnitService
- Parameters:
filter
- indicates filter properties. Instance ofOrgUnitService.OrgUnitFilter
type.searchOnlyActual
- marker for removed filter. Instance ofBoolean
type.- Returns:
- list of org units. Instance of
List
type. - See Also:
-
getWithParents
Gets org units according to load options.- Specified by:
getWithParents
in interfaceOrgUnitService
- Parameters:
loadOptions
- indicates load options properties. Instance ofNonPageableLoadOptions
type.- Returns:
- list of org units. Instance of
List
type. - See Also:
-
insert
Inserts org unit into database. Org unit id will be generated if it is null.- Specified by:
insert
in interfaceOrgUnitService
- Parameters:
orgUnit
- org unit to add. Instance ofOrgUnit
type.- Returns:
- id of inserted org unit. Instance of
String
type. - See Also:
-
update
@CacheEvict(value="user-service-id",allEntries=true) @CacheEvict(value="runtime-user-id",allEntries=true) @CacheEvict(value="runtime-user-username",allEntries=true) @CacheEvict(value="org-unit-service-code",allEntries=true) public void update(OrgUnit orgUnit) Updates the org unit in database.- Specified by:
update
in interfaceOrgUnitService
- Parameters:
orgUnit
- org unit to update. Instance ofOrgUnit
type.- Throws:
SecurityApiException
- if org unit parent id not null and list of org unit parents contains passed org unit id.- See Also:
-
delete
@Caching(evict=@CacheEvict(value="org-unit-service-code",allEntries=true)) public void delete(Collection<String> ids) Removes org units from database according to collection of org units ids.- Specified by:
delete
in interfaceOrgUnitService
- Parameters:
ids
- collection ids of org units to remove. Instance ofCollection
type.- See Also:
-
markRemoved
@CacheEvict(value="user-service-id",allEntries=true) @CacheEvict(value="runtime-user-id",allEntries=true) @CacheEvict(value="runtime-user-username",allEntries=true) @CacheEvict(value="org-unit-service-code",allEntries=true) public void markRemoved(Collection<String> ids) Marks org unit "remove" field with true value.- Specified by:
markRemoved
in interfaceOrgUnitService
- Parameters:
ids
- collection ids of org unit which "remove" field to mark. Instance ofCollection
type.- See Also:
-