public class TemplateManager extends Object implements Serializable
Example:
TemplateManager mgr = TemplateManager.getTemplateManager(); Guid guid = new Guid("o=vortex.com"); CreationTemplate t1 = mgr.getCreationTemplate("BasicUser", guid, TemplateManager.SCOPE_ANCESTORS); CreationTemplate t2 = mgr.getCreationTemplate(User.class, guid, TemplateManager.SCOPE_ANCESTORS); SearchTemplate t3 = mgr.getSearchTemplate("BasicUserSearch", guid, TemplateManager.SCOPE_ANCESTORS);
Template
,
CreationTemplate
,
SearchTemplate
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
SCOPE_ANCESTORS
Search scope for determining how to get the configuration data.
|
static int |
SCOPE_ORG
Search scope for determining how to get the configuration data.
|
static int |
SCOPE_TOP
Search scope for determining how to get the configuration data.
|
Modifier | Constructor and Description |
---|---|
protected |
TemplateManager()
Default constructor that registers a default class resolver and accesses
template configuration information.
|
Modifier and Type | Method and Description |
---|---|
void |
addClassResolver(IClassResolver resolver)
Registers a class that can resolve a set of attributes to a Java class.
|
CreationTemplate |
getCreationTemplate(Class cls,
Guid orgGuid)
Given a class, gets the default creation template for the object.
|
CreationTemplate |
getCreationTemplate(Class cls,
Guid orgGuid,
int scope)
Returns default creation template of a given class.
|
CreationTemplate |
getCreationTemplate(String name,
Guid orgGuid)
Returns a template from a supplied template name.
|
CreationTemplate |
getCreationTemplate(String name,
Guid orgGuid,
int scope)
Returns a template from a supplied template name.
|
Set |
getCreationTemplateNames(Guid orgGuid)
Returns a set of known creation templates.
|
SearchTemplate |
getSearchTemplate(String name,
Guid orgGuid)
Returns a template from a supplied template name.
|
SearchTemplate |
getSearchTemplate(String name,
Guid orgGuid,
int scope)
Returns a template from a supplied template name.
|
Set |
getSearchTemplateNames(Guid orgGuid)
Returns a set of known search templates.
|
static TemplateManager |
getTemplateManager()
Clients can only obtain a reference through this method.
|
void |
removeClassResolver(IClassResolver resolver)
Unregisters a class that can resolve a set of attributes to a Java class.
|
void |
replaceCreationTemplate(CreationTemplate template,
Guid orgGuid)
Replaces an existing CreationTemplate with the one specified.
|
public static final int SCOPE_ORG
public static final int SCOPE_ANCESTORS
public static final int SCOPE_TOP
protected TemplateManager() throws UMSException
UMSException
- if an exception occurs registering the resolver or accessing
configuration data.public static TemplateManager getTemplateManager() throws UMSException
UMSException
- if an exception occurs while getting an instance of a
template manager.public void addClassResolver(IClassResolver resolver)
resolver
- a class that can produce a Java class instance from an ID and
a set of attributespublic void removeClassResolver(IClassResolver resolver)
resolver
- A class that can produce a Java class instance from an ID and
a set of attributespublic CreationTemplate getCreationTemplate(Class cls, Guid orgGuid) throws UMSException
cls
- Class (instance of) to be queried for the template.orgGuid
- GUID of the Organization where the config data is stored.null
if the
class is not known or no template is registered for the class.UMSException
- if an exception occurs while getting the creation
template.public CreationTemplate getCreationTemplate(Class cls, Guid orgGuid, int scope) throws UMSException
cls
- Class (instance of) to be queried for the template.orgGuid
- GUID of the Organization where the config data is stored.scope
- Search scope for determining how to get the configuration
datanull
if the
class is not known or no template is registered for the classUMSException
- if error occurs while getting the creation template.public CreationTemplate getCreationTemplate(String name, Guid orgGuid) throws UMSException
name
- Name of template.orgGuid
- GUID of the Organization where the config data is stored.null
if there is no matching templateUMSException
- if error occurs while getting the creation template.public CreationTemplate getCreationTemplate(String name, Guid orgGuid, int scope) throws UMSException
name
- Name of template.orgGuid
- GUID of the Organization where the config data is stored.scope
- Search scope for determining how to get the configuration
data.null
if there is no matching templateUMSException
- if an exception occurs while getting the creation
template.public SearchTemplate getSearchTemplate(String name, Guid orgGuid) throws UMSException
name
- Name of template.orgGuid
- GUID of the Organization where the config data is storednull
if there is no matching templateUMSException
- if error occurs while getting the search template.public SearchTemplate getSearchTemplate(String name, Guid orgGuid, int scope) throws UMSException
name
- Name of Template.orgGuid
- GUID of the Organization where the config data is stored.scope
- Search scope for determining how to get the configuration
data.null
if there is no matching template.UMSException
- if an exception occurs while getting the search
template.public Set getCreationTemplateNames(Guid orgGuid) throws UMSException
orgGuid
- GUID of the Organization where the config data is stored.UMSException
- if an exception occurs.public Set getSearchTemplateNames(Guid orgGuid) throws UMSException
orgGuid
- GUID of the Organization where the config data is stored.UMSException
- if an exception occurs.public void replaceCreationTemplate(CreationTemplate template, Guid orgGuid) throws UMSException
template
- CreationTemplate to be modifiedorgGuid
- the guid of the Organization where the config data is storedUMSException
- if an exception occursCopyright © 2010–2025 Open Identity Platform Community. All rights reserved.