public interface ConfigurationManagementService extends ServiceLifecycle, OpssServiceInstance
Modifier and Type | Interface and Description |
---|---|
static class |
ConfigurationManagementService.CONFIG_STATE |
static interface |
ConfigurationManagementService.ConfigCustomization
A Configuration Customization.
|
static class |
ConfigurationManagementService.SERVICE_MODE |
OpssServiceInstance.State
JpsPersistable.Mode
Modifier and Type | Method and Description |
---|---|
void |
activateContextConfiguration(java.lang.String contextId)
Activate a registered configuration.
|
void |
addConfigListener(ConfigListener listener, ConfigEvent[] filter) |
void |
createConfigurationProfile(java.lang.String profileId, java.net.URI profileXml) |
void |
createContextConfiguration(java.lang.String contextId, java.util.List<ServiceInstanceDescriptor> serviceConfig, java.util.List<ServiceInstanceDescriptor> bootstrapConfig)
Register a new configuration with the Configuration Service using explicit service definitions.
|
void |
createContextConfiguration(java.lang.String contextId, java.lang.String profileId, javax.security.auth.callback.CallbackHandler customizationHandler)
Create a new ContextConfiguration using a base Template/Profile.
|
void |
createContextConfiguration(java.lang.String contextId, java.lang.String profileId, java.util.List<ConfigurationManagementService.ConfigCustomization> customization, java.util.List<ConfigurationManagementService.ConfigCustomization> bootCustomization)
Create a new ContextConfiguration using a base Template/Profile.
|
void |
deactivateContextConfiguration(java.lang.String contextId)
Deactivate a registered Context Configuration
|
void |
deleteConfigurationProfile(java.lang.String profileId) |
void |
deleteContextConfiguration(java.lang.String contextId)
Unregister a Context Configuration.
|
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.
|
ContextConfiguration |
getContextBootstrapConfiguration(java.lang.String contextId) |
ContextConfiguration |
getContextConfiguration(java.lang.String contextId) |
java.util.List<java.lang.String> |
getContextConfigurationIds() |
java.util.List<java.lang.String> |
getContextConfigurationIds(ConfigurationManagementService.CONFIG_STATE state) |
java.util.List<java.lang.String> |
getContextConfigurationIds(ConfigurationManagementService.CONFIG_STATE state, java.lang.String profileId) |
java.util.List<java.lang.String> |
getContextConfigurationIds(java.lang.String profileId) |
ConfigurationManagementService.CONFIG_STATE |
getContextConfigurationState(java.lang.String contextId) |
java.lang.String |
getContextId(ContextNameEncoder contextNameEncoder) |
java.lang.String |
getContextName(java.lang.String contextId) |
ContextConfiguration |
getDefaultBootstrapConfiguration() |
ContextConfiguration |
getDefaultConfiguration() |
JpsConfiguration |
getJpsConfiguration() |
ContextConfiguration |
getJpsContextConfiguration(java.lang.String contextId) |
ConfigurationManagementService.SERVICE_MODE |
getMode() |
java.util.List<java.lang.String> |
getProfileIds() |
java.util.List<ServiceProviderDescriptor> |
getServiceProviders() |
boolean |
isRegistered(java.lang.String contextId) |
void |
removeConfigListener(ConfigListener listener) |
void |
setContextName(java.lang.String contextId, ContextNameEncoder contextNameEncoder)
Sets a unique name for a Context identified by its contextId.
|
java.lang.String |
unsetContextName(java.lang.String contextId)
Unset the name of a named Context.
|
void |
updateContextConfiguration(java.lang.String contextId, javax.security.auth.callback.CallbackHandler customizationHandler, boolean replace, boolean complete)
Update a ContextConfiguration.
|
void |
updateContextConfiguration(java.lang.String contextId, java.util.List<ConfigurationManagementService.ConfigCustomization> customization, java.util.List<ConfigurationManagementService.ConfigCustomization> bootCustomization, boolean replace, boolean complete)
Update a ContextConfiguration.
|
postStart, preStart, restart, start, stop, terminate
getState
accept, getName, getServiceProvider
persist, refresh
ConfigurationManagementService.SERVICE_MODE getMode()
java.util.List<ServiceProviderDescriptor> getServiceProviders()
ConfigurationRuntimeException
- if there was an error in fetching the configurationContextConfiguration getDefaultBootstrapConfiguration()
ConfigurationRuntimeException
- if there was an error in fetching the configurationContextConfiguration getDefaultConfiguration()
ConfigurationRuntimeException
- if there was an error in fetching the configurationJpsConfiguration getJpsConfiguration()
ConfigurationRuntimeException
- if there was an error in fetching the configurationContextConfiguration getJpsContextConfiguration(java.lang.String contextId) throws ConfigurationException
ConfigurationException
- if there was an error in fetching the configurationvoid createConfigurationProfile(java.lang.String profileId, java.net.URI profileXml) throws ConfigurationException
profileId
- the unique identifier for the profileprofileXml
- A template jps-config.xml that defines the Configuration ProfileConfigurationException
- if there was an error in creating the configuration profilevoid deleteConfigurationProfile(java.lang.String profileId) throws ConfigurationException, RegistrationException
profileId
- the unique identifier for the profileConfigurationException
- if there was an error in deleting the configuration profileRegistrationException
- if a profile with the profileId is not registered.ContextConfiguration getContextConfiguration(java.lang.String contextId) throws ConfigurationException, RegistrationException
contextId
- the unique identifier for the context whose Configuration is desiredAccessControlException
- if the code does not have permission to invoke this operationConfigurationException
- if there was an error in fetching the configurationRegistrationException
- if a configuration with the contextId is not registered.ContextConfiguration getContextBootstrapConfiguration(java.lang.String contextId) throws ConfigurationException, RegistrationException
contextId
- the unique identifier for the bootstrap context whose Configuration is desiredAccessControlException
- if the code does not have permission to invoke this operationConfigurationException
- if there was an error in fetching the configurationRegistrationException
- if a configuration with the contextId is not registered.void createContextConfiguration(java.lang.String contextId, java.util.List<ServiceInstanceDescriptor> serviceConfig, java.util.List<ServiceInstanceDescriptor> bootstrapConfig) throws ConfigurationException, RegistrationException
contextId
- the unique identifier for the ContextConfigurationservicesConfig
- the services configurationbootstrapConfig
- the bootstrap configuration.RegistrationException
- if a Config with the contextId is already registeredAccessControlException
- if the code does not have permission to invoke this operationConfigurationException
- if there was an error in creating the configurationvoid createContextConfiguration(java.lang.String contextId, java.lang.String profileId, java.util.List<ConfigurationManagementService.ConfigCustomization> customization, java.util.List<ConfigurationManagementService.ConfigCustomization> bootCustomization) throws ConfigurationException, RegistrationException
contextId
- the unique identifier for the ContextConfigurationprofileId
- the base profile name from which to derive the Context Configurationcustomization
- the customization to be applied to the profilebootCustomization
- the customization to be applied to the bootstrap configuration implied by the profile, can be null.RegistrationException
- if a Config with the contextId is already registeredAccessControlException
- if the code does not have permission to invoke this operationConfigurationException
- if there was an error in creating the configurationvoid createContextConfiguration(java.lang.String contextId, java.lang.String profileId, javax.security.auth.callback.CallbackHandler customizationHandler) throws ConfigurationException
contextId
- the unique identifier for the ContextConfigurationprofileId
- the base profile name from which to derive the Context ConfigurationcustomizationHandler
- A CallBackHandler that can handle the CustomizationCallback to obtain the base Configuration as a DOM element on which it can perform the required Customizations.ConfigurationException
void updateContextConfiguration(java.lang.String contextId, java.util.List<ConfigurationManagementService.ConfigCustomization> customization, java.util.List<ConfigurationManagementService.ConfigCustomization> bootCustomization, boolean replace, boolean complete) throws UnNamedContextException, RegistrationException, ConfigurationException
contextId
- the unique identifier for the ContextConfigurationcustomization
- the customization to be applied to the configuration, can be nullbootCustomization
- the customization to be applied to the bootstrap configuration implied by the profile, can be null.replace
- when set to true will completely replace the existing customizations with newly supplied customizations. When set to false the customizations supplied here are applied on top of the existing customizations (with matching targets overriding the old customization by newly supplied customization).complete
- when set to true will set the state of the configuration to COMPLETE.ConfigurationException
- if there was an error in performing the operation or if the state of the context configuration is not INACTIVE/CREATED when the method was called. A ConfigurationException is also thrown if complete flag was set to true and the configuration was actually completed earlier.UnNamedContextException
- if a contextName was not set for the contextRegistrationException
- if a Config with the contextId does not existAccessControlException
- if the code does not have permission to invoke this operationvoid updateContextConfiguration(java.lang.String contextId, javax.security.auth.callback.CallbackHandler customizationHandler, boolean replace, boolean complete) throws UnNamedContextException, RegistrationException, ConfigurationException
contextId
- the unique Identifier of the contextConfigurationcustomizationHandler
- 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
- when set to true will completely replace the existing customizations with newly supplied customizations. When set to false the customizations supplied here are applied on top of the existing customizations (with matching targets overriding the old customization by newly supplied customization).complete
- when set to true will set the state of the configuration to COMPLETE.ConfigurationException
- if there was an error in performing the operation or if the state of the context configuration is not INACTIVE/CREATED when the method was called. A ConfigurationException is also thrown if complete flag was set to true and the configuration was actually completed earlier.UnNamedContextException
- if a contextName was not set for the contextRegistrationException
- if a context with the contextId does not existAccessControlException
- if the code does not have permission to invoke this operationvoid deleteContextConfiguration(java.lang.String contextId) throws ConfigurationException, RegistrationException
contextId
- the context identifierRegistrationException
- if a context with the contextId is not registeredAccessControlException
- if the code does not have permission to invoke this operationConfigurationException
- if there was an error in fetching the configurationboolean isRegistered(java.lang.String contextId) throws ConfigurationException
contextId
- the context identifierConfigurationException
- if there is an error in determining the registration status.AccessControlException
- if the code does not have permission to invoke this operationvoid activateContextConfiguration(java.lang.String contextId) throws ConfigurationException, RegistrationException, ActivationException
contextId
- the context identifierAccessControlException
- if the code does not have permission to invoke this operationRegistrationException
- if a config with the contextId is not registered.ActivationException
- if a config with the contextId is already active.ConfigurationException
- if there was an error in fetching the configurationvoid deactivateContextConfiguration(java.lang.String contextId) throws ConfigurationException, RegistrationException, ActivationException
contextId
- the context identifierAccessControlException
- if the code does not have permission to invoke this operationRegistrationException
- if a context with the contextId is not registered.ActivationException
- if a context with the contextId not active.ConfigurationException
- if there was an error in fetching the configurationConfigurationManagementService.CONFIG_STATE getContextConfigurationState(java.lang.String contextId) throws ConfigurationException, RegistrationException
contextId
- the context identifierAccessControlException
- if the code does not have permission to invoke this operationRegistrationException
- if a configuration with the contextId is not registered.ConfigurationException
- if there was an error in fetching the configuration state informationjava.util.List<java.lang.String> getContextConfigurationIds() throws ConfigurationException
AccessControlException
- if the code does not have permission to invoke this operation.ConfigurationException
- if there was an error in fetching the list of registered configurations.java.util.List<java.lang.String> getContextConfigurationIds(java.lang.String profileId) throws ConfigurationException
profileId
- the profile under which the configurations are to be fetchedConfigurationPersistenceException
ConfigurationException
java.util.List<java.lang.String> getContextConfigurationIds(ConfigurationManagementService.CONFIG_STATE state) throws ConfigurationException
state
- the state of the context configurationAccessControlException
- if the code does not have permission to invoke this operation.ConfigurationRuntimeException
- if there was an error in fetching the list of configurations.ConfigurationException
java.util.List<java.lang.String> getContextConfigurationIds(ConfigurationManagementService.CONFIG_STATE state, java.lang.String profileId) throws ConfigurationException
state
- the state of the context configurationprofileId
- the profile under which the configurations are to be fetchedAccessControlException
- if the code does not have permission to invoke this operation.ConfigurationRuntimeException
- if there was an error in fetching the list of configurations.ConfigurationException
java.util.List<java.lang.String> getProfileIds() throws ConfigurationException
ConfigurationException
- if there was an error in registering the listenervoid addConfigListener(ConfigListener listener, ConfigEvent[] filter) throws ConfigurationException
listener
- the listener to be notified for configuration registrations and un-registrations, as well as state changesfilter
- the list of ConfigEvents that the listener is interested in. When specified as null, the listener would be notified for all Config Events.AccessControlException
- if the code does not have permission to invoke this operationConfigurationException
- if there was an error in registering the listenervoid removeConfigListener(ConfigListener listener) throws ConfigurationException
listener
- the listener to be removed from the notification serviceConfigurationException
- if there was an error in un-registering the listener or if the listener was not registered.void exportProfile(java.lang.String profileId, java.io.OutputStream stream) throws ConfigurationException, java.io.IOException, RegistrationException
profileId
- the id of the profile whose configuration has to be exportedstream
- theAccessControlException
- if the code does not have permission to invoke this operation.RegistrationException
- if a profile with the profileId is not registered.ConfigurationException
- if there was a problem in retrieving the configurationjava.io.IOException
- if there was a problem in writing to the streamvoid exportConfiguration(java.lang.String contextId, java.io.OutputStream stream) throws ConfigurationException, java.io.IOException, RegistrationException
contextId
- the contextId whose complete configuration and bootstrap configuration is desiredstream
- the outputstream to which the configuration needs to be written toAccessControlException
- if the code does not have permission to invoke this operation.RegistrationException
- if a context with the contextId is not registered.ConfigurationException
- if there was a problem in retrieving the configurationjava.io.IOException
- if there was a problem in writing to the streamvoid setContextName(java.lang.String contextId, ContextNameEncoder contextNameEncoder) throws ConfigurationException, RegistrationException
updateContextConfiguration
API) the updates would happen in the context of the name in such a way that when the name is unset, the corresponding updates are reverted/purged.contextId
- the context for which the name has to be setcontextNameEncoder
- Encoder instance that returns an encoded name to be set for the ContextConfiguration identified by the contexIdConfigurationException
- if there was a problem in setting the name, or the context associated with contextId is in ACTIVE state, or the contextId is already associated with another contexName, or the contextName is already in use.RegistrationException
- if the contextId is not registeredjava.lang.String unsetContextName(java.lang.String contextId) throws ConfigurationException
contextId
- the context whose name (if any) has to be unsetConfigurationException
- if there was a problem in un-setting the name, or the context associated with contextId is in ACTIVE stateRegistrationException
- if the contextId is not registeredjava.lang.String getContextName(java.lang.String contextId) throws ConfigurationException
contextId
- the context identifierConfigurationException
- if there was a problem in getting the nameRegistrationException
- if the contextId is not registeredjava.lang.String getContextId(ContextNameEncoder contextNameEncoder) throws ConfigurationException
contextNameEncoder
- Encoder instance that returns the encoded name of the context for which contextId is desired.ConfigurationException
- if there was a problem in getting the contextId