Interface B2BUnitService<T extends CompanyModel,U extends UserModel>

Type Parameters:
T - extension of CompanyModel
U - extension of UserModel
All Known Implementing Classes:
B2BUnitServiceProxy, DefaultB2BUnitService

public interface B2BUnitService<T extends CompanyModel,U extends UserModel>
A service around B2BUnitModel.
Spring Bean ID:
b2bUnitService
  • Method Details

    • getAllUnitsOfOrganization

      @Deprecated(since="6.0", forRemoval=true) Set<T> getAllUnitsOfOrganization(T unit)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Since 6.0. Use getBranch(T) instead
      Retrieves all units of an organization the unit belongs too.
      Parameters:
      unit - A B2BUnitModel within an organization
      Returns:
      A list of all units within an organization.
    • getAllUnitsOfOrganization

      Set<T> getAllUnitsOfOrganization(B2BCustomerModel customer)
      Retrieves all units of an organization the customer belongs too.
      Parameters:
      customer - the session user.
      Returns:
      the all units of organization
    • getAllUserGroupMembersForType

      <M extends PrincipalModel> Set<M> getAllUserGroupMembersForType(UserGroupModel userGroup, Class<M> memberType)
      Retrieves all members of a User Group of the specified type
      Parameters:
      userGroup - the user group
      memberType - the principle's member type
      Returns:
      the principle members
    • getParent

      T getParent(B2BCustomerModel employee)
      Gets the parent unit of a user.
      Parameters:
      employee - the employee
      Returns:
      the parent
    • getParent

      T getParent(T unit)
      Gets the parent unit of a unit.
      Parameters:
      unit - the child unit
      Returns:
      the parent unit or null if unit was the root unit.
    • getRootUnit

      T getRootUnit(T unit)
      Gets the root unit.
      Parameters:
      unit - the unit
      Returns:
      the root unit
    • findUnitByUid

      @Deprecated(since="4.4", forRemoval=true) T findUnitByUid(String uid)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Since 4.4. Use getUnitForUid(String) instead
      Find unit by uid.
      Parameters:
      uid - the uid
      Returns:
      the b2 b unit model
    • getUnitForUid

      T getUnitForUid(String uid)
      Find unit by uid.
      Parameters:
      uid - the uid
      Returns:
      the b2 b unit model
    • getBranch

      Set<T> getBranch(T unit)
      Gets the branch of a unit.
      Parameters:
      unit - the unit
      Returns:
      the branch
    • getCustomers

      Set<U> getCustomers(Set<T> branch)
      Gets the employees.
      Parameters:
      branch - the branch
      Returns:
      the employees
    • disableBranch

      void disableBranch(T unit)
      Disable branch. Mark all units in the branch as active = false
      Parameters:
      unit - the unit
    • enableBranch

      void enableBranch(T unit)
      Enable branch. Mark all unit in the branch as active = true.
      Parameters:
      unit - the unit
    • getAllParents

      List<T> getAllParents(T unit)
      Get all the parent units in the organization hierarchy all the way up to the root.
      Parameters:
      unit - the unit
      Returns:
      A Set of all b2b units (CompanyModel)
    • addMember

      void addMember(T group, PrincipalModel member)
      Adds the member to a group. The model is not saved.
      Parameters:
      group - the group
      member - the member
    • getB2BCustomers

      Set<U> getB2BCustomers(T unit)
      Gets the b2 b customers.
      Parameters:
      unit - the unit
      Returns:
      the b2 b customers
    • getB2BUnits

      Set<T> getB2BUnits(T unit)
      Gets units that are children of the current unit.
      Parameters:
      unit - the unit
      Returns:
      the b2 b units
    • updateParentB2BUnit

      void updateParentB2BUnit(T parentB2BUnit, PrincipalModel member)
      Set the parent unit of a given principal. The member is not saved.
      Parameters:
      parentB2BUnit - the parent b2 b unit
      member - the member
    • getUsersOfUserGroup

      @Deprecated(since="6.0", forRemoval=true) Collection<U> getUsersOfUserGroup(T unit, String userGroupId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets all members from the unit who belong to specified User Group
      Parameters:
      unit - the unit
      userGroupId - the user group id
      Returns:
      A collection of users who are members of the unit with group userGroupId
    • getUsersOfUserGroup

      Collection<B2BCustomerModel> getUsersOfUserGroup(B2BUnitModel unit, String userGroupId, boolean recursive)
      Gets all members from the unit who belong to specified User Group
      Parameters:
      unit - the unit
      userGroupId - the user group id
      recursive - If true the lookup of users will continue for unit parent until at least one is found.
      Returns:
      A collection of users who are members of the unit with group userGroupId
    • findApprovalProcessCodeForUnit

      @Deprecated(since="4.4", forRemoval=true) String findApprovalProcessCodeForUnit(T unit)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get approval process code from unit, checking parent units up the organization tree up to the root unit if process is not set in the unit
      Parameters:
      unit -
      Returns:
      approval process code
    • getApprovalProcessCodeForUnit

      @Deprecated(since="1905", forRemoval=true) String getApprovalProcessCodeForUnit(T unit)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 1905. Please use {@link de.hybris.platform.b2b.process.approval.services.impl.DefaultB2BApprovalProcessService.getApprovalProcessCodeForUnit(B2BUnitModel)} instead.
      Get approval process code from unit, checking parent units up the organization tree up to the root unit if process is not set in the unit
      Parameters:
      unit -
      Returns:
      approval process code
    • getAllApprovalProcesses

      @Deprecated(since="6.0", forRemoval=true) List<String> getAllApprovalProcesses()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get All Approval Process codes defined in local.properties
      Returns:
      List of approval process codes
    • findAccountManagerForUnit

      @Deprecated(since="4.4", forRemoval=true) EmployeeModel findAccountManagerForUnit(T unit)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get salesrep from unit, checking parent units up the organization tree up to the root unit if salesrep is not set in the unit
      Parameters:
      unit -
      Returns:
      the account manager
    • getAccountManagerForUnit

      EmployeeModel getAccountManagerForUnit(T unit)
      Get salesrep from unit, checking parent units up the organization tree up to the root unit if salesrep is not set in the unit
      Parameters:
      unit -
      Returns:
      the account manager
    • findUnitWithCreditLimit

      @Deprecated(since="4.4", forRemoval=true) T findUnitWithCreditLimit(T unit, CurrencyModel currency)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get unit with credit limit/credit check group value, checking parent units up the organization tree up to the root unit if credit limit / credit check group is not set in the unit
      Parameters:
      unit -
      currency -
      Returns:
      unit with credit limit/check
    • getUnitWithCreditLimit

      T getUnitWithCreditLimit(T unit)
      Get unit with credit limit/credit check group value, checking parent units up the organization tree up to the root unit if credit limit / credit check group is not set in the unit
      Parameters:
      unit -
      Returns:
      unit with credit limit/check
    • updateBranchInSession

      void updateBranchInSession(Session session, UserModel currentUser)
      Sets the branch for the current use in the session.
      Parameters:
      session -
      currentUser -
    • getAllProcessDefinitionsNames

      Set<String> getAllProcessDefinitionsNames()
      Gets all process definition name registered with the ProcessDefinitionFactory
      Returns:
      A unique list of all Business process names.
    • disableUnit

      void disableUnit(B2BUnitModel unit)
      Disables a b2b unit
      Parameters:
      unit - the unit
    • enableUnit

      void enableUnit(B2BUnitModel unit)
      Enables a b2b unit
      Parameters:
      unit - the unit
    • setCurrentUnit

      void setCurrentUnit(B2BCustomerModel customer, B2BUnitModel unit)
      Assigns a default unit for a customer who may be a member of multiple units. and modifies a branch for this customers session based on the unit
      Parameters:
      customer - The current customer
      unit - A B2BUnitModel to be assigned as the default for a customer