Class DefaultOrgUnitService
java.lang.Object
de.hybris.platform.commerceservices.organization.services.impl.DefaultOrgUnitService
- All Implemented Interfaces:
OrgUnitService
Default implementation of the
OrgUnitService interface.-
Constructor Summary
Constructors -
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.protected <T extends PrincipalModel>
voidaddRemoveMembers(OrgUnitMemberParameter<T> parameter, BiConsumer<Set<PrincipalGroupModel>, OrgUnitModel> consumer) createAndGetUnit(OrgUnitParameter parameter) Create a new organizational unit and get the created object in responsevoidcreateUnit(OrgUnitParameter parameter) Create a new organizational unit.protected Optional<OrgUnitModel>createUnitInternal(OrgUnitParameter parameter) voiddeactivateUnit(OrgUnitModel orgUnit) Deactivate the organizational unit and all of its child units with the given orgUnit.protected ConfigurationServiceprotected FlexibleSearchService<T extends PrincipalModel>
SearchPageData<T>getMembers(OrgUnitMemberParameter<T> parameter) Get a paged search result for members of the given organizational unit.protected ModelServiceprotected OrgUnitActivationStrategyprotected OrgUnitAuthorizationStrategyprotected OrgUnitDaoprotected OrgUnitHierarchyServicegetParent(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.protected UserServicevoidremoveMembers(OrgUnitMemberParameter parameter) Remove one or more members from a organizational unit.voidsetConfigurationService(ConfigurationService configurationService) voidsetFlexibleSearchService(FlexibleSearchService flexibleSearchService) voidsetModelService(ModelService modelService) voidsetOrgUnitActivationStrategy(OrgUnitActivationStrategy orgUnitActivationStrategy) voidsetOrgUnitAuthorizationStrategy(OrgUnitAuthorizationStrategy orgUnitAuthorizationStrategy) voidsetOrgUnitDao(OrgUnitDao orgUnitDao) voidsetOrgUnitHierarchyService(OrgUnitHierarchyService orgUnitHierarchyService) protected booleansetParentUnit(OrgUnitModel orgUnit, OrgUnitModel newParentUnit) voidsetUserService(UserService userService) voidupdateUnit(OrgUnitParameter parameter) Update an existing organizational unit.
-
Constructor Details
-
DefaultOrgUnitService
public DefaultOrgUnitService()
-
-
Method Details
-
createUnit
Description copied from interface:OrgUnitServiceCreate a new organizational unit.- Specified by:
createUnitin interfaceOrgUnitService- Parameters:
parameter- ExtensibleOrgUnitParameterbean containing the initial attributes of the organizational unit to be created. Mandatory values:OrgUnitParameter.uidOrgUnitParameter.nameOrgUnitParameter.active
-
createAndGetUnit
Description copied from interface:OrgUnitServiceCreate a new organizational unit and get the created object in response- Specified by:
createAndGetUnitin interfaceOrgUnitService- 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
-
createUnitInternal
-
updateUnit
Description copied from interface:OrgUnitServiceUpdate an existing organizational unit.- Specified by:
updateUnitin interfaceOrgUnitService- Parameters:
parameter- ExtensibleOrgUnitParameterbean containing the initial attributes of the organizational unit to be updated. Mandatory values:OrgUnitParameter.orgUnit
-
getUnitForUid
Description copied from interface:OrgUnitServiceGet the organizational unit with the given uid.- Specified by:
getUnitForUidin interfaceOrgUnitService- 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
Description copied from interface:OrgUnitServiceActivate the organizational unit with the given orgUnit.- Specified by:
activateUnitin interfaceOrgUnitService- Parameters:
orgUnit- the organizational unit
-
deactivateUnit
Description copied from interface:OrgUnitServiceDeactivate the organizational unit and all of its child units with the given orgUnit.- Specified by:
deactivateUnitin interfaceOrgUnitService- Parameters:
orgUnit- the organizational unit
-
addMembers
Description copied from interface:OrgUnitServiceAdd one or more members to a organizational unit.- Specified by:
addMembersin interfaceOrgUnitService- Parameters:
parameter- ExtensibleOrgUnitMemberParameterbean holding the method parameters. Mandatory values:OrgUnitMemberParameter.uidOrgUnitMemberParameter.typeOrgUnitMemberParameter.members
-
removeMembers
Description copied from interface:OrgUnitServiceRemove one or more members from a organizational unit.- Specified by:
removeMembersin interfaceOrgUnitService- Parameters:
parameter- ExtensibleOrgUnitMemberParameterbean holding the method parameters. Mandatory values:OrgUnitMemberParameter.uidOrgUnitMemberParameter.typeOrgUnitMemberParameter.members
-
getMembers
Description copied from interface:OrgUnitServiceGet a paged search result for members of the given organizational unit.- Specified by:
getMembersin interfaceOrgUnitService- 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
Description copied from interface:OrgUnitServiceGets the parent unit of a unit.- Specified by:
getParentin interfaceOrgUnitService- 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
-
addRemoveMembers
protected <T extends PrincipalModel> void addRemoveMembers(OrgUnitMemberParameter<T> parameter, BiConsumer<Set<PrincipalGroupModel>, OrgUnitModel> consumer) -
setParentUnit
-
getRolesForEmployee
Description copied from interface:OrgUnitServiceGet a list of user roles that the given employee belongs to- Specified by:
getRolesForEmployeein interfaceOrgUnitService- Parameters:
employee- the employee model to search its belonging user roles- Returns:
- a list of user group which represents user role
-
getModelService
-
setModelService
-
getUserService
-
setUserService
-
getFlexibleSearchService
-
setFlexibleSearchService
-
getOrgUnitActivationStrategy
-
setOrgUnitActivationStrategy
-
getOrgUnitDao
-
setOrgUnitDao
-
getOrgUnitAuthorizationStrategy
-
setOrgUnitAuthorizationStrategy
public void setOrgUnitAuthorizationStrategy(OrgUnitAuthorizationStrategy orgUnitAuthorizationStrategy) -
getOrgUnitHierarchyService
-
setOrgUnitHierarchyService
-
getConfigurationService
-
setConfigurationService
-