Class DelegatingSharedObjectsIO

java.lang.Object
org.pentaho.di.shared.DelegatingSharedObjectsIO
All Implemented Interfaces:
SharedObjectsIO

public class DelegatingSharedObjectsIO extends Object implements SharedObjectsIO
A Read-only wrapper around multiple other SharedObjectsIO implementations that combines them by precedence order.

Concurrency Note: Locks will be taken on all the delegated SharedObjectsIO instances in the order they were provided. This requires that stores are always provided in the same order to avoid deadlocks.

  • Constructor Details

    • DelegatingSharedObjectsIO

      public DelegatingSharedObjectsIO(SharedObjectsIO... stores)
      Construct a new instance with a prioritized list of SharedObjectsIO instances.

      The earlier a store exists in this list, the higher the priority it is.

      Parameters:
      stores - prioritized list of SharedObjectsIO instances
  • Method Details

    • getSharedObjects

      public Map<String,Node> getSharedObjects(String type) throws KettleException
      Description copied from interface: SharedObjectsIO
      Get the collection of SharedObjects of the given type
      Specified by:
      getSharedObjects in interface SharedObjectsIO
      Parameters:
      type - The type is shared object type for example, "connection", "slaveserver", "partitionschema" and clusterschema"
      Returns:
      Mapinvalid input: '<'String,Node> The collection of name of sharedObject and the Xml Node containing the details. For example, {"my-postgres", node} where my-postgres is the name of the type - database connection and the Node is xml node containing the details of the db connection.
      Throws:
      KettleException
    • getSharedObject

      public Node getSharedObject(String type, String name) throws KettleException
      Description copied from interface: SharedObjectsIO
      Return the Shared Object Node for the given type and name. The lookup for the SharedObject using the name will be case-insensitive
      Specified by:
      getSharedObject in interface SharedObjectsIO
      Parameters:
      type - The type is shared object type for example, "connection", "slaveserver", "partitionschema" and clusterschema"
      name - The name is the name of the sharedObject
      Returns:
      Xml node
      Throws:
      KettleException
    • delete

      public void delete(String type, String name) throws KettleException
      Description copied from interface: SharedObjectsIO
      Delete the SharedObject for the given type and name. The delete operation will be case-insensitive.
      Specified by:
      delete in interface SharedObjectsIO
      Parameters:
      type - The type is shared object type for example, "connection", "slaveserver", "partitionschema" and clusterschema"
      name - The name is the name of the sharedObject
      Throws:
      KettleException
    • clear

      public void clear(String type) throws KettleException
      Description copied from interface: SharedObjectsIO
      Remove all the connections of a given type.
      Specified by:
      clear in interface SharedObjectsIO
      Parameters:
      type - Type to clear
      Throws:
      KettleException
    • saveSharedObject

      public void saveSharedObject(String type, String name, Node node) throws KettleException
      Description copied from interface: SharedObjectsIO
      Save the SharedObject node for the type and name. If the SharedObject name exist but in a different case, the existing entry will be deleted and the new entry will be saved with provided name
      Specified by:
      saveSharedObject in interface SharedObjectsIO
      Parameters:
      type - The type is shared object type for example, "connection", "slaveserver", "partitionschema" and clusterschema"
      name - The name is the name of the sharedObject
      node - The Xml node containing the details of the shared object
      Throws:
      KettleException
    • clearCache

      public void clearCache()
      Description copied from interface: SharedObjectsIO
      Clear any cached objects in the SharedObjectsIO
      Specified by:
      clearCache in interface SharedObjectsIO
    • lock

      public void lock()
      Description copied from interface: SharedObjectsIO
      Lock the SharedObjectsIO for exclusive access. This lock should be held while interacting with any Node objects returned by this SharedObjectsIO.
      Specified by:
      lock in interface SharedObjectsIO
    • unlock

      public void unlock()
      Description copied from interface: SharedObjectsIO
      Unlock the SharedObjectsIO after exclusive access is no longer needed.
      Specified by:
      unlock in interface SharedObjectsIO