Class LogicModuleMetadataMgr
- java.lang.Object
-
- es.bsc.dataclay.util.management.AbstractManager
-
- es.bsc.dataclay.logic.logicmetadata.LogicModuleMetadataMgr
-
- All Implemented Interfaces:
CommonManager
public final class LogicModuleMetadataMgr extends AbstractManager
-
-
Field Summary
Fields Modifier and Type Field Description protected static booleanDEBUG_ENABLEDIndicates if debug is enabled.-
Fields inherited from class es.bsc.dataclay.util.management.AbstractManager
dataSource
-
-
Constructor Summary
Constructors Constructor Description LogicModuleMetadataMgr(SQLiteDataSource dataSource)Instantiates an MetaDataService that uses the Backend configuration provided.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanCaches()Method that cleans the caches of the manager.voidcloseDbHandler()Close DbHandlerbooleanexistsMetaData()Check if there is a LogicModuleMap<ExecutionEnvironmentID,ExecutionEnvironment>getAllExecutionEnvironmentsInfo(CommonMessages.Langs execEnvLang)This operation retrieves the info of all the current registered execution environments.Set<DataClayInstanceID>getAllExternalDataClays()Get all dataClays current dataClay has objects federated withMap<StorageLocationID,StorageLocation>getAllStorageLocationsInfo()This operation retrieves the info of all the current registered storage locations.Map<ExecutionEnvironmentID,ExecutionEnvironment>getBackendCache()Get the MetaDataService::backendCacheExecutionEnvironmentgetExecutionEnvironmentInfo(ExecutionEnvironmentID execEnvID)This operation retrieves the info of an execution environmentDataClayInstanceIDgetExternalDataClayID(String host, int port)Retrieves id of an external dataClay instance identified by host and portDataClayInstancegetExternalDataClayInfo(DataClayInstanceID extDataClayID)Retrieves information about an external dataClay instance identified by provided idLogicMetadataIDsgetLogicMetadata()Get LogicModule metadata by IDTuple<ExecutionEnvironmentID,ExecutionEnvironment>getRandomExecutionEnvironmentInfo(CommonMessages.Langs execEnvLang)Retrieves a random execution environmentStorageLocationIDgetStorageLocationID(String stLocName)This operation queries a Storage Location by its nameStorageLocationgetStorageLocationInfo(StorageLocationID storageLocationID)This operation retrieves the info of a storage locationExecutionEnvironmentIDregisterExecutionEnvironment(ExecutionEnvironment newBackend)This operation register the Execution Environment with ID provided.voidregisterExternalDataclay(DataClayInstance dataClay)Register external dataclayvoidregisterLogicModule(LogicMetadataIDs logicmoduleIDs)Store into databaseStorageLocationIDregisterStorageLocation(StorageLocation newStLoc)This operation register the Storage Location with ID provided.voidunregisterExecutionEnvironment(ExecutionEnvironmentID execEnvID)Unregisters an execution environmentvoidunregisterExternalDataClayAddress(String host, Integer port)Unregister external dataClay addressvoidunregisterStorageLocation(StorageLocationID stLocID)Unregisters a storage locationvoidupdateExecutionEnvironment(ExecutionEnvironmentID eeID, String newhost, Integer newport)Updates host and port of a execution environmentvoidupdateStorageLocation(StorageLocationID stLocID, String newhost, Integer newport)Updates host and port of a storage location
-
-
-
Constructor Detail
-
LogicModuleMetadataMgr
public LogicModuleMetadataMgr(SQLiteDataSource dataSource)
Instantiates an MetaDataService that uses the Backend configuration provided.- Parameters:
dataSource- Data source.
-
-
Method Detail
-
registerStorageLocation
public StorageLocationID registerStorageLocation(StorageLocation newStLoc) throws StorageLocationAlreadyExistsException
This operation register the Storage Location with ID provided.- Parameters:
newStLoc- Specifications of the Storage Location to register- Returns:
- The ID of the new Storage Location registered
- Throws:
StorageLocationAlreadyExistsException- if the storage location is already registered
-
unregisterStorageLocation
public void unregisterStorageLocation(StorageLocationID stLocID)
Unregisters a storage location- Parameters:
stLocID- id of the storage location to be unregistered
-
updateStorageLocation
public void updateStorageLocation(StorageLocationID stLocID, String newhost, Integer newport)
Updates host and port of a storage location- Parameters:
stLocID- id of the storage location to be updatednewhost- New hostnewport- New port
-
updateExecutionEnvironment
public void updateExecutionEnvironment(ExecutionEnvironmentID eeID, String newhost, Integer newport)
Updates host and port of a execution environment- Parameters:
eeID- id of the execution environment to be updatednewhost- New hostnewport- New port
-
registerExecutionEnvironment
public ExecutionEnvironmentID registerExecutionEnvironment(ExecutionEnvironment newBackend) throws ExecutionEnvironmentAlreadyExistsException
This operation register the Execution Environment with ID provided.- Parameters:
newBackend- Specifications of the Execution Environment to register- Returns:
- The ID of the new Execution Environment registered
- Throws:
ExecutionEnvironmentAlreadyExistsException- if the execution environment is already registered
-
unregisterExecutionEnvironment
public void unregisterExecutionEnvironment(ExecutionEnvironmentID execEnvID)
Unregisters an execution environment- Parameters:
execEnvID- id of the storage location to be unregistered
-
getStorageLocationID
public StorageLocationID getStorageLocationID(String stLocName)
This operation queries a Storage Location by its name- Parameters:
stLocName- Name of the Storage Location to get- Returns:
- The ID of the queried Storage Location
- Throws:
Exception- if an exception occurs:
StorageLocationNotExistException: if a storage location with the given name does not exist
-
getStorageLocationInfo
public StorageLocation getStorageLocationInfo(StorageLocationID storageLocationID)
This operation retrieves the info of a storage location- Parameters:
storageLocationID- ID of the storage location- Returns:
- the info of the storage location
- Throws:
Exception- if an exception occurs:
StorageLocationNotExistException: if the storage location does not exist
-
getAllStorageLocationsInfo
public Map<StorageLocationID,StorageLocation> getAllStorageLocationsInfo()
This operation retrieves the info of all the current registered storage locations.- Returns:
- info of the registered storage locations indexed by their IDs
-
getExecutionEnvironmentInfo
public ExecutionEnvironment getExecutionEnvironmentInfo(ExecutionEnvironmentID execEnvID)
This operation retrieves the info of an execution environment- Parameters:
execEnvID- ID of the execution environment to get its info- Returns:
- the info of the backend
- Throws:
Exception- if an exception occurs:
ExecutionEnvironmentNotExistException: if backend does not exist
-
getAllExecutionEnvironmentsInfo
public Map<ExecutionEnvironmentID,ExecutionEnvironment> getAllExecutionEnvironmentsInfo(CommonMessages.Langs execEnvLang)
This operation retrieves the info of all the current registered execution environments.- Parameters:
execEnvLang- language- Returns:
- info of the registered execution environments indexed by their IDs
-
getRandomExecutionEnvironmentInfo
public Tuple<ExecutionEnvironmentID,ExecutionEnvironment> getRandomExecutionEnvironmentInfo(CommonMessages.Langs execEnvLang)
Retrieves a random execution environment- Returns:
- the execution environment spec
-
registerExternalDataclay
public void registerExternalDataclay(DataClayInstance dataClay)
Register external dataclay- Parameters:
dataClay- instance to register
-
unregisterExternalDataClayAddress
public void unregisterExternalDataClayAddress(String host, Integer port)
Unregister external dataClay address- Parameters:
host- Hostport- Port
-
getExternalDataClayInfo
public DataClayInstance getExternalDataClayInfo(DataClayInstanceID extDataClayID) throws ExternalDataClayNotRegisteredException
Retrieves information about an external dataClay instance identified by provided id- Parameters:
extDataClayID- id of the external dataClay instance- Returns:
- info of external dataClay instance
- Throws:
ExternalDataClayNotRegisteredException- if no info about dataClay instance is registered
-
getExternalDataClayID
public DataClayInstanceID getExternalDataClayID(String host, int port) throws ExternalDataClayNotRegisteredException
Retrieves id of an external dataClay instance identified by host and port- Parameters:
host- hostport- port- Returns:
- id of external dataClay instance
- Throws:
ExternalDataClayNotRegisteredException- if no info about dataClay instance is registered
-
getAllExternalDataClays
public Set<DataClayInstanceID> getAllExternalDataClays()
Get all dataClays current dataClay has objects federated with- Returns:
- dataClay IDs current dataClay has objects federated with
-
registerLogicModule
public void registerLogicModule(LogicMetadataIDs logicmoduleIDs)
Store into database- Parameters:
logicmoduleIDs- logic module ids
-
existsMetaData
public boolean existsMetaData()
Check if there is a LogicModule- Returns:
- TRUE if exists. FALSE otherwise
-
getLogicMetadata
public LogicMetadataIDs getLogicMetadata()
Get LogicModule metadata by ID- Returns:
- The LogicModule metadata
-
getBackendCache
public Map<ExecutionEnvironmentID,ExecutionEnvironment> getBackendCache()
Get the MetaDataService::backendCache- Returns:
- the Backend Cache
-
closeDbHandler
public void closeDbHandler()
Close DbHandler
-
cleanCaches
public void cleanCaches()
Description copied from interface:CommonManagerMethod that cleans the caches of the manager. Used on testing.- Specified by:
cleanCachesin interfaceCommonManager- Specified by:
cleanCachesin classAbstractManager
-
-