Package com.sun.identity.sm
Class ServiceConfigManager
- java.lang.Object
-
- com.sun.identity.sm.ServiceConfigManager
-
public class ServiceConfigManager extends Object
The classServiceConfigurationManagerprovides interfaces to manage the service's configuration data. It provides access toServiceConfigwhich 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 ofServiceConfigManagerfor the given service and version.ServiceConfigManager(String serviceName, SSOToken token)Constrctor to obtain an instanceServiceConfigManagerfor a service by providing an authenticated identity of the user.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConfiguration(InputStream in)Adds instances, global and organization configurationsStringaddListener(ServiceListener listener)Registers for changes to service's configuration.ServiceConfigcreateGlobalConfig(Map attrs)Creates global configuration for the default instance of the service given the configuration attributes.ServiceConfigcreateOrganizationConfig(String orgName, Map attrs)Creates organization configuration for the default instance of the service given configuration attributes.voiddeleteOrganizationConfig(String orgName)Deletes the organization configuration data for the given organization.booleanequals(Object o)Compares this object with the given object.ServiceConfiggetGlobalConfig(String instanceName)Returns the global configuration for the given service instance.SetgetGroupNames()Returns the configuration group namesServiceInstancegetInstance(String instanceName)Returns the service instance given the instance nameSetgetInstanceNames()Returns the service instance namesStringgetName()Returns the name of the service.ServiceConfiggetOrganizationConfig(String orgName, String instanceName)Returns the organization configuration for the given organization and instance name.PluginConfiggetPluginConfig(String name, String pluginSchemaName, String interfaceName, String orgName)Returns the plugin configuration parameters for the serviceSetgetPluginConfigNames(String pluginSchemaName, String interfaceName, String orgName)Returns a set of plugins configured for the given plugin interface and plugin schema in a organizationStringgetVersion()Returns the service version.inthashCode()voidremoveGlobalConfiguration(String groupName)Deletes the global configuration data for the given group name.voidremoveInstance(String instanceName)Removes the instance form the servicevoidremoveListener(String listenerID)Removes the listener from the service for the given listener ID.voidremoveOrganizationConfiguration(String orgName, String groupName)Deletes the organization's group configuration data.voidremoveOrganizationConfiguration(String orgName, String groupName, boolean checkLegacyMode)Deletes the organization's group configuration data.voidremovePluginConfig(String name, String pluginSchemaName, String interfaceName, String orgName)Removes the plugin configuration for the serviceStringtoString()Returns String representation of the service's configuration data, along with instances and groups.StringtoXML(AMEncryption encryptObj)
-
-
-
Constructor Detail
-
ServiceConfigManager
public ServiceConfigManager(String serviceName, SSOToken token) throws SMSException, SSOException
Constrctor to obtain an instanceServiceConfigManagerfor a service by providing an authenticated identity of the user. This constructor assumes the server version to be1.0.- Parameters:
serviceName- name of the servicetoken- single sign on token of authenticated user identity- Throws:
SMSException- if an error has occurred while performing the operationSSOException- if the user's single sign on token is invalid or expired
-
ServiceConfigManager
public ServiceConfigManager(SSOToken token, String serviceName, String version) throws SMSException, SSOException
Creates an instance ofServiceConfigManagerfor 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
public String getName()
Returns the name of the service.- Returns:
- the name of the service
-
getVersion
public String getVersion()
Returns the service version.- Returns:
- the version of the service
-
getInstanceNames
public Set getInstanceNames() throws SMSException
Returns the service instance names- Returns:
- the service instance names
- Throws:
SMSException- if an error has occurred while performing the operation
-
getGroupNames
public Set 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
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 user's single sign on token is invalid or expired
-
removeInstance
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
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
-
getOrganizationConfig
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
public ServiceConfig createGlobalConfig(Map 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
-
createOrganizationConfig
public ServiceConfig createOrganizationConfig(String orgName, Map attrs) 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
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
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
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
public void removeOrganizationConfiguration(String orgName, String groupName) throws SMSException, SSOException
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
-
removeOrganizationConfiguration
public void removeOrganizationConfiguration(String orgName, String groupName, boolean checkLegacyMode) throws SMSException, SSOException
Deletes the organization's group configuration data.- Parameters:
orgName- name of organization.groupName- name of group.checkLegacyMode- boolean to check if legacy or realm passed by amsdk as false.- Throws:
SMSException- if an error has occurred while performing the operationSSOException- if the user's single sign on token is invalid or expired
-
getPluginConfigNames
public Set getPluginConfigNames(String pluginSchemaName, String interfaceName, String orgName) throws SMSException, SSOException
Returns a set of plugins configured for the given plugin interface and plugin schema in a organization- Throws:
SMSExceptionSSOException
-
getPluginConfig
public PluginConfig getPluginConfig(String name, String pluginSchemaName, String interfaceName, String orgName) throws SMSException, SSOException
Returns the plugin configuration parameters for the service- Throws:
SMSExceptionSSOException
-
removePluginConfig
public void removePluginConfig(String name, String pluginSchemaName, String interfaceName, String orgName) throws SMSException, SSOException
Removes the plugin configuration for the service- Throws:
SMSExceptionSSOException
-
addListener
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
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
public boolean equals(Object o)
Compares this object with the given object.
-
toString
public String toString()
Returns String representation of the service's configuration data, along with instances and groups.
-
toXML
public String toXML(AMEncryption encryptObj) throws SMSException, SSOException
- Throws:
SMSExceptionSSOException
-
-