Class Tenant

java.lang.Object
net.tangly.app.Tenant
All Implemented Interfaces:
net.tangly.core.domain.TenantDirectory, net.tangly.core.HasId

public class Tenant extends Object implements net.tangly.core.domain.TenantDirectory
A tenant has a set of bounded domains specific to an organizational entity. Each bounded domain can have a user interface or a REST interface. A tenant has a set of users and roles. Authorization rights are declared per uer and per bounded domain. The tenant is the root of the security model. Persistent data is stored on a per-tenant basis.

A tenant is configured through the properties file passed to the constructor. The identifier of the tenant is used to select the organization during the authentication process.

Tenants have no access to other tenants defined in the application.

  • Field Details

  • Constructor Details

    • Tenant

      public Tenant(@NotNull @NotNull Properties properties)
  • Method Details

    • id

      public String id()
      Specified by:
      id in interface net.tangly.core.HasId
    • getProperty

      public String getProperty(@NotNull @NotNull String property)
      Specified by:
      getProperty in interface net.tangly.core.domain.TenantDirectory
    • boundedDomains

      public Collection<net.tangly.core.domain.BoundedDomain<?,?,?>> boundedDomains()
      Specified by:
      boundedDomains in interface net.tangly.core.domain.TenantDirectory
    • getBoundedDomain

      public Optional<net.tangly.core.domain.BoundedDomain<?,?,?>> getBoundedDomain(@NotNull @NotNull String name)
      Specified by:
      getBoundedDomain in interface net.tangly.core.domain.TenantDirectory
    • usersFor

      public List<String> usersFor(@NotNull @NotNull String domain)
      Specified by:
      usersFor in interface net.tangly.core.domain.TenantDirectory
    • activeUsersFor

      public List<String> activeUsersFor(@NotNull @NotNull String domain)
      Specified by:
      activeUsersFor in interface net.tangly.core.domain.TenantDirectory
    • docs

      public String docs(@NotNull @NotNull String domain)
      Specified by:
      docs in interface net.tangly.core.domain.TenantDirectory
    • isEnabled

      public boolean isEnabled(@NotNull @NotNull String domain)
    • properties

      public Properties properties()
    • startup

      public void startup(@NotNull @NotNull io.javalin.Javalin javalin)
      Initializes the tenant upon creation. Upon completion, the tenant is ready to be used in the application. Tenants are created when the first user of the tenant logs in.
    • shutdown

      public void shutdown()
      Shutdowns the tenant before unloading the tenant from the application. Tenants are shutdown when the last user of the tenant logs out.
    • boundedDomainRests

      public Map<String,BoundedDomainRest> boundedDomainRests()
    • registerBoundedDomain

      public void registerBoundedDomain(net.tangly.core.domain.BoundedDomain<?,?,?> domain)
    • apps

      public AppsBoundedDomain apps()
    • registerBoundedDomainRest

      public void registerBoundedDomainRest(BoundedDomainRest domain)
    • getBoundedDomainRest

      public Optional<BoundedDomainRest> getBoundedDomainRest(String name)
    • inMemory

      public boolean inMemory()
    • imports

      public String imports(String domain)
    • resources

      public String resources(String domain)
      Specified by:
      resources in interface net.tangly.core.domain.TenantDirectory
    • databases

      public String databases()