Class MemorySharedObjectsIO

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

public class MemorySharedObjectsIO extends Object implements SharedObjectsIO
Holds shared objects in memory.

Note that any shared objects stored in this cannot participate in the XmlHander cache. That is, they must pass 'false' to XMLHandler.getSubNodeByNr().

  • Constructor Details

    • MemorySharedObjectsIO

      public MemorySharedObjectsIO()
  • 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
    • saveSharedObject

      public void saveSharedObject(String type, String name, Node node) throws KettleException
      Save the SharedObject in memory. This operation is case-insensitive. If the SharedObject name exist 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
    • getSharedObject

      public Node getSharedObject(String type, String name) throws KettleException
      Return the node for the given SharedObject 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:
      Throws:
      KettleException
    • delete

      public void delete(String type, String name) throws KettleException
      Remove the SharedObject for the type and name. The lookup for the SharedObject using the name 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
    • clear

      public void clear()
    • 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
    • assertUnlocked

      public void assertUnlocked()
    • clearCache

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