public interface PersistenceManager
TBD : Exceptions in all my interfaces need revisiting
Modifier and Type | Method and Description |
---|---|
void |
deleteTenantConfiguration(java.lang.String tenantId)
Used when a tenant unregisters from the system.
|
boolean |
getTenantActivationStatus(java.lang.String tenantId) |
java.util.List<java.lang.String> |
getTenants() |
boolean |
isRegistered(java.lang.String tenantId) |
JpsConfigurationP |
load()
An XML based PM might use all the information from jps-config.xml.
|
java.beans.PropertyChangeEvent[] |
loadConfigChanges()
Once loaded a second call to this method should return null unless there were further changes.
|
TenantConfig |
loadTenantConfiguration(java.lang.String tenantId)
This method populates the Tenant;s Service Configuration and BootConfiguration in the supplied method parameters.
|
<T extends ConfigPersistenceElement> |
persist(T element)
API to store a particular Persistence Layer Configuration Element.
|
void |
persistConfigChanges(java.beans.PropertyChangeEvent[] changes)
Persist the Property changes.
|
void |
persistTenantConfiguration(java.lang.String tenantId, java.util.List<ServiceInstanceP> serviceConfig, java.util.List<ServiceInstanceP> bootConfig) |
void |
setTenantActivationStatus(java.lang.String tenantId, boolean status)
Sets the tenant's Activation Status
|
<T extends ConfigPersistenceElement> void persist(T element) throws ConfigurationPersistenceException
Depending on the particular DataStore type used it may or maynot be possible to store a particular kind of Configuration Element. For example the only Configuration Element that can be stored by an XML Persistence Manager is the root element JpsConfigurationP. Whereas a DB based Persistence Manager can store child named child elements like JpsContextP or a ServiceInstanceP.
element
- the configuration element to storeConfigurationPersistenceException
- if there was an error during persistencejava.lang.UnsupportedOperationException
- if the Persistence Manager does not support persisting the particular element.JpsConfigurationP load() throws ConfigurationPersistenceException
A Hybrid PM might be useful in most scenarios where it will pickup the ServiceProvider definitions from a jps-config.xml but should be able to pickup a set of ServiceInstanceP configurations (or a JpsContextP configuration) from a DB/LDAP DataStore.
ConfigurationPersistenceException
- if there was an error in loading configuration.void persistConfigChanges(java.beans.PropertyChangeEvent[] changes) throws ConfigurationPersistenceException
Currently all Persistence Managers are expected to produce this. Primarily because the Portable JMX Framework API's require the results of a change to be reflected in a file that is then propagated to the ManagedServers.
TBD: need to revisit this in the next release.changes
- the property changesConfigurationPersistenceException
- if there was an error while persisting the changesjava.beans.PropertyChangeEvent[] loadConfigChanges() throws ConfigurationPersistenceException
TODO : revisit the semantics
ConfigurationPersistenceException
- if there was an error while persisting the changesvoid deleteTenantConfiguration(java.lang.String tenantId) throws ConfigurationPersistenceException
tenantId
- : the ID of the tenant whose configuration needs to be deleted from a system.ConfigurationPersistenceException
- if there was an error while deleting the configTenantConfig loadTenantConfiguration(java.lang.String tenantId) throws ConfigurationPersistenceException
tenantId
-serviceConfig
- the tenant's service configuration.bootConfig
- the tenant;s boot configuration.ConfigurationPersistenceException
- if there was an error while getting the configurationvoid persistTenantConfiguration(java.lang.String tenantId, java.util.List<ServiceInstanceP> serviceConfig, java.util.List<ServiceInstanceP> bootConfig) throws ConfigurationPersistenceException
tenantId
-serviceConfig
- the tenant's service configuration.bootConfig
- the tenant;s boot configuration.ConfigurationPersistenceException
- if there was an error while persisting the configurationvoid setTenantActivationStatus(java.lang.String tenantId, boolean status)
tenantId
-status
- true indicates activate the tenant, false indicates deactivateboolean getTenantActivationStatus(java.lang.String tenantId)
tenantId
-boolean isRegistered(java.lang.String tenantId) throws ConfigurationPersistenceException
java.util.List<java.lang.String> getTenants() throws ConfigurationPersistenceException