Package com.sun.identity.sm
Class ServiceConfigManager
- java.lang.Object
-
- com.sun.identity.sm.ServiceConfigManager
-
@Supported public class ServiceConfigManager extends Object
The classServiceConfigurationManager
provides interfaces to manage the service's configuration data. It provides access toServiceConfig
which represents a single "configuration" in the service. It manages configuration data only for GLOBAL and ORGANIZATION types.
-
-
Constructor Summary
Constructors Constructor Description ServiceConfigManager(SSOToken token, String serviceName, String version)
Creates an instance ofServiceConfigManager
for the given service and version.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addConfiguration(InputStream in)
Adds instances, global and organization configurationsString
addListener(ServiceListener listener)
Registers for changes to service's configuration.ServiceConfig
createGlobalConfig(Map<String,Set<String>> attrs)
Creates global configuration for the default instance of the service given the configuration attributes.ServiceConfig
createGlobalConfig(Map<String,Set<String>> attrs, org.forgerock.openam.services.datastore.DataStoreId dataStoreId)
Creates global configuration for the default instance of the service given the configuration attributes.ServiceConfig
createOrganizationConfig(String orgName, org.forgerock.openam.sm.ConfigurationAttributes attrs, org.forgerock.openam.services.datastore.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, org.forgerock.openam.services.datastore.DataStoreId dataStoreId)
Returns the global configuration for the given service instance.Set<String>
getGroupNames()
Returns the configuration group namesServiceInstance
getInstance(String instanceName)
Returns the service instance given the instance nameSet<String>
getInstanceNames()
Returns the service instance namesSet<String>
getInstanceNames(org.forgerock.openam.services.datastore.DataStoreId dataStoreId)
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, org.forgerock.openam.services.datastore.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 servicevoid
removeListener(String listenerID)
Removes the listener from the service for the given listener ID.void
removeOrganizationConfiguration(String orgName, String groupName)
Deprecated.void
removeOrganizationConfiguration(String orgName, String groupName, org.forgerock.openam.services.datastore.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.
-
-
-
Constructor Detail
-
ServiceConfigManager
@Supported public ServiceConfigManager(SSOToken token, String serviceName, String version) throws SMSException, SSOException
Creates an instance ofServiceConfigManager
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.- Parameters:
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 service- Throws:
SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expired
-
-
Method Detail
-
getName
@Supported public String getName()
Returns the name of the service.- Returns:
- the name of the service
-
getVersion
@Supported public String getVersion()
Returns the service version.- Returns:
- the version of the service
-
getInstanceNames
@Supported public Set<String> getInstanceNames() throws SMSException
Returns the service instance names- Returns:
- the service instance names
- Throws:
SMSException
- if an error has occurred while performing the operation
-
getInstanceNames
@Supported public Set<String> getInstanceNames(org.forgerock.openam.services.datastore.DataStoreId dataStoreId) throws SMSException
- Throws:
SMSException
-
getGroupNames
@Supported public Set<String> getGroupNames() throws SMSException
Returns the configuration group names- Returns:
- the service configuration group names
- Throws:
SMSException
- if an error has occurred while performing the operation
-
getInstance
@Supported public ServiceInstance getInstance(String instanceName) throws SMSException, SSOException
Returns the service instance given the instance name- Parameters:
instanceName
- the name of the service instance- Returns:
- service instance for the given instance name
- Throws:
SMSException
- if an error has occurred while performing the operationSSOException
- If the token associated with this ServiceConfigManager was invalid.
-
removeInstance
@Supported public void removeInstance(String instanceName) throws SMSException, SSOException
Removes the instance form the service- Parameters:
instanceName
- the service instance name- Throws:
SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expired
-
getGlobalConfig
@Supported public ServiceConfig getGlobalConfig(String instanceName) throws SMSException, SSOException
Returns the global configuration for the given service instance.- Parameters:
instanceName
- the service instance name- Returns:
- the global configuration for the given service instance
- Throws:
SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expired
-
getGlobalConfig
@Supported public ServiceConfig getGlobalConfig(String instanceName, org.forgerock.openam.services.datastore.DataStoreId dataStoreId) throws SMSException, SSOException
Returns the global configuration for the given service instance.- Parameters:
instanceName
- the service instance namedataStoreId
- id of the data store where the service config is kept.- Returns:
- the global configuration for the given service instance
- Throws:
SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expired
-
getOrganizationConfig
@Supported public ServiceConfig getOrganizationConfig(String orgName, String instanceName, org.forgerock.openam.services.datastore.DataStoreId dataStoreId) throws SMSException, SSOException
Returns the organization configuration for the given organization and instance name.- Parameters:
orgName
- the name of the organizationinstanceName
- the service configuration instance namedataStoreId
- the data store in which the configuration resides.- Returns:
- the organization configuration for the given organization
- Throws:
SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expired
-
getOrganizationConfig
@Supported public ServiceConfig getOrganizationConfig(String orgName, String instanceName) throws SMSException, SSOException
Returns the organization configuration for the given organization and instance name.- Parameters:
orgName
- the name of the organizationinstanceName
- the service configuration instance name- Returns:
- the organization configuration for the given organization
- Throws:
SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expired
-
createGlobalConfig
@Supported public ServiceConfig createGlobalConfig(Map<String,Set<String>> attrs) throws SMSException, SSOException
Creates global configuration for the default instance of the service given the configuration attributes.- Parameters:
attrs
- map of attribute values.- Throws:
SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expired
-
createGlobalConfig
@Supported public ServiceConfig createGlobalConfig(Map<String,Set<String>> attrs, org.forgerock.openam.services.datastore.DataStoreId dataStoreId) throws SMSException, SSOException
Creates global configuration for the default instance of the service given the configuration attributes.- Parameters:
attrs
- map of attribute values.dataStoreId
- The datastore to create in.- Throws:
SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expired
-
createOrganizationConfig
@Supported public ServiceConfig createOrganizationConfig(String orgName, org.forgerock.openam.sm.ConfigurationAttributes attrs, org.forgerock.openam.services.datastore.DataStoreId dataStoreId) throws SMSException, SSOException
Creates organization configuration for the default instance of the service given configuration attributes.- Parameters:
orgName
- name of organization.attrs
- map of attribute values.- Throws:
SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expired
-
addConfiguration
@Supported public void addConfiguration(InputStream in) throws SMSException, SSOException
Adds instances, global and organization configurations- Parameters:
in
- input stream of configuration data.- Throws:
SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expired
-
removeGlobalConfiguration
@Supported public void removeGlobalConfiguration(String groupName) throws SMSException, SSOException
Deletes the global configuration data for the given group name. If group name isnull
, it used the default group name.- Parameters:
groupName
- name of group.- Throws:
SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expired
-
deleteOrganizationConfig
@Supported public void deleteOrganizationConfig(String orgName) throws SMSException, SSOException
Deletes the organization configuration data for the given organization. It removes all the groups within the organization.- Parameters:
orgName
- name of organization.- Throws:
SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expired
-
removeOrganizationConfiguration
@Supported public void removeOrganizationConfiguration(String orgName, String groupName, org.forgerock.openam.services.datastore.DataStoreId dataStoreId) throws SMSException, SSOException
Deletes the organization's group configuration data.- Parameters:
orgName
- name of organization.groupName
- name of group.dataStoreId
- id of the data store where the config is kept.- Throws:
SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expired
-
removeOrganizationConfiguration
@Supported @Deprecated public void removeOrganizationConfiguration(String orgName, String groupName) throws SMSException, SSOException
Deprecated.Deletes the organization's group configuration data.- Parameters:
orgName
- name of organization.groupName
- name of group.- Throws:
SMSException
- if an error has occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expired
-
addListener
@Supported public String addListener(ServiceListener listener)
Registers for changes to service's configuration. The object will be called when configuration for this service and version is changed.- Parameters:
listener
- callback object that will be invoked when schema changes.- Returns:
- an ID of the registered listener.
-
removeListener
@Supported public void removeListener(String listenerID)
Removes the listener from the service for the given listener ID. The ID was issued when the listener was registered.- Parameters:
listenerID
- the listener ID issued when the listener was registered
-
equals
@Supported public boolean equals(Object o)
Compares this object with the given object.
-
toString
@Supported public String toString()
Returns String representation of the service's configuration data, along with instances and groups.
-
-