Class DefaultOrgUnitService
- java.lang.Object
-
- de.hybris.platform.commerceservices.organization.services.impl.DefaultOrgUnitService
-
- All Implemented Interfaces:
OrgUnitService
public class DefaultOrgUnitService extends java.lang.Object implements OrgUnitService
Default implementation of theOrgUnitService
interface.
-
-
Constructor Summary
Constructors Constructor Description DefaultOrgUnitService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activateUnit(OrgUnitModel orgUnit)
Activate the organizational unit with the given orgUnit.void
addMembers(OrgUnitMemberParameter parameter)
Add one or more members to a organizational unit.protected <T extends PrincipalModel>
voidaddRemoveMembers(OrgUnitMemberParameter<T> parameter, java.util.function.BiConsumer<java.util.Set<PrincipalGroupModel>,OrgUnitModel> consumer)
void
createUnit(OrgUnitParameter parameter)
Create a new organizational unit.void
deactivateUnit(OrgUnitModel orgUnit)
Deactivate the organizational unit and all of its child units with the given orgUnit.protected ConfigurationService
getConfigurationService()
protected FlexibleSearchService
getFlexibleSearchService()
<T extends PrincipalModel>
SearchPageData<T>getMembers(OrgUnitMemberParameter<T> parameter)
Get a paged search result for members of the given organizational unit.protected ModelService
getModelService()
protected OrgUnitActivationStrategy
getOrgUnitActivationStrategy()
protected OrgUnitAuthorizationStrategy
getOrgUnitAuthorizationStrategy()
protected OrgUnitDao
getOrgUnitDao()
protected OrgUnitHierarchyService
getOrgUnitHierarchyService()
java.util.Optional<OrgUnitModel>
getParent(OrgUnitModel orgUnit)
Gets the parent unit of a unit.java.util.Set<PrincipalGroupModel>
getRolesForEmployee(EmployeeModel employee)
Get a list of user roles that the given employee belongs tojava.util.Optional<OrgUnitModel>
getUnitForUid(java.lang.String uid)
Get the organizational unit with the given uid.protected UserService
getUserService()
void
removeMembers(OrgUnitMemberParameter parameter)
Remove one or more members from a organizational unit.void
setConfigurationService(ConfigurationService configurationService)
void
setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
void
setModelService(ModelService modelService)
void
setOrgUnitActivationStrategy(OrgUnitActivationStrategy orgUnitActivationStrategy)
void
setOrgUnitAuthorizationStrategy(OrgUnitAuthorizationStrategy orgUnitAuthorizationStrategy)
void
setOrgUnitDao(OrgUnitDao orgUnitDao)
void
setOrgUnitHierarchyService(OrgUnitHierarchyService orgUnitHierarchyService)
protected boolean
setParentUnit(OrgUnitModel orgUnit, OrgUnitModel newParentUnit)
void
setUserService(UserService userService)
void
updateUnit(OrgUnitParameter parameter)
Update an existing organizational unit.
-
-
-
Method Detail
-
createUnit
public void createUnit(OrgUnitParameter parameter)
Description copied from interface:OrgUnitService
Create a new organizational unit.- Specified by:
createUnit
in interfaceOrgUnitService
- Parameters:
parameter
- ExtensibleOrgUnitParameter
bean containing the initial attributes of the organizational unit to be created. Mandatory values:
-
updateUnit
public void updateUnit(OrgUnitParameter parameter)
Description copied from interface:OrgUnitService
Update an existing organizational unit.- Specified by:
updateUnit
in interfaceOrgUnitService
- Parameters:
parameter
- ExtensibleOrgUnitParameter
bean containing the initial attributes of the organizational unit to be updated. Mandatory values:
-
getUnitForUid
public java.util.Optional<OrgUnitModel> getUnitForUid(java.lang.String uid)
Description copied from interface:OrgUnitService
Get the organizational unit with the given uid.- Specified by:
getUnitForUid
in interfaceOrgUnitService
- Parameters:
uid
- the uid of the organizational unit- Returns:
- An
Optional
which- contains the
OrgUnitModel
for the given uid if it exists and - is empty otherwise.
- contains the
-
activateUnit
public void activateUnit(OrgUnitModel orgUnit)
Description copied from interface:OrgUnitService
Activate the organizational unit with the given orgUnit.- Specified by:
activateUnit
in interfaceOrgUnitService
- Parameters:
orgUnit
- the organizational unit
-
deactivateUnit
public void deactivateUnit(OrgUnitModel orgUnit)
Description copied from interface:OrgUnitService
Deactivate the organizational unit and all of its child units with the given orgUnit.- Specified by:
deactivateUnit
in interfaceOrgUnitService
- Parameters:
orgUnit
- the organizational unit
-
addMembers
public void addMembers(OrgUnitMemberParameter parameter)
Description copied from interface:OrgUnitService
Add one or more members to a organizational unit.- Specified by:
addMembers
in interfaceOrgUnitService
- Parameters:
parameter
- ExtensibleOrgUnitMemberParameter
bean holding the method parameters. Mandatory values:
-
removeMembers
public void removeMembers(OrgUnitMemberParameter parameter)
Description copied from interface:OrgUnitService
Remove one or more members from a organizational unit.- Specified by:
removeMembers
in interfaceOrgUnitService
- Parameters:
parameter
- ExtensibleOrgUnitMemberParameter
bean holding the method parameters. Mandatory values:
-
getMembers
public <T extends PrincipalModel> SearchPageData<T> getMembers(OrgUnitMemberParameter<T> parameter)
Description copied from interface:OrgUnitService
Get a paged search result for members of the given organizational unit.- Specified by:
getMembers
in interfaceOrgUnitService
- Parameters:
parameter
- ExtensibleOrgUnitMemberParameter
bean holding the method parameters. Mandatory values:- Returns:
SearchPageData
containing the paged search result for members of the given organizational unit
-
getParent
public java.util.Optional<OrgUnitModel> getParent(OrgUnitModel orgUnit)
Description copied from interface:OrgUnitService
Gets the parent unit of a unit.- Specified by:
getParent
in interfaceOrgUnitService
- Parameters:
orgUnit
- the organizational unit- Returns:
- An
Optional
which- contains the parent
OrgUnitModel
for the given unit's uid if it exists and - is empty if
unit
was the root unit.
- contains the parent
-
addRemoveMembers
protected <T extends PrincipalModel> void addRemoveMembers(OrgUnitMemberParameter<T> parameter, java.util.function.BiConsumer<java.util.Set<PrincipalGroupModel>,OrgUnitModel> consumer)
-
setParentUnit
protected boolean setParentUnit(OrgUnitModel orgUnit, OrgUnitModel newParentUnit)
-
getRolesForEmployee
public java.util.Set<PrincipalGroupModel> getRolesForEmployee(EmployeeModel employee)
Description copied from interface:OrgUnitService
Get a list of user roles that the given employee belongs to- Specified by:
getRolesForEmployee
in interfaceOrgUnitService
- Parameters:
employee
- the employee model to search its belonging user roles- Returns:
- a list of user group which represents user role
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getUserService
protected UserService getUserService()
-
setUserService
public void setUserService(UserService userService)
-
getFlexibleSearchService
protected FlexibleSearchService getFlexibleSearchService()
-
setFlexibleSearchService
public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
-
getOrgUnitActivationStrategy
protected OrgUnitActivationStrategy getOrgUnitActivationStrategy()
-
setOrgUnitActivationStrategy
public void setOrgUnitActivationStrategy(OrgUnitActivationStrategy orgUnitActivationStrategy)
-
getOrgUnitDao
protected OrgUnitDao getOrgUnitDao()
-
setOrgUnitDao
public void setOrgUnitDao(OrgUnitDao orgUnitDao)
-
getOrgUnitAuthorizationStrategy
protected OrgUnitAuthorizationStrategy getOrgUnitAuthorizationStrategy()
-
setOrgUnitAuthorizationStrategy
public void setOrgUnitAuthorizationStrategy(OrgUnitAuthorizationStrategy orgUnitAuthorizationStrategy)
-
getOrgUnitHierarchyService
protected OrgUnitHierarchyService getOrgUnitHierarchyService()
-
setOrgUnitHierarchyService
public void setOrgUnitHierarchyService(OrgUnitHierarchyService orgUnitHierarchyService)
-
getConfigurationService
protected ConfigurationService getConfigurationService()
-
setConfigurationService
public void setConfigurationService(ConfigurationService configurationService)
-
-