Package org.forgerock.am.trees.api
Interface NodeFactory
public interface NodeFactory
A factory for creating
Node
instances and related configurations.-
Method Summary
Modifier and TypeMethodDescriptioncreateDynamicNode
(String type, Integer version, Map<String, Object> config, Realm realm, Tree tree, boolean configRequired) Constructs aNode
instance dynamically using the given type and configuration.createDynamicNode
(String type, Integer version, Map<String, Object> config, Realm realm, Tree tree, boolean configRequired, UUID uuid) Constructs aNode
instance dynamically using the given type and configuration.Constructs aNode
instance that matches the given type and node ID.getNodeOutcomes
(PreferredLocales preferredLocales, Realm realm, String nodeId, String nodeType, Integer version) Get the node outcomes for a given node.getOutcomeProvider
(Realm realm, String type, Integer version) Gets the outcome provider associated with a given node type.
-
Method Details
-
createNode
Node createNode(String type, Integer version, UUID id, Realm realm, Tree tree) throws NodeProcessException Constructs aNode
instance that matches the given type and node ID.- Parameters:
type
- node typeversion
- node versionid
- node UUIDrealm
- realm where the tree belongs totree
- tree where the node belongs to- Returns:
- an instance of a concrete
Node
. - Throws:
NodeProcessException
- If the node can't be created for some SMS reason.
-
createDynamicNode
Node createDynamicNode(String type, Integer version, Map<String, Object> config, Realm realm, Tree tree, boolean configRequired, UUID uuid) throws NodeProcessExceptionConstructs aNode
instance dynamically using the given type and configuration.- Parameters:
type
- node typeversion
- node versionconfig
- the node configuration, must be non-null.realm
- realm where the tree belongs to.tree
- tree where the node belongs toconfigRequired
- true if configuration is required, else false.uuid
- The UUID to use for creation of the new node.- Returns:
- an instance of a dynamically generated
Node
. - Throws:
NodeProcessException
- If the node can't be created for some SMS reason.
-
createDynamicNode
Node createDynamicNode(String type, Integer version, Map<String, Object> config, Realm realm, Tree tree, boolean configRequired) throws NodeProcessExceptionConstructs aNode
instance dynamically using the given type and configuration. Generates a new uuid for the new node.- Parameters:
type
- node typeversion
- node versionconfig
- the node configuration, must be non-null.realm
- realm where the tree belongs to.tree
- tree where the node belongs toconfigRequired
- true if configuration is required, else false.- Returns:
- an instance of a dynamically generated
Node
. - Throws:
NodeProcessException
- If the node can't be created for some SMS reason.
-
getOutcomeProvider
OutcomeProvider getOutcomeProvider(Realm realm, String type, Integer version) throws NodeProcessException Gets the outcome provider associated with a given node type.- Parameters:
realm
- the realm the node is intype
- node typeversion
- node version- Returns:
- an instance of a concrete
OutcomeProvider
. - Throws:
NodeProcessException
- if the outcome provider cannot be obtained.
-
getNodeOutcomes
List<OutcomeProvider.Outcome> getNodeOutcomes(PreferredLocales preferredLocales, Realm realm, String nodeId, String nodeType, Integer version) throws NodeProcessException, SSOException, SMSException Get the node outcomes for a given node.- Parameters:
preferredLocales
- The locales to get the outcome names in.realm
- The realm.nodeId
- The ID of the node.nodeType
- The type of the node.version
- The version of the node.- Returns:
- The list of outcomes for the configured node.
- Throws:
NodeProcessException
- In the event of a failure in the outcome provider.SSOException
- If the config for the node cannot be loaded.SMSException
- If the config for the node cannot be loaded.
-