Interface OrgUnitService
- All Known Implementing Classes:
DefaultOrgUnitService
public interface OrgUnitService
Service interface for organizational unit related operations.
- Since:
- 6.1
-
Method Summary
Modifier and TypeMethodDescriptionvoidactivateUnit(OrgUnitModel orgUnit) Activate the organizational unit with the given orgUnit.voidaddMembers(OrgUnitMemberParameter parameter) Add one or more members to a organizational unit.default Optional<OrgUnitModel>createAndGetUnit(OrgUnitParameter parameter) Create a new organizational unit and get the created object in responsevoidcreateUnit(OrgUnitParameter parameter) Create a new organizational unit.voiddeactivateUnit(OrgUnitModel orgUnit) Deactivate the organizational unit and all of its child units with the given orgUnit.<T extends PrincipalModel>
SearchPageData<T>getMembers(OrgUnitMemberParameter<T> parameter) Get a paged search result for members of the given organizational unit.getParent(OrgUnitModel orgUnit) Gets the parent unit of a unit.getRolesForEmployee(EmployeeModel employee) Get a list of user roles that the given employee belongs togetUnitForUid(String uid) Get the organizational unit with the given uid.voidremoveMembers(OrgUnitMemberParameter parameter) Remove one or more members from a organizational unit.voidupdateUnit(OrgUnitParameter parameter) Update an existing organizational unit.
-
Method Details
-
createUnit
Create a new organizational unit.- Parameters:
parameter- ExtensibleOrgUnitParameterbean containing the initial attributes of the organizational unit to be created. Mandatory values:OrgUnitParameter.uidOrgUnitParameter.nameOrgUnitParameter.active
-
createAndGetUnit
Create a new organizational unit and get the created object in response- Parameters:
parameter- ExtensibleOrgUnitParameterbean containing the initial attributes of the organizational unit to be created. Mandatory values:OrgUnitParameter.uidOrgUnitParameter.nameOrgUnitParameter.active
- Returns:
- An
Optionalwhich- contains the
OrgUnitModelif created and - is empty otherwise.
- contains the
-
updateUnit
Update an existing organizational unit.- Parameters:
parameter- ExtensibleOrgUnitParameterbean containing the initial attributes of the organizational unit to be updated. Mandatory values:OrgUnitParameter.orgUnit
-
getUnitForUid
Get the organizational unit with the given uid.- Parameters:
uid- the uid of the organizational unit- Returns:
- An
Optionalwhich- contains the
OrgUnitModelfor the given uid if it exists and - is empty otherwise.
- contains the
-
activateUnit
Activate the organizational unit with the given orgUnit.- Parameters:
orgUnit- the organizational unit
-
deactivateUnit
Deactivate the organizational unit and all of its child units with the given orgUnit.- Parameters:
orgUnit- the organizational unit
-
addMembers
Add one or more members to a organizational unit.- Parameters:
parameter- ExtensibleOrgUnitMemberParameterbean holding the method parameters. Mandatory values:OrgUnitMemberParameter.uidOrgUnitMemberParameter.typeOrgUnitMemberParameter.members
-
removeMembers
Remove one or more members from a organizational unit.- Parameters:
parameter- ExtensibleOrgUnitMemberParameterbean holding the method parameters. Mandatory values:OrgUnitMemberParameter.uidOrgUnitMemberParameter.typeOrgUnitMemberParameter.members
-
getMembers
Get a paged search result for members of the given organizational unit.- Parameters:
parameter- ExtensibleOrgUnitMemberParameterbean holding the method parameters. Mandatory values:OrgUnitMemberParameter.uidOrgUnitMemberParameter.typeOrgUnitMemberParameter.members
- Returns:
SearchPageDatacontaining the paged search result for members of the given organizational unit
-
getParent
Gets the parent unit of a unit.- Parameters:
orgUnit- the organizational unit- Returns:
- An
Optionalwhich- contains the parent
OrgUnitModelfor the given unit's uid if it exists and - is empty if
unitwas the root unit.
- contains the parent
-
getRolesForEmployee
Get a list of user roles that the given employee belongs to- Parameters:
employee- the employee model to search its belonging user roles- Returns:
- a list of user group which represents user role
-