public class ServiceConfigManager extends Object
ServiceConfigurationManager
provides interfaces to manage the service's configuration data.
It provides access to ServiceConfig
which represents a single "configuration" in the service.
It manages configuration data only for GLOBAL and ORGANIZATION types.Constructor and Description |
---|
ServiceConfigManager(SSOToken token,
String serviceName,
String version)
Creates an instance of
ServiceConfigManager for the given service and version. |
Modifier and Type | Method and Description |
---|---|
void |
addConfiguration(InputStream in)
Adds instances, global and organization configurations
|
String |
addListener(ServiceListener listener)
Registers for changes to service's configuration.
|
ServiceConfig |
createGlobalConfig(Map attrs)
Creates global configuration for the default instance of the service given the configuration attributes.
|
ServiceConfig |
createOrganizationConfig(String orgName,
Map attrs,
DataStoreId dataStoreId)
Creates organization configuration for the default instance of the service given configuration attributes.
|
void |
deleteOrganizationConfig(String orgName)
Deletes the organization configuration data for the given organization.
|
boolean |
equals(Object o)
Compares this object with the given object.
|
ServiceConfig |
getGlobalConfig(String instanceName)
Returns the global configuration for the given service instance.
|
ServiceConfig |
getGlobalConfig(String instanceName,
DataStoreId dataStoreId)
Returns the global configuration for the given service instance.
|
Set |
getGroupNames()
Returns the configuration group names
|
ServiceInstance |
getInstance(String instanceName)
Returns the service instance given the instance name
|
Set |
getInstanceNames()
Returns the service instance names
|
String |
getName()
Returns the name of the service.
|
ServiceConfig |
getOrganizationConfig(String orgName,
String instanceName)
Returns the organization configuration for the given organization and instance name.
|
ServiceConfig |
getOrganizationConfig(String orgName,
String instanceName,
DataStoreId dataStoreId)
Returns the organization configuration for the given organization and instance name.
|
String |
getVersion()
Returns the service version.
|
void |
removeGlobalConfiguration(String groupName)
Deletes the global configuration data for the given group name.
|
void |
removeInstance(String instanceName)
Removes the instance form the service
|
void |
removeListener(String listenerID)
Removes the listener from the service for the given listener ID.
|
void |
removeOrganizationConfiguration(String orgName,
String groupName)
Deprecated.
since 6.5.5, use the
removeOrganizationConfiguration method |
void |
removeOrganizationConfiguration(String orgName,
String groupName,
DataStoreId dataStoreId)
Deletes the organization's group configuration data.
|
String |
toString()
Returns String representation of the service's configuration data, along with instances and groups.
|
public ServiceConfigManager(SSOToken token, String serviceName, String version) throws SMSException, SSOException
ServiceConfigManager
for the given service and version. It requires an user
identity, that will used to perform operations with. It is assumed that the application calling this constructor
should authenticate the user.token
- single sign on token of the user identity on whose behalf the operations are performed.serviceName
- the name of the serviceversion
- the version of the serviceSMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expiredpublic String getName()
public String getVersion()
public Set getInstanceNames() throws SMSException
SMSException
- if an error has occurred while performing the operationpublic Set getGroupNames() throws SMSException
SMSException
- if an error has occurred while performing the operationpublic ServiceInstance getInstance(String instanceName) throws SMSException, SSOException
instanceName
- the name of the service instanceSMSException
- if an error has occurred while performing the operationSSOException
- If the token associated with this ServiceConfigManager was invalid.public void removeInstance(String instanceName) throws SMSException, SSOException
instanceName
- the service instance nameSMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expiredpublic ServiceConfig getGlobalConfig(String instanceName) throws SMSException, SSOException
instanceName
- the service instance nameSMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expiredpublic ServiceConfig getGlobalConfig(String instanceName, DataStoreId dataStoreId) throws SMSException, SSOException
instanceName
- the service instance namedataStoreId
- id of the data store where the service config is kept.SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expiredpublic ServiceConfig getOrganizationConfig(String orgName, String instanceName, DataStoreId dataStoreId) throws SMSException, SSOException
orgName
- the name of the organizationinstanceName
- the service configuration instance namedataStoreId
- the data store in which the configuration resides.SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expiredpublic ServiceConfig getOrganizationConfig(String orgName, String instanceName) throws SMSException, SSOException
orgName
- the name of the organizationinstanceName
- the service configuration instance nameSMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expiredpublic ServiceConfig createGlobalConfig(Map attrs) throws SMSException, SSOException
attrs
- map of attribute values.SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expiredpublic ServiceConfig createOrganizationConfig(String orgName, Map attrs, DataStoreId dataStoreId) throws SMSException, SSOException
orgName
- name of organization.attrs
- map of attribute values.SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expiredpublic void addConfiguration(InputStream in) throws SMSException, SSOException
in
- input stream of configuration data.SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expiredpublic void removeGlobalConfiguration(String groupName) throws SMSException, SSOException
null
, it used the
default group name.groupName
- name of group.SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expiredpublic void deleteOrganizationConfig(String orgName) throws SMSException, SSOException
orgName
- name of organization.SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expiredpublic void removeOrganizationConfiguration(String orgName, String groupName, DataStoreId dataStoreId) throws SMSException, SSOException
orgName
- name of organization.groupName
- name of group.dataStoreId
- id of the data store where the config is kept.SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expired@Deprecated public void removeOrganizationConfiguration(String orgName, String groupName) throws SMSException, SSOException
removeOrganizationConfiguration
methodorgName
- name of organization.groupName
- name of group.SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expiredpublic String addListener(ServiceListener listener)
listener
- callback object that will be invoked when schema changes.public void removeListener(String listenerID)
listenerID
- the listener ID issued when the listener was registeredpublic boolean equals(Object o)
Copyright © 2010-2018, ForgeRock All Rights Reserved.