Package org.pentaho.di.shared
Class BaseSharedObjectsManager<T extends org.pentaho.di.shared.SharedObjectInterface<T> & org.pentaho.di.repository.RepositoryElementInterface>
java.lang.Object
org.pentaho.di.shared.BaseSharedObjectsManager<T>
- All Implemented Interfaces:
org.pentaho.di.core.bowl.CachingManager,SharedObjectsManagementInterface<T>
- Direct Known Subclasses:
ClusterSchemaManager,DatabaseConnectionManager,PartitionSchemaManager,SlaveServerManager
public abstract class BaseSharedObjectsManager<T extends org.pentaho.di.shared.SharedObjectInterface<T> & org.pentaho.di.repository.RepositoryElementInterface>
extends Object
implements SharedObjectsManagementInterface<T>, org.pentaho.di.core.bowl.CachingManager
This class uses the SharedObjectsIO to retrieve and save shared objects. This is used by the UI.
This class caches the state of the underlying SharedObjectsIO, and does not re-read from the source. Only changes written through this interface will be reflected.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseSharedObjectsManager(String type, org.pentaho.di.shared.SharedObjectsIO sharedObjectsIO) -
Method Summary
Modifier and TypeMethodDescriptionvoidSave the SharedObjectInterface for a type using the persistence mechanism defined by SharedObjectIO and also add to the local mapvoidaddSubscriber(org.pentaho.di.core.bowl.UpdateSubscriber subscriber) Subscribe to changes made to this Manager instance.voidclear()Removes all sharedObjects for a typevoidprotected abstract TThis method is called while populating the sharedObjectMap to create concrete SharedObjectInterface implementation class.Get the SharedObjectInterface object for the type using the namegetAll()Get the list of SharedObjectInterface for the typevoidvoidRemove the provided databasevoidRemove the SharedObjectInterface object for a typevoidreset()resets the caches in this manager.
-
Field Details
-
Constructor Details
-
Method Details
-
add
Save the SharedObjectInterface for a type using the persistence mechanism defined by SharedObjectIO and also add to the local map- Specified by:
addin interfaceSharedObjectsManagementInterface<T extends org.pentaho.di.shared.SharedObjectInterface<T> & org.pentaho.di.repository.RepositoryElementInterface>- Parameters:
sharedObjectInterface-- Throws:
org.pentaho.di.core.exception.KettleException
-
getAll
Get the list of SharedObjectInterface for the type- Specified by:
getAllin interfaceSharedObjectsManagementInterface<T extends org.pentaho.di.shared.SharedObjectInterface<T> & org.pentaho.di.repository.RepositoryElementInterface>- Returns:
- Throws:
org.pentaho.di.core.exception.KettleException
-
get
Get the SharedObjectInterface object for the type using the name- Specified by:
getin interfaceSharedObjectsManagementInterface<T extends org.pentaho.di.shared.SharedObjectInterface<T> & org.pentaho.di.repository.RepositoryElementInterface>- Parameters:
name- name of the SharedObject- Returns:
- Throws:
org.pentaho.di.core.exception.KettleException
-
remove
Remove the SharedObjectInterface object for a type- Specified by:
removein interfaceSharedObjectsManagementInterface<T extends org.pentaho.di.shared.SharedObjectInterface<T> & org.pentaho.di.repository.RepositoryElementInterface>- Parameters:
sharedObjectInterface- SharedObject to remove- Throws:
org.pentaho.di.core.exception.KettleException
-
remove
Description copied from interface:SharedObjectsManagementInterfaceRemove the provided database- Specified by:
removein interfaceSharedObjectsManagementInterface<T extends org.pentaho.di.shared.SharedObjectInterface<T> & org.pentaho.di.repository.RepositoryElementInterface>- Parameters:
sharedObjectName- name of the SharedObject to remove- Throws:
org.pentaho.di.core.exception.KettleException
-
clear
public void clear() throws org.pentaho.di.core.exception.KettleExceptionDescription copied from interface:SharedObjectsManagementInterfaceRemoves all sharedObjects for a type- Specified by:
clearin interfaceSharedObjectsManagementInterface<T extends org.pentaho.di.shared.SharedObjectInterface<T> & org.pentaho.di.repository.RepositoryElementInterface>- Throws:
org.pentaho.di.core.exception.KettleException
-
reset
public void reset()resets the caches in this manager. -
addSubscriber
public void addSubscriber(org.pentaho.di.core.bowl.UpdateSubscriber subscriber) Subscribe to changes made to this Manager instance.Note that this implementation uses a WeakReference to retain the connection to the subscriber, so the caller should hold onto this object as long as it needs to be called for changes.
- Specified by:
addSubscriberin interfaceorg.pentaho.di.core.bowl.CachingManager- Parameters:
subscriber-
-
notifyChanged
public void notifyChanged()- Specified by:
notifyChangedin interfaceorg.pentaho.di.core.bowl.CachingManager
-
clearCache
public void clearCache()- Specified by:
clearCachein interfaceorg.pentaho.di.core.bowl.CachingManager