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 and Type | Method and Description |
---|---|
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.
|
public static final int SCOPE_ORG
public static final int SCOPE_ANCESTORS
public static final int SCOPE_TOP
public static TemplateManager getTemplateManager() throws UMSException
UMSException
- if an exception occurs while getting an instance of a
template manager.public 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.Copyright © 2010-2020, ForgeRock All Rights Reserved.