Skip navigation links

Oracle Fusion Middleware Management Java API Reference for Oracle Entitlements Server
11g Release 2 (11.1.2)

E54416-01


oracle.security.opss.config.persistence.factory
Interface PersistenceManager


public interface PersistenceManager

The Persistence Manager associated with the MetaFactory. Allows JpsConfigurationP persistence layer elements to be stored in a particular physical Data Store

TBD : Exceptions in all my interfaces need revisiting

Author:
vbkumarjayanti

Method Summary
 void addConfigListener(ConfigListener listener)
           
 void deleteConfigProfile(java.lang.String profileId)
          Delete a Configuration Profile
 void deleteContextConfiguration(java.lang.String contextId)
          Used when a configuration context unregisters from the system.
 void deleteTenantConfiguration(java.lang.String tenantId)
          Used when a tenant unregisters from the system.
 void exportConfiguration(java.lang.String contextId, java.io.OutputStream stream)
           
 void exportProfile(java.lang.String profileId, java.io.OutputStream stream)
          Export the configuration of a Profile to the outputstream.
 java.lang.String getAlias(java.lang.String contextId)
           
 java.util.List<java.lang.String> getContextConfigurationIds()
           
 java.util.List<java.lang.String> getContextConfigurationIds(java.lang.String profileId)
           
 java.lang.String getContextId(java.lang.String alias)
           
 java.util.List<java.lang.String> getProfileIds()
           
 ConfigurationManagementService.CONFIG_STATE getState(java.lang.String contextId)
           
 boolean getTenantActivationStatus(java.lang.String tenantId)
           
 java.util.List<java.lang.String> getTenants()
           
 boolean isRegistered(java.lang.String contextId)
           
 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.
 PersistenceConfiguration loadContextConfiguration(java.lang.String contextId)
          This method populates the Services Configuration and BootConfiguration for the supplied context
 TenantConfig loadTenantConfiguration(java.lang.String tenantId)
          This method populates the Tenant;s Service Configuration and BootConfiguration in the supplied method parameters.
<T extends ConfigPersistenceElement>
void
persist(T element)
          API to store a particular Persistence Layer Configuration Element.
 void persistConfigChanges(java.beans.PropertyChangeEvent[] changes)
          Persist the Property changes.
 void persistConfigProfile(java.lang.String profileId, java.io.InputStream config)
          Persist a Configuration Profile
 void persistContextConfiguration(java.lang.String contextId, java.util.List<ServiceInstanceP> serviceConfig, java.util.List<ServiceInstanceP> bootConfig)
          Persist an explicitly defined context configuration TODO: we may not require this if the proposed Template Approach is sufficient for end customer usecases.
 void persistContextConfiguration(java.lang.String contextId, java.lang.String profileId, javax.security.auth.callback.CallbackHandler customizationHandler)
          Persist a Context Configuration as a customization of a Profile
 void persistContextConfiguration(java.lang.String contextId, java.lang.String profileId, java.util.List<ConfigurationManagementService.ConfigCustomization> customization, java.util.List<ConfigurationManagementService.ConfigCustomization> bootCustomization)
          Persist a Context Configuration as a customization of a Profile
 void persistTenantConfiguration(java.lang.String tenantId, java.util.List<ServiceInstanceP> serviceConfig, java.util.List<ServiceInstanceP> bootConfig)
           
 void removeConfigListener(ConfigListener listener)
           
 void setAlias(java.lang.String contextId, java.lang.String alias)
          Sets an Alias for a named Context.
 void setState(java.lang.String contextId, ConfigurationManagementService.CONFIG_STATE state)
          Sets the Activation State
 void setTenantActivationStatus(java.lang.String tenantId, boolean status)
          Sets the tenant's Activation Status
 java.lang.String unsetAlias(java.lang.String contextId)
          Unset the Alias of a named Context.
 void updateContextConfiguration(java.lang.String contextId, javax.security.auth.callback.CallbackHandler customizationHandler, boolean replace, boolean complete)
          Update an existing Context Configuration with additional Customizations or replace the existing customization with the ones supplied.
 void updateContextConfiguration(java.lang.String contextId, java.util.List<ConfigurationManagementService.ConfigCustomization> customization, java.util.List<ConfigurationManagementService.ConfigCustomization> bootCustomization, boolean replace, boolean complete)
          Update an existing Context Configuration with additional Customizations or replace the existing customization with the ones supplied.

 

Method Detail

persist

<T extends ConfigPersistenceElement> void persist(T element)
             throws ConfigurationPersistenceException
API to store a particular Persistence Layer Configuration Element.

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.

Parameters:
element - the configuration element to store
Throws:
ConfigurationPersistenceException - if there was an error during persistence
java.lang.UnsupportedOperationException - if the Persistence Manager does not support persisting the particular element.

load

JpsConfigurationP load()
                       throws ConfigurationPersistenceException
An XML based PM might use all the information from jps-config.xml. A DB based PM might use all information from the DB.

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.

Returns:
the JpsConfigurationP loaded from the DataStore.
Throws:
ConfigurationPersistenceException - if there was an error in loading configuration.

deleteContextConfiguration

void deleteContextConfiguration(java.lang.String contextId)
                                throws ConfigurationPersistenceException
Used when a configuration context unregisters from the system.
Parameters:
contextId -
Throws:
ConfigurationPersistenceException - if there was an error while deleting the config

loadContextConfiguration

PersistenceConfiguration loadContextConfiguration(java.lang.String contextId)
                                                  throws ConfigurationPersistenceException
This method populates the Services Configuration and BootConfiguration for the supplied context
Parameters:
contextId - the contextId for which the configuration needs to be loaded
Returns:
the PersistenceConfiguration Object.
Throws:
ConfigurationPersistenceException - if there was an error while getting the configuration

persistContextConfiguration

void persistContextConfiguration(java.lang.String contextId,
                                 java.util.List<ServiceInstanceP> serviceConfig,
                                 java.util.List<ServiceInstanceP> bootConfig)
                                 throws ConfigurationPersistenceException
Persist an explicitly defined context configuration TODO: we may not require this if the proposed Template Approach is sufficient for end customer usecases.
Parameters:
contextId - the contextId for which the configuration needs to be persisted
serviceConfig - the service configuration.
bootConfig - the boot configuration.
Throws:
ConfigurationPersistenceException - if there was an error while persisting the configuration

persistConfigProfile

void persistConfigProfile(java.lang.String profileId,
                          java.io.InputStream config)
                          throws ConfigurationPersistenceException,
                                 java.io.IOException
Persist a Configuration Profile
Parameters:
profileId - the name of the configuration profile
config -
Throws:
ConfigurationPersistenceException - if there was an error in persisting
java.io.IOException - if there was an issue in reading from the Stream

deleteConfigProfile

void deleteConfigProfile(java.lang.String profileId)
                         throws ConfigurationPersistenceException
Delete a Configuration Profile
Parameters:
profileId -
Throws:
ConfigurationPersistenceException - if there was an error in deleting the configuration profile

persistContextConfiguration

void persistContextConfiguration(java.lang.String contextId,
                                 java.lang.String profileId,
                                 java.util.List<ConfigurationManagementService.ConfigCustomization> customization,
                                 java.util.List<ConfigurationManagementService.ConfigCustomization> bootCustomization)
                                 throws ConfigurationPersistenceException
Persist a Context Configuration as a customization of a Profile
Parameters:
contextId - the name of the Context Configuration being persisted
profileId - the configuration profile that will be used as the base
customization - the customizations to be applied for the service configurations
bootCustomization - the customizations to be applied for the bootstrap configuration
Throws:
ConfigurationException
ConfigurationPersistenceException

persistContextConfiguration

void persistContextConfiguration(java.lang.String contextId,
                                 java.lang.String profileId,
                                 javax.security.auth.callback.CallbackHandler customizationHandler)
                                 throws ConfigurationPersistenceException
Persist a Context Configuration as a customization of a Profile
Parameters:
contextId - the name of the Context Configuration being persisted
profileId - the configuration profile that will be used as the base
customizationHandler - A CallBackHandler that can handle the CustomizationCallback to obtain the base Configuration as a DOM element on which it can perform the required Customizations.
Throws:
ConfigurationException
ConfigurationPersistenceException

updateContextConfiguration

void updateContextConfiguration(java.lang.String contextId,
                                java.util.List<ConfigurationManagementService.ConfigCustomization> customization,
                                java.util.List<ConfigurationManagementService.ConfigCustomization> bootCustomization,
                                boolean replace,
                                boolean complete)
                                throws ConfigurationPersistenceException
Update an existing Context Configuration with additional Customizations or replace the existing customization with the ones supplied.
Parameters:
contextId - the name of the Context Configuration being persisted
customization - the customizations to be applied for the service configurations
bootCustomization - the customizations to be applied for the bootstrap configuration
replace - a boolean flag indicating whether to apply the customization on top of existing customization or replace the existing one with what is supplied.
complete - when true it sets the configuration state to complete post this operation
Throws:
ConfigurationPersistenceException

updateContextConfiguration

void updateContextConfiguration(java.lang.String contextId,
                                javax.security.auth.callback.CallbackHandler customizationHandler,
                                boolean replace,
                                boolean complete)
                                throws ConfigurationPersistenceException
Update an existing Context Configuration with additional Customizations or replace the existing customization with the ones supplied.
Parameters:
contextId - the name of the Context Configuration being persisted
customizationHandler - A CallBackHandler that can handle the CustomizationCallback to obtain the base Configuration as a DOM element on which it can perform the required Customizations.
replace - a boolean flag indicating whether to apply the customization on top of existing customization or replace the existing one with what is supplied.
complete - when true it sets the configuration state to complete post this operation
Throws:
ConfigurationPersistenceException

setState

void setState(java.lang.String contextId,
              ConfigurationManagementService.CONFIG_STATE state)
              throws ConfigurationPersistenceException
Sets the Activation State
Parameters:
contextId - the name of the Context Configuration
Throws:
ConfigurationPersistenceException

getState

ConfigurationManagementService.CONFIG_STATE getState(java.lang.String contextId)
                                                     throws ConfigurationPersistenceException
Parameters:
contextId - the name of the Context Configuration
Returns:
the activation status.
Throws:
ConfigurationPersistenceException

isRegistered

boolean isRegistered(java.lang.String contextId)
                     throws ConfigurationPersistenceException
Parameters:
contextId - the name of the Context Configuration
Returns:
true if a configuration with the name is registered
Throws:
ConfigurationPersistenceException - if there was an error in querying the status

getContextConfigurationIds

java.util.List<java.lang.String> getContextConfigurationIds()
                                                            throws ConfigurationPersistenceException
Returns:
the ContextId's of the registered Context Configurations.
Throws:
ConfigurationPersistenceException

getContextConfigurationIds

java.util.List<java.lang.String> getContextConfigurationIds(java.lang.String profileId)
                                                            throws ConfigurationPersistenceException
Parameters:
profileId - the profile under which the configurations are to be fetched
Returns:
the ContextId's of the registered Context Configurations.
Throws:
ConfigurationPersistenceException

getProfileIds

java.util.List<java.lang.String> getProfileIds()
                                               throws ConfigurationPersistenceException
Returns:
the profile's registered with the service.
Throws:
ConfigurationPersistenceException

addConfigListener

void addConfigListener(ConfigListener listener)
                       throws ConfigurationPersistenceException
Parameters:
listener - the listener to be notified for config state changes
Throws:
AccessControlException - if the code does not have permission to invoke this operation
ConfigurationException - if there was an error in registering the listener
java.lang.IllegalArgumentException - if the listener was supplied as null;
ConfigurationPersistenceException

removeConfigListener

void removeConfigListener(ConfigListener listener)
                          throws ConfigurationPersistenceException
Parameters:
listener - the listener to be removed from the notification service
Throws:
ConfigurationException - if there was an error in un-registering the listener or if the listener was not registered.
ConfigurationPersistenceException

persistConfigChanges

void persistConfigChanges(java.beans.PropertyChangeEvent[] changes)
                          throws ConfigurationPersistenceException
Persist the Property changes. An XML based PM might produce a config-changes.xml

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.
Parameters:
changes - the property changes
Throws:
ConfigurationPersistenceException - if there was an error while persisting the changes

loadConfigChanges

java.beans.PropertyChangeEvent[] loadConfigChanges()
                                                   throws ConfigurationPersistenceException
Once loaded a second call to this method should return null unless there were further changes. IOW, a call to this would purge the changes persisted at the DataSource.

TODO : revisit the semantics

Returns:
the set of property changes registered in the DataSource (currently only from a jps-config.xml)
Throws:
ConfigurationPersistenceException - if there was an error while persisting the changes

deleteTenantConfiguration

void deleteTenantConfiguration(java.lang.String tenantId)
                               throws ConfigurationPersistenceException
Used when a tenant unregisters from the system.
Parameters:
tenantId - : the ID of the tenant whose configuration needs to be deleted from a system.
Throws:
ConfigurationPersistenceException - if there was an error while deleting the config

loadTenantConfiguration

TenantConfig loadTenantConfiguration(java.lang.String tenantId)
                                     throws ConfigurationPersistenceException
This method populates the Tenant;s Service Configuration and BootConfiguration in the supplied method parameters.
Parameters:
tenantId -
serviceConfig - the tenant's service configuration.
bootConfig - the tenant;s boot configuration.
Throws:
ConfigurationPersistenceException - if there was an error while getting the configuration

persistTenantConfiguration

void persistTenantConfiguration(java.lang.String tenantId,
                                java.util.List<ServiceInstanceP> serviceConfig,
                                java.util.List<ServiceInstanceP> bootConfig)
                                throws ConfigurationPersistenceException
Parameters:
tenantId -
serviceConfig - the tenant's service configuration.
bootConfig - the tenant;s boot configuration.
Throws:
ConfigurationPersistenceException - if there was an error while persisting the configuration

setTenantActivationStatus

void setTenantActivationStatus(java.lang.String tenantId,
                               boolean status)
Sets the tenant's Activation Status
Parameters:
tenantId -
status - true indicates activate the tenant, false indicates deactivate

getTenantActivationStatus

boolean getTenantActivationStatus(java.lang.String tenantId)
Parameters:
tenantId -
Returns:
the tenant's activation status.

getTenants

java.util.List<java.lang.String> getTenants()
                                            throws ConfigurationPersistenceException
Throws:
ConfigurationPersistenceException

setAlias

void setAlias(java.lang.String contextId,
              java.lang.String alias)
              throws ConfigurationPersistenceException
Sets an Alias for a named Context. Only one Alias can be set for named context.
Parameters:
contextId - the context to be aliased
alias - the alias for the contexId
Throws:
ConfigurationPersistenceException - if there was a problem in setting the Alias

unsetAlias

java.lang.String unsetAlias(java.lang.String contextId)
                            throws ConfigurationPersistenceException
Unset the Alias of a named Context.
Parameters:
contextId - the context to be de-aliased
Returns:
the current alias if any was set prior to the call, or null
Throws:
ConfigurationPersistenceException - if there was a problem in unsetting the alias

getAlias

java.lang.String getAlias(java.lang.String contextId)
                          throws ConfigurationPersistenceException
Parameters:
contextId -
Returns:
the Alias (if any) associated with the contextId, null otherwise
Throws:
ConfigurationPersistenceException - if there was a problem in getting the alias

getContextId

java.lang.String getContextId(java.lang.String alias)
                              throws ConfigurationPersistenceException
Parameters:
alias -
Returns:
the contextId (if any) associated with the alias, null otherwise
Throws:
ConfigurationPersistenceException - if there was a problem in getting the alias

exportProfile

void exportProfile(java.lang.String profileId,
                   java.io.OutputStream stream)
                   throws ConfigurationPersistenceException,
                          java.io.IOException
Export the configuration of a Profile to the outputstream.
Parameters:
profileId - the id of the profile whose configuration has to be exported
stream - the outputstream to which the profile needs to be written to
Throws:
ConfigurationPersistenceException - if there was a problem in retrieving the configuration
java.io.IOException - if there was a problem in writing to the stream

exportConfiguration

void exportConfiguration(java.lang.String contextId,
                         java.io.OutputStream stream)
                         throws ConfigurationPersistenceException,
                                java.io.IOException
Parameters:
contextId - the contextId whose complete configuration and bootstrap configuration is desired
stream - the outputstream to which the configuration needs to be written to
Throws:
ConfigurationPersistenceException - if there was a problem in retrieving the configuration
java.io.IOException - if there was a problem in writing to the stream

Skip navigation links

Oracle Fusion Middleware Management Java API Reference for Oracle Entitlements Server
11g Release 2 (11.1.2)

E54416-01


Copyright © 2011, 2015, Oracle and/or its affiliates. All rights reserved.