Class Company

java.lang.Object
overit.geocall.platform.Company
All Implemented Interfaces:
Serializable, Scoped

public class Company extends Object implements Scoped, Serializable
TODO: documentation
See Also:
  • Field Details

  • Constructor Details

    • Company

      protected Company(String pkg, long id)
  • Method Details

    • fromScope

      public static Company fromScope(String scope)
    • fromId

      public static Company fromId(long companyId)
    • fromLogin

      public static Company fromLogin(String login)
    • getCompany

      public Company getCompany()
      Specified by:
      getCompany in interface Scoped
    • isMaster

      public boolean isMaster()
    • getDescription

      public String getDescription()
      Returns:
      the description of the company
    • setDescription

      public void setDescription(String description)
      defines the description of the tenant
      Parameters:
      description - the descripton of the tenant
    • getId

      public Long getId()
      Returns the company of the identity
      Returns:
      The long that represents the id of the factory
    • getLogin

      public String getLogin()
      Returns the string used as company field to access the application
      Returns:
      The string used in the company field of the login page to autenticate and access the application
    • setLogin

      protected void setLogin(String login)
    • isActive

      public boolean isActive()
      Returns the boolean value indicating if the company is active or not
      Returns:
      The boolean value indicating if the company is active or not
    • setActive

      public void setActive(boolean active)
    • getFunctions

      public Set<String> getFunctions()
      Specified by:
      getFunctions in interface Scoped
    • hasFunction

      public boolean hasFunction(String function)
      Checks if this company has or not a specific privilege
      Parameters:
      function - The string that represent the specific privilege
      Returns:
      true if the company has the privilege (or if the parameter is null or an empty string), false otherwise
    • getCustomLayer

      public CustomLayer getCustomLayer()
    • getConfig

      public overit.geocall.config.Config getConfig()
    • getLicense

      public overit.geocall.licensing.NextGenLicense getLicense()
      Returns the license
      Returns:
      the NextGenLicense
    • getPackage

      public String getPackage()
      Returns the package for the user currently logged in the application
      Returns:
      The package associated to the user
    • getUser

      public Long getUser()
      Specified by:
      getUser in interface Scoped
    • getUsername

      public String getUsername()
      Specified by:
      getUsername in interface Scoped
    • getBranch

      public Long getBranch()
      Specified by:
      getBranch in interface Scoped
    • getBranchDescription

      public String getBranchDescription()
      Specified by:
      getBranchDescription in interface Scoped
    • getDBFieldMap

      public DBFieldMap getDBFieldMap()
      Specified by:
      getDBFieldMap in interface Scoped
    • getDBClientIdentifier

      public String getDBClientIdentifier()
      Specified by:
      getDBClientIdentifier in interface Scoped
    • getSecretsManager

      @Deprecated(since="11.0", forRemoval=true) public SecretsManager getSecretsManager(SecretsManagerType secretsManagersType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use SecretsManagerProvider.getInstance().get(companyId, secretsManagerType) instead.

      Returns the SecretsManager instance by passing its SecretsManagerType. If it doesn't exist it's created.
      Parameters:
      secretsManagersType - the type of the secrets manager
      Returns:
      the secretsManager
    • getPrefix

      public String getPrefix()
      Returns the company prefix consisting of COMPANY_PREFIX followed by the company ID.
      Returns:
      the company prefix (e.g., c123).
    • getFormattedId

      public String getFormattedId()
      Returns this company ID, padded to 3 characters, using the 0 as padding character, so that a company ID with value 48 becomes 048.
      Returns:
      this company ID, padded to 3 characters, using the 0 as padding character, so that a company ID with value 48 becomes 048.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object