public class ServiceManager extends Object
ServiceManager
class provides methods to register/remove
services and to list currently registered services. It also provides methods
to obtain an instance of ServiceSchemaManager
and an instance
of ServiceConfigManager
.Modifier and Type | Field and Description |
---|---|
protected static Set |
accessManagerServers |
protected static String |
ATTR_SERVER_LIST |
protected static String |
COEXISTENCE_ATTR_NAME |
protected static String |
DEFAULT_SERVICES_FOR_REALMS |
protected static Set |
defaultServicesToLoad |
static String |
PLATFORM_SERVICE |
protected static String |
REALM_ATTR_NAME |
protected static String |
REALM_ENTRY |
static String |
REALM_SERVICE |
protected static Set |
requiredServices |
protected static String |
SERVICE_VERSION |
protected static String |
serviceDN |
protected static HashMap |
serviceNameDefaultVersion |
protected static CachedSubEntries |
serviceNames |
protected static HashMap |
serviceVersions |
protected static SMSEntry |
smsEntry |
Constructor and Description |
---|
ServiceManager(SSOToken token)
Creates an instance of
ServiceManager . |
Modifier and Type | Method and Description |
---|---|
void |
addPluginSchema(Document pluginDoc)
Adds a new plugin schema to an existing service
|
protected static void |
checkAndEncryptPasswordSyntax(Document doc,
boolean encrypt) |
protected static void |
checkAndEncryptPasswordSyntax(Document doc,
boolean encrypt,
AMEncryption encryptObj) |
void |
clearCache()
Removes all the SMS cached entries.
|
void |
deleteService(String serviceName)
Deletes only the schema for the given service name.
|
static Set |
getAMServerInstances()
Returns all AM Server instance.
|
static String |
getBaseDN()
Returns the base DN (or root DN) that was set in
serverconfig.xml at install time. |
protected static String |
getCacheIndex(String serviceName,
String version) |
ServiceConfigManager |
getConfigManager(String serviceName,
String version)
Returns the
ServiceConfigManager for
the given service name and version. |
OrganizationConfigManager |
getOrganizationConfigManager(String orgName)
Returns the
OrganizationConfigManager for the given
organization name. |
ServiceSchemaManager |
getSchemaManager(String serviceName,
String version)
Returns the
ServiceSchemaManager for
the given service name and version. |
static String |
getServiceDN()
Returns the DN beneath the
getBaseDN() in which service data is stored. |
protected static String |
getServiceNameDN(String serviceName) |
protected static String |
getServiceNameDN(String serviceName,
String version) |
Set<String> |
getServiceNames()
Returns all the service names that have been
registered.
|
Map |
getServiceNamesAndOCs(String schemaType)
Returns a map of service names and the related object classes for the
given
schemaType . |
Set |
getServiceVersions(String serviceName)
Returns all versions supported by the service.
|
protected static String |
getVersion(String serviceName)
Returns the version for a service.
|
protected static Set |
getVersions(SSOToken token,
String serviceName) |
static boolean |
isAMSDKConfigured()
Returns
true if AMSDK IdRepo plugin is
configured in any of the realms |
static boolean |
isAMSDKEnabled()
Returns
true if AMSDK IdRepo plugin is enabled/present
in IdRepo Service Configuration schema |
static boolean |
isCoexistenceMode()
Returns the flag which lets IdRepo and SM know that we are running in the
co-existence mode.
|
static boolean |
isConfigMigratedTo70()
Returns
true if configuration data has been migrated to
Access Manager 7.0. |
static boolean |
isRealmEnabled()
Returns
true if current service
configuration uses the realm model to store the configuration data. |
Document |
parseServicesFile(InputStream xmlServiceSchema) |
Document |
parseServicesFile(InputStream xmlServiceSchema,
AMEncryption decryptObj) |
Set |
registerServices(InputStream xmlServiceSchema)
Registers one or more services, defined by the XML
input stream that follows the SMS DTD.
|
Set |
registerServices(InputStream xmlServiceSchema,
AMEncryption decryptObj)
Registers one or more services, defined by the XML
input stream that follows the SMS DTD.
|
void |
removePluginSchema(String serviceName,
String interfaceName,
String pluginName)
Removes a plugin schema from a service
|
void |
removeService(String serviceName,
String version)
Removes the service schema and configuration for
the given service name.
|
protected static void |
schemaChanged() |
Set |
searchOrganizationNames(String serviceName,
String attrName,
Set values)
Returns organization names that match the given attribute name and
values.
|
protected static String |
serviceDefaultVersion(SSOToken token,
String serviceName) |
static Set |
servicesAssignedByDefault()
Returns service names that will be assigned to a realm during creation.
|
String |
toXML(AMEncryption encryptObj) |
protected static boolean |
validateServiceSchema(Node serviceNode) |
protected static final String serviceDN
protected static final String COEXISTENCE_ATTR_NAME
protected static HashMap serviceNameDefaultVersion
protected static final String REALM_ATTR_NAME
public static final String REALM_SERVICE
protected static final String DEFAULT_SERVICES_FOR_REALMS
protected static final String SERVICE_VERSION
protected static final String REALM_ENTRY
public static final String PLATFORM_SERVICE
protected static final String ATTR_SERVER_LIST
protected static Set requiredServices
protected static Set defaultServicesToLoad
protected static SMSEntry smsEntry
protected static CachedSubEntries serviceNames
protected static HashMap serviceVersions
protected static Set accessManagerServers
public ServiceManager(SSOToken token) throws SSOException, SMSException
ServiceManager
.
The SSOToken
is used to identify the user performing
service operations.token
- the authenticated single sign on token.SSOException
- if the user's single sign on token is invalid or expiredSMSException
- if an error occurred while performing the operationpublic ServiceSchemaManager getSchemaManager(String serviceName, String version) throws SMSException, SSOException
ServiceSchemaManager
for
the given service name and version.serviceName
- the name of the serviceversion
- the version of the serviceServiceSchemaManager
for the given service
name and versionSSOException
- if the user's single sign on token is invalid or expiredSMSException
- if an error occurred while performing the operationpublic ServiceConfigManager getConfigManager(String serviceName, String version) throws SMSException, SSOException
ServiceConfigManager
for
the given service name and version.serviceName
- the name of the serviceversion
- the version of the serviceServiceConfigManager
for the given service
name and version.SSOException
- if the user's single sign on token is invalid or expiredSMSException
- if an error occurred while performing the operationpublic OrganizationConfigManager getOrganizationConfigManager(String orgName) throws SMSException, SSOException
OrganizationConfigManager
for the given
organization name. If the orgName
either
null
or empty or "/", the organization configuration for the root organization
will be returned.orgName
- the name of the organizationOrganizationConfigManager
for the given
organization nameSSOException
- if the user's single sign on token is invalid or expiredSMSException
- if an error occurred while performing the operationpublic Set<String> getServiceNames() throws SMSException
SMSException
- if an error occurred while performing the operationpublic Map getServiceNamesAndOCs(String schemaType)
schemaType
.schemaType
- name of the schemapublic Set getServiceVersions(String serviceName) throws SMSException
serviceName
- service name.SMSException
- if an error occurred while performing the operationpublic Set registerServices(InputStream xmlServiceSchema) throws SMSException, SSOException
xmlServiceSchema
- the input stream of service metadata in XML conforming to SMS
DTD.SMSException
- if an error occurred while performing the operation.SSOException
- if the user's single sign on token is invalid or
expired.public Set registerServices(InputStream xmlServiceSchema, AMEncryption decryptObj) throws SMSException, SSOException
xmlServiceSchema
- the input stream of service metadata in XML conforming to SMS
DTD.decryptObj
- Object to decrypt the password in the XML.SMSException
- if an error occurred while performing the operationSSOException
- if the user's single sign on token is invalid or
expired.public Document parseServicesFile(InputStream xmlServiceSchema) throws SMSException, SSOException
SMSException
SSOException
public Document parseServicesFile(InputStream xmlServiceSchema, AMEncryption decryptObj) throws SMSException, SSOException
SMSException
SSOException
public void addPluginSchema(Document pluginDoc) throws SMSException, SSOException
pluginDoc
- SMSException
- if an error occurred while performing the operationSSOException
- if the user's single sign on token is invalid or
expired.public void removePluginSchema(String serviceName, String interfaceName, String pluginName) throws SMSException, SSOException
serviceName
- The name of the serviceinterfaceName
- The name of the plugin interfacepluginName
- The name of the plugin schemaSMSException
- if an error occurred while performing the operationSSOException
- if the user's single sign on token is invalid or
expired.public void removeService(String serviceName, String version) throws SMSException, SSOException
serviceName
- the name of the serviceversion
- the version of the serviceSMSException
- if an error occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expiredpublic void deleteService(String serviceName) throws SMSException, SSOException
ServiceSchemaManager.replaceSchema()
.serviceName
- Name of service to be deleted.SMSException
- if an error occurred while performing the operationSSOException
- if the user's single sign on token is invalid or expiredpublic static String getBaseDN()
serverconfig.xml
at install time.public static String getServiceDN()
getBaseDN()
in which service data is stored.public static Set getAMServerInstances()
iplanet-am-platform-server-list
public Set searchOrganizationNames(String serviceName, String attrName, Set values) throws SMSException, SSOException
serviceName
- service name under which the attribute is to be sought.attrName
- name of the attribute to search.values
- set of attribute values to search.SMSException
- if an error occurred while performing the operation.SSOException
- if the user's single sign on token is invalid or expired.public void clearCache()
public static boolean isCoexistenceMode()
protected static String getVersion(String serviceName)
serviceName
- Name of the service.public static boolean isRealmEnabled()
true
if current service
configuration uses the realm model to store the configuration data.true
is realm model is used for storing
configuration data; false
otherwise.public static boolean isAMSDKConfigured() throws SMSException
true
if AMSDK IdRepo plugin is
configured in any of the realmsSMSException
public static boolean isConfigMigratedTo70()
true
if configuration data has been migrated to
Access Manager 7.0. Else false
otherwise.true
if configuration data has been migrated to AM
7.0; false
otherwiseprotected static Set getVersions(SSOToken token, String serviceName) throws SMSException, SSOException
SMSException
SSOException
protected static void checkAndEncryptPasswordSyntax(Document doc, boolean encrypt) throws SMSException
SMSException
protected static void checkAndEncryptPasswordSyntax(Document doc, boolean encrypt, AMEncryption encryptObj) throws SMSException
SMSException
protected static boolean validateServiceSchema(Node serviceNode) throws SMSException
SMSException
protected static void schemaChanged()
protected static String serviceDefaultVersion(SSOToken token, String serviceName) throws SMSException, SSOException
SMSException
SSOException
public static Set servicesAssignedByDefault()
public String toXML(AMEncryption encryptObj) throws SMSException, SSOException
SMSException
SSOException
public static boolean isAMSDKEnabled()
true
if AMSDK IdRepo plugin is enabled/present
in IdRepo Service Configuration schemaCopyright © 2010–2025 Open Identity Platform Community. All rights reserved.