public static class TenantManager.Tenant
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<java.lang.String,TenantDatabaseDescriptor> |
dbLogicalInstances
A map that stores database settings for a specific database based on the database logical name.
|
private java.util.Map<java.lang.String,TenantDatabaseDescriptor> |
dbPhysicalInstances
A map that stores database settings for a specific database based on the database physical name.
|
private boolean |
status
The status of the tenant (enabled/disabled).
|
private java.util.UUID |
tenantId
The tenant ID.
|
private java.lang.String |
tenantName
The name of the tenant.
|
| Modifier | Constructor and Description |
|---|---|
private |
Tenant(java.lang.String tenantName,
java.util.List<TenantDatabaseDescriptor> databases)
Constructor that generates a random
UUID for the tenant. |
private |
Tenant(TenantManager.Tenant other)
Copy constructor.
|
private |
Tenant(java.util.UUID tenantId,
java.lang.String tenantName,
java.util.List<TenantDatabaseDescriptor> databases)
Constructor that sets all the fields required by a tenant, including the tenant id UUID.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
addDatabaseInstance(java.lang.String pdbName,
TenantDatabaseDescriptor db)
Add a database configuration for this tenant.
|
java.util.Map<java.lang.String,TenantDatabaseDescriptor> |
getDatabaseCredentials()
Get all the database settings/credentials assigned to this tenant.
|
TenantDatabaseDescriptor |
getDatabaseCredentials(java.lang.String dbName,
boolean physical)
Get the database settings/credentials of a given database.
|
java.util.UUID |
getId()
Getter for the tenant ID.
|
boolean |
getStatus()
Getter for the status field (enabled/disabled).
|
java.lang.String |
getTenantName()
Getter for the tenant name.
|
private void |
removeDatabaseInstance(java.lang.String pdbName)
Remove the database configuration for this tenant.
|
void |
setField(java.lang.String pdbName,
java.lang.String fieldName,
java.lang.String value)
Set a specific field for this tenant.
|
void |
setStatus(boolean value)
Setter for the
status field. |
private final java.util.UUID tenantId
private java.lang.String tenantName
private java.util.Map<java.lang.String,TenantDatabaseDescriptor> dbPhysicalInstances
private java.util.Map<java.lang.String,TenantDatabaseDescriptor> dbLogicalInstances
private boolean status
private Tenant(java.lang.String tenantName,
java.util.List<TenantDatabaseDescriptor> databases)
UUID for the tenant.tenantName - The name of the tenant.databases - A list of the databases that will be used by the tenant.private Tenant(java.util.UUID tenantId,
java.lang.String tenantName,
java.util.List<TenantDatabaseDescriptor> databases)
tenantId - The ID of the tenant.tenantName - The name of the tenant.databases - A list of the databases that will be used by the tenant.private Tenant(TenantManager.Tenant other)
other - The other instance from which to copy the information.public java.lang.String getTenantName()
public TenantDatabaseDescriptor getDatabaseCredentials(java.lang.String dbName, boolean physical)
dbName - The name of the database for which to retrieve the information.physical - true if the given database name is the physical one,
false if the database name is the logical one.TenantDatabaseDescriptor that stores the information for the given database.public java.util.Map<java.lang.String,TenantDatabaseDescriptor> getDatabaseCredentials()
public java.util.UUID getId()
public boolean getStatus()
true if the tenant is enabled, false otherwise.public void setField(java.lang.String pdbName,
java.lang.String fieldName,
java.lang.String value)
fieldName parameter are:
pdbName - The physical name of the database for which to perform the update.fieldName - The name of the field to be updated.value - The new value for the given field.public void setStatus(boolean value)
status field.
A value of true denotes the enabling of this tenant, while false denotes
disabling this tenant.value - The new value for the status field.private void addDatabaseInstance(java.lang.String pdbName,
TenantDatabaseDescriptor db)
pdbName - The physical name of the database.db - The database information to be added.private void removeDatabaseInstance(java.lang.String pdbName)
pdbName - The physical name of the database for which to remove the configuration.