Class DefaultB2BCommerceUnitService
- java.lang.Object
-
- de.hybris.platform.b2b.company.impl.DefaultB2BCommerceUnitService
-
- All Implemented Interfaces:
B2BCommerceUnitService
public class DefaultB2BCommerceUnitService extends java.lang.Object implements B2BCommerceUnitService
Default implementation ofB2BCommerceUnitService
-
-
Constructor Summary
Constructors Constructor Description DefaultB2BCommerceUnitService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisableUnit(java.lang.String uid)Disable unit based on the given uidvoideditAddressEntry(B2BUnitModel unitModel, AddressModel addressModel)Save updatedAddressModelobject to a unitvoidenableUnit(java.lang.String unit)Enable unit based on the given uidAddressModelgetAddressForCode(B2BUnitModel unit, java.lang.String id)Gets aAddressModelobject for a given unitjava.util.Collection<? extends B2BUnitModel>getAllowedParentUnits(B2BUnitModel unit)Gets all the allowed parent units for a givenB2BUnitModeljava.util.Collection<? extends B2BUnitModel>getAllUnitsOfOrganization()Get all the units of a organization for current logged in userB2BCustomerServicegetB2bCustomerService()B2BGroupCycleValidatorgetB2BGroupCycleValidator()B2BUnitService<B2BUnitModel,B2BCustomerModel>getB2BUnitService()java.util.Collection<? extends B2BUnitModel>getBranch()A branch of business units based on the parent unit of the current session user.<T extends B2BCustomerModel>
TgetCurrentUser()ModelServicegetModelService()java.util.Collection<? extends B2BUnitModel>getOrganization()A collection of business units based on root unit of an organization to which the parent business unit of the currently logged in customer belongs toPagedB2BCustomerDao<B2BCustomerModel>getPagedB2BCustomerDao()SearchPageData<B2BCustomerModel>getPagedUsersForUnit(PageableData pageableData, java.lang.String unit)Gets list ofSearchPageDataB2BCustomerModelfor a given unit for pagination provided with required pagination parameters withPageableData<T extends B2BUnitModel>
TgetParentUnit()Gets a parent unit of the current session user<T extends B2BUnitModel>
TgetParentUnit(B2BUnitModel unit)Gets parent unit based on the given unit<T extends B2BUnitModel>
TgetRootUnit()Gets a Root unit of the organization based on the parent business unit of the session userSearchRestrictionServicegetSearchRestrictionService()SessionServicegetSessionService()B2BUnitModelgetUnitForUid(java.lang.String unitUid)Gets the unit for uid.UserServicegetUserService()voidremoveAddressEntry(java.lang.String unitUid, java.lang.String addressId)Removes the address from a given unitvoidsaveAddressEntry(B2BUnitModel unitModel, AddressModel addressModel)Sets a given address for a unitvoidsetB2bCustomerService(B2BCustomerService b2bCustomerService)voidsetB2BGroupCycleValidator(B2BGroupCycleValidator b2bGroupCycleValidator)voidsetB2BUnitService(B2BUnitService<B2BUnitModel,B2BCustomerModel> b2bUnitService)voidsetModelService(ModelService modelService)voidsetPagedB2BCustomerDao(PagedB2BCustomerDao<B2BCustomerModel> pagedB2BCustomerDao)voidsetParentUnit(B2BUnitModel unitModel, B2BUnitModel parentUnit)Assign a parent unit to unitModelvoidsetSearchRestrictionService(SearchRestrictionService searchRestrictionService)voidsetSessionService(SessionService sessionService)voidsetUserService(UserService userService)voidupdateBranchInSession()Updates the branch collection in the session for the current user.
-
-
-
Method Detail
-
getOrganization
public java.util.Collection<? extends B2BUnitModel> getOrganization()
Description copied from interface:B2BCommerceUnitServiceA collection of business units based on root unit of an organization to which the parent business unit of the currently logged in customer belongs to- Specified by:
getOrganizationin interfaceB2BCommerceUnitService- Returns:
- A collection of units where the root unit is the parent business unit of the currently logged in customer.
-
getBranch
public java.util.Collection<? extends B2BUnitModel> getBranch()
Description copied from interface:B2BCommerceUnitServiceA branch of business units based on the parent unit of the current session user.- Specified by:
getBranchin interfaceB2BCommerceUnitService- Returns:
- A collection of units where the root unit is the parent business unit of the currently logged in customer.
-
getRootUnit
public <T extends B2BUnitModel> T getRootUnit()
Description copied from interface:B2BCommerceUnitServiceGets a Root unit of the organization based on the parent business unit of the session user- Specified by:
getRootUnitin interfaceB2BCommerceUnitService- Returns:
- A root unit of an organization a session customer belongs to
- See Also:
B2BCommerceUnitService.getParentUnit()
-
getCurrentUser
public <T extends B2BCustomerModel> T getCurrentUser()
-
getParentUnit
public <T extends B2BUnitModel> T getParentUnit()
Description copied from interface:B2BCommerceUnitServiceGets a parent unit of the current session user- Specified by:
getParentUnitin interfaceB2BCommerceUnitService- Returns:
- The business unit assigned to the current session user.
-
getAllUnitsOfOrganization
public java.util.Collection<? extends B2BUnitModel> getAllUnitsOfOrganization()
Description copied from interface:B2BCommerceUnitServiceGet all the units of a organization for current logged in user- Specified by:
getAllUnitsOfOrganizationin interfaceB2BCommerceUnitService- Returns:
- Collection of units for the organization of the current user
-
setParentUnit
public void setParentUnit(B2BUnitModel unitModel, B2BUnitModel parentUnit)
Description copied from interface:B2BCommerceUnitServiceAssign a parent unit to unitModel- Specified by:
setParentUnitin interfaceB2BCommerceUnitService- Parameters:
unitModel- A unit to assign a parent forB2BUnitModelparentUnit- The parent unitB2BUnitModel
-
getAllowedParentUnits
public java.util.Collection<? extends B2BUnitModel> getAllowedParentUnits(B2BUnitModel unit)
Description copied from interface:B2BCommerceUnitServiceGets all the allowed parent units for a givenB2BUnitModel- Specified by:
getAllowedParentUnitsin interfaceB2BCommerceUnitService- Parameters:
unit- A unique identifier for a unit- Returns:
- A collection of
B2BUnitModelfor the given uid
-
updateBranchInSession
public void updateBranchInSession()
Description copied from interface:B2BCommerceUnitServiceUpdates the branch collection in the session for the current user. Should be called after a new unit creation so that its does not get filter out by the unit branch search restriction.- Specified by:
updateBranchInSessionin interfaceB2BCommerceUnitService
-
getUnitForUid
public B2BUnitModel getUnitForUid(java.lang.String unitUid)
Description copied from interface:B2BCommerceUnitServiceGets the unit for uid.- Specified by:
getUnitForUidin interfaceB2BCommerceUnitService- Parameters:
unitUid- the unit uid- Returns:
- the unit for uid
-
disableUnit
public void disableUnit(java.lang.String uid)
Description copied from interface:B2BCommerceUnitServiceDisable unit based on the given uid- Specified by:
disableUnitin interfaceB2BCommerceUnitService- Parameters:
uid- A unique identifier ofB2BUnitModel
-
enableUnit
public void enableUnit(java.lang.String unit)
Description copied from interface:B2BCommerceUnitServiceEnable unit based on the given uid- Specified by:
enableUnitin interfaceB2BCommerceUnitService- Parameters:
unit- A unique identifier ofB2BUnitModel
-
getPagedUsersForUnit
public SearchPageData<B2BCustomerModel> getPagedUsersForUnit(PageableData pageableData, java.lang.String unit)
Description copied from interface:B2BCommerceUnitServiceGets list ofSearchPageDataB2BCustomerModelfor a given unit for pagination provided with required pagination parameters withPageableData- Specified by:
getPagedUsersForUnitin interfaceB2BCommerceUnitService- Parameters:
pageableData- Pagination informationunit- A unique identifier ofB2BUnitModel- Returns:
- Collection of paginated
B2BCostCenterModelobjects
-
saveAddressEntry
public void saveAddressEntry(B2BUnitModel unitModel, AddressModel addressModel)
Description copied from interface:B2BCommerceUnitServiceSets a given address for a unit- Specified by:
saveAddressEntryin interfaceB2BCommerceUnitService- Parameters:
unitModel- A unique identifier ofB2BUnitModeladdressModel-AddressModelobject which is getting added to unit
-
removeAddressEntry
public void removeAddressEntry(java.lang.String unitUid, java.lang.String addressId)Description copied from interface:B2BCommerceUnitServiceRemoves the address from a given unit- Specified by:
removeAddressEntryin interfaceB2BCommerceUnitService- Parameters:
unitUid- A unique identifier ofB2BUnitModeladdressId- A unique identifier ofAddressModel
-
getAddressForCode
public AddressModel getAddressForCode(B2BUnitModel unit, java.lang.String id)
Description copied from interface:B2BCommerceUnitServiceGets aAddressModelobject for a given unit- Specified by:
getAddressForCodein interfaceB2BCommerceUnitService- Parameters:
unit- A unique identifier ofB2BUnitModelid- A unique identifier ofAddressModel- Returns:
AddressModelobject
-
editAddressEntry
public void editAddressEntry(B2BUnitModel unitModel, AddressModel addressModel)
Description copied from interface:B2BCommerceUnitServiceSave updatedAddressModelobject to a unit- Specified by:
editAddressEntryin interfaceB2BCommerceUnitService- Parameters:
unitModel- A unique identifier ofB2BUnitModeladdressModel-AddressModelobject for given unit
-
getParentUnit
public <T extends B2BUnitModel> T getParentUnit(B2BUnitModel unit)
Description copied from interface:B2BCommerceUnitServiceGets parent unit based on the given unit- Specified by:
getParentUnitin interfaceB2BCommerceUnitService- Parameters:
unit- AB2BUnitModelobject- Returns:
- A
B2BUnitModelobject which denotes the parent unit of the given unit
-
getUserService
public UserService getUserService()
-
setUserService
public void setUserService(UserService userService)
-
getB2BUnitService
public B2BUnitService<B2BUnitModel,B2BCustomerModel> getB2BUnitService()
-
setB2BUnitService
public void setB2BUnitService(B2BUnitService<B2BUnitModel,B2BCustomerModel> b2bUnitService)
-
getB2BGroupCycleValidator
public B2BGroupCycleValidator getB2BGroupCycleValidator()
-
setB2BGroupCycleValidator
public void setB2BGroupCycleValidator(B2BGroupCycleValidator b2bGroupCycleValidator)
-
getSessionService
public SessionService getSessionService()
-
setSessionService
public void setSessionService(SessionService sessionService)
-
getModelService
public ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getSearchRestrictionService
public SearchRestrictionService getSearchRestrictionService()
-
setSearchRestrictionService
public void setSearchRestrictionService(SearchRestrictionService searchRestrictionService)
-
getPagedB2BCustomerDao
public PagedB2BCustomerDao<B2BCustomerModel> getPagedB2BCustomerDao()
-
setPagedB2BCustomerDao
public void setPagedB2BCustomerDao(PagedB2BCustomerDao<B2BCustomerModel> pagedB2BCustomerDao)
-
getB2bCustomerService
public B2BCustomerService getB2bCustomerService()
-
setB2bCustomerService
public void setB2bCustomerService(B2BCustomerService b2bCustomerService)
-
-