Interface NodeFactory


public interface NodeFactory
A factory for creating Node instances and related configurations.
  • Method Details

    • createNode

      Node createNode(String type, Integer version, UUID id, Realm realm, Tree tree) throws NodeProcessException
      Constructs a Node instance that matches the given type and node ID.
      Parameters:
      type - node type
      version - node version
      id - node UUID
      realm - realm where the tree belongs to
      tree - 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 NodeProcessException
      Constructs a Node instance dynamically using the given type and configuration.
      Parameters:
      type - node type
      version - node version
      config - the node configuration, must be non-null.
      realm - realm where the tree belongs to.
      tree - tree where the node belongs to
      configRequired - 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 NodeProcessException
      Constructs a Node instance dynamically using the given type and configuration. Generates a new uuid for the new node.
      Parameters:
      type - node type
      version - node version
      config - the node configuration, must be non-null.
      realm - realm where the tree belongs to.
      tree - tree where the node belongs to
      configRequired - 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 in
      type - node type
      version - 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.