Class Tenant

java.lang.Object
africa.absa.inception.security.Tenant
All Implemented Interfaces:
Serializable

@Entity public class Tenant extends Object implements Serializable
The Tenant class holds the information for a tenant.
Author:
Marcus Portmann
See Also:
  • Constructor Details

    • Tenant

      public Tenant()
      Constructs a new Tenant.
    • Tenant

      public Tenant(String name, TenantStatus status)
      Constructs a new Tenant.
      Parameters:
      name - the name of the tenant
      status - the status for the tenant
    • Tenant

      public Tenant(UUID id, String name, TenantStatus status)
      Constructs a new Tenant.
      Parameters:
      id - the ID for the tenant
      name - the name of the tenant
      status - the status for the tenant
  • Method Details

    • equals

      public boolean equals(Object object)
      Indicates whether some other object is "equal to" this one.
      Overrides:
      equals in class Object
      Parameters:
      object - the reference object with which to compare
      Returns:
      true if this object is the same as the object argument otherwise false
    • getCreated

      public LocalDateTime getCreated()
      Returns the date and time the tenant was created.
      Returns:
      the date and time the tenant was created
    • getId

      public UUID getId()
      Returns the ID for the tenant.
      Returns:
      the ID for the tenant
    • getName

      public String getName()
      Returns the name of the tenant.
      Returns:
      the name of the tenant
    • getStatus

      public TenantStatus getStatus()
      Returns the status for the tenant.
      Returns:
      the status for the tenant
    • getUpdated

      public LocalDateTime getUpdated()
      Returns the date and time the tenant was last updated.
      Returns:
      the date and time the tenant was last updated
    • getUserDirectories

      public Set<UserDirectory> getUserDirectories()
      Returns the user directories associated with the tenant.
      Returns:
      the user directories associated with the tenant
    • hashCode

      public int hashCode()
      Returns a hash code value for the object.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for the object
    • linkUserDirectory

      public void linkUserDirectory(UserDirectory userDirectory)
      Link the user directory to the tenant.
      Parameters:
      userDirectory - the user directory
    • setId

      public void setId(UUID id)
      Set the ID for the tenant.
      Parameters:
      id - the ID for the tenant
    • setName

      public void setName(String name)
      Set the name of the tenant.
      Parameters:
      name - the name of the tenant
    • setStatus

      public void setStatus(TenantStatus status)
      Set the status for the tenant.
      Parameters:
      status - the status for the tenant
    • setUserDirectories

      public void setUserDirectories(Set<UserDirectory> userDirectories)
      Set the user directories associated with the tenant.
      Parameters:
      userDirectories - the user directories associated with the tenant
    • unlinkUserDirectory

      public void unlinkUserDirectory(UserDirectory userDirectory)
      Unlink the user directory from the tenant.
      Parameters:
      userDirectory - the user directory
    • onCreate

      protected void onCreate()
      The Java Persistence callback method invoked before the entity is created in the database.
    • onUpdate

      protected void onUpdate()
      The Java Persistence callback method invoked before the entity is updated in the database.