Interface SharedObjectsIO

All Known Implementing Classes:
DelegatingSharedObjectsIO, MemorySharedObjectsIO, VfsSharedObjectsIO

public interface SharedObjectsIO
This interface provide methods to retrieve and save the shared objects defined in shared.xml irrespective of where the shared objects are persisted.

Concurrency note: Because the Node class is completely non-thread-safe, even for read-only access, callers must use lock() before calling any method that operates on Nodes, and unlock() after all interactions with those Node objects are complete. Non-Node API methods are thread-safe.
  • Method Details

    • getSharedObjects

      Map<String,Node> getSharedObjects(String type) throws KettleException
      Get the collection of SharedObjects of the given type
      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

      void saveSharedObject(String type, String name, Node node) throws KettleException
      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
      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

      Node getSharedObject(String type, String name) throws KettleException
      Return the Shared Object Node for the given type and name. The lookup for the SharedObject using the name will be case-insensitive
      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

      void delete(String type, String name) throws KettleException
      Delete the SharedObject for the given type and name. The delete operation will be case-insensitive.
      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

      void clear(String type) throws KettleException
      Remove all the connections of a given type.
      Parameters:
      type - Type to clear
      Throws:
      KettleException
    • clearCache

      void clearCache()
      Clear any cached objects in the SharedObjectsIO
    • findSharedObjectIgnoreCase

      static String findSharedObjectIgnoreCase(String name, Set<String> existingKeys)
    • lock

      void lock()
      Lock the SharedObjectsIO for exclusive access. This lock should be held while interacting with any Node objects returned by this SharedObjectsIO.
    • unlock

      void unlock()
      Unlock the SharedObjectsIO after exclusive access is no longer needed.