Package org.pentaho.di.shared
Class VfsSharedObjectsIO
java.lang.Object
org.pentaho.di.shared.VfsSharedObjectsIO
- All Implemented Interfaces:
SharedObjectsIO
Provide methods to retrieve and save the shared objects defined in shared.xml that is stored in file system.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.pentaho.di.shared.SharedObjectsIO
SharedObjectsIO.SharedObjectType -
Constructor Summary
ConstructorsConstructorDescriptionCreates the instance of VfsSharedObjectsIO using the default location of the shared file.VfsSharedObjectsIO(String rootFolder, Bowl bowl) Creates the instance of VfsSharedObjectsIO using the rootFolder. -
Method Summary
Modifier and TypeMethodDescriptionvoidRemove all the connections of a given type.voidClear any cached objects in the SharedObjectsIOvoidDelete the SharedObject for the given type and name.getSharedObject(String type, String name) Return the node for the given SharedObject type and name.getSharedObjects(String type) Return the Map of names and the corresponding nodes for the given shared object type.voidlock()Lock the SharedObjectsIO for exclusive access.protected voidrestoreFileFromBackup(String backupFileName) voidsaveSharedObject(String type, String name, Node node) Save the name and the node for the given Shared Object Type in the file.protected voidprotected Stringvoidunlock()Unlock the SharedObjectsIO after exclusive access is no longer needed.protected voidwriteToFile(org.apache.commons.vfs2.FileObject fileObject, Optional<String> backupFileName)
-
Constructor Details
-
VfsSharedObjectsIO
public VfsSharedObjectsIO()Creates the instance of VfsSharedObjectsIO using the default location of the shared file. -
VfsSharedObjectsIO
Creates the instance of VfsSharedObjectsIO using the rootFolder.- Parameters:
rootFolder- the root folder containing the shared object file.
-
-
Method Details
-
clearCache
public void clearCache()Description copied from interface:SharedObjectsIOClear any cached objects in the SharedObjectsIO- Specified by:
clearCachein interfaceSharedObjectsIO
-
saveToFile
- Throws:
KettleException
-
writeToFile
protected void writeToFile(org.apache.commons.vfs2.FileObject fileObject, Optional<String> backupFileName) throws IOException, KettleException - Throws:
IOExceptionKettleException
-
restoreFileFromBackup
- Throws:
IOExceptionKettleFileException
-
delete
Delete the SharedObject for the given type and name. The delete operation will be case-insensitive.- Specified by:
deletein interfaceSharedObjectsIO- 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
Description copied from interface:SharedObjectsIORemove all the connections of a given type.- Specified by:
clearin interfaceSharedObjectsIO- Parameters:
type- Type to clear- Throws:
KettleException
-
lock
public void lock()Description copied from interface:SharedObjectsIOLock the SharedObjectsIO for exclusive access. This lock should be held while interacting with any Node objects returned by this SharedObjectsIO.- Specified by:
lockin interfaceSharedObjectsIO
-
unlock
public void unlock()Description copied from interface:SharedObjectsIOUnlock the SharedObjectsIO after exclusive access is no longer needed.- Specified by:
unlockin interfaceSharedObjectsIO
-
toString
- Throws:
KettleXMLException