Package org.forgerock.am.trees.api
Interface NodeRegistry
public interface NodeRegistry
A registry of installed node services.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The default version of a node service. -
Method Summary
Modifier and TypeMethodDescriptioncreateNodeConfigInstance
(String serviceName, Integer version, Realm realm, Map<String, Object> config) Construct a non-persisted instance of the given service interface.Class<?>
getConfigType
(String serviceName, Integer version) Get the config class from the name of the service.getNodeServiceName
(Class<? extends Node> nodeClass) Get the name of the service from the node class.getNodeType
(String serviceName, Integer version) Get the node class from the name of the service.Returns the set of service names for all the available node types.getNodeVersion
(Class<? extends Node> nodeClass) Get the version of the node.boolean
isNodeService
(String serviceName) Whether the SMS service name matches any node services.boolean
isNodeService
(String serviceName, Integer version) Whether the SMS service name is a node service.void
registerNode
(Class<?> nodeClass, Config nodeConfig, Class<?> configClass) Notify theNodeFactory
that a new type of node is available, and what SMS service contains its configuration.void
unregisterNode
(Config nodeConfig) Remove node form the list of cached node services.
-
Field Details
-
DEFAULT_VERSION
static final int DEFAULT_VERSIONThe default version of a node service. This can be removed when versioning is fully implemented.- See Also:
-
-
Method Details
-
registerNode
Notify theNodeFactory
that a new type of node is available, and what SMS service contains its configuration.- Parameters:
nodeClass
- The class that must implementNode
.nodeConfig
- The node config annotation.configClass
- The node config class.
-
unregisterNode
Remove node form the list of cached node services.- Parameters:
nodeConfig
- the config of the node.
-
getNodeTypeServiceNames
Returns the set of service names for all the available node types.- Returns:
- Set of service names.
-
isNodeService
Whether the SMS service name matches any node services.- Parameters:
serviceName
- The candidate service name.- Returns:
- Whether it's a node service.
-
isNodeService
Whether the SMS service name is a node service.- Parameters:
serviceName
- The candidate service name.version
- The node type version.- Returns:
- Whether it's a node service.
-
getNodeType
Get the node class from the name of the service.- Parameters:
serviceName
- The name of the node service.version
- The node type version.- Returns:
- The node type.
-
createNodeConfigInstance
Object createNodeConfigInstance(String serviceName, Integer version, Realm realm, Map<String, Object> config) throws ServiceNotFoundExceptionConstruct a non-persisted instance of the given service interface.The instance is provided with data which has not been read from config and should only be used for validation purposes.
- Parameters:
serviceName
- The name of the service.version
- The version of the node.realm
- The realm that the configuration is associated with.config
- The configuration that the returned instance will use for its method's return values.- Returns:
- An instance of the service interface.
- Throws:
ServiceNotFoundException
- if a service with the given service name cannot be found.
-
getConfigType
Get the config class from the name of the service.- Parameters:
serviceName
- The name of the node service.version
- The version of the node service.- Returns:
- The node config type.
-
getNodeServiceName
Get the name of the service from the node class.- Parameters:
nodeClass
- The type of the node.- Returns:
- The node type.
-
getNodeVersion
Get the version of the node.- Parameters:
nodeClass
- The type of the node.- Returns:
- The version of the node.
-