org.pentaho.di.shared
Class SharedObjects

java.lang.Object
  extended by org.pentaho.di.shared.SharedObjects

public class SharedObjects
extends Object

Based on a piece of XML, this factory will give back a list of objects. In other words, it does XML de-serialisation

Author:
Matt

Constructor Summary
SharedObjects()
           
SharedObjects(String sharedObjectsFile)
           
 
Method Summary
static String createFilename(String sharedObjectsFile)
           
 String getFilename()
           
 Map<org.pentaho.di.shared.SharedObjects.SharedEntry,SharedObjectInterface> getObjectsMap()
           
 DatabaseMeta getSharedDatabase(String name)
          Get the shared database with the specified name
 SharedObjectInterface getSharedObject(Class<SharedObjectInterface> clazz, String objectName)
          Return the shared object with the given class and name
 SharedObjectInterface getSharedObject(String className, String objectName)
          Return the shared object with the given class name and object name
 void removeObject(SharedObjectInterface sharedObject)
          Remove the sharedObject from the object map.
 void saveToFile()
           
 void setFilename(String filename)
           
 void setObjectsMap(Map<org.pentaho.di.shared.SharedObjects.SharedEntry,SharedObjectInterface> objects)
           
 void storeObject(SharedObjectInterface sharedObject)
          Store the sharedObject in the object map.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SharedObjects

public SharedObjects(String sharedObjectsFile)
              throws KettleXMLException
Throws:
KettleXMLException

SharedObjects

public SharedObjects()
              throws KettleXMLException
Throws:
KettleXMLException
Method Detail

createFilename

public static final String createFilename(String sharedObjectsFile)

getObjectsMap

public Map<org.pentaho.di.shared.SharedObjects.SharedEntry,SharedObjectInterface> getObjectsMap()

setObjectsMap

public void setObjectsMap(Map<org.pentaho.di.shared.SharedObjects.SharedEntry,SharedObjectInterface> objects)

storeObject

public void storeObject(SharedObjectInterface sharedObject)
Store the sharedObject in the object map. It is possible to have 2 different types of shared object with the same name. They will be stored separately.

Parameters:
sharedObject -

removeObject

public void removeObject(SharedObjectInterface sharedObject)
Remove the sharedObject from the object map.

Parameters:
sharedObject -

saveToFile

public void saveToFile()
                throws IOException,
                       KettleException
Throws:
IOException
KettleException

getFilename

public String getFilename()
Returns:
the filename

setFilename

public void setFilename(String filename)
Parameters:
filename - the filename to set

getSharedObject

public SharedObjectInterface getSharedObject(Class<SharedObjectInterface> clazz,
                                             String objectName)
Return the shared object with the given class and name

Parameters:
clazz - The class of the shared object
objectName - the name of the object
Returns:
The shared object or null if none was found.

getSharedObject

public SharedObjectInterface getSharedObject(String className,
                                             String objectName)
Return the shared object with the given class name and object name

Parameters:
clasName - The class name of the shared object
objectName - the name of the object
Returns:
The shared object or null if none was found.

getSharedDatabase

public DatabaseMeta getSharedDatabase(String name)
Get the shared database with the specified name

Parameters:
name - The name of the shared database
Returns:
The database or null if nothing was found.