Package es.bsc.dataclay.logic
Class LogicModule
- java.lang.Object
-
- es.bsc.dataclay.logic.LogicModule
-
- All Implemented Interfaces:
LogicModuleAPI
public class LogicModule extends Object implements LogicModuleAPI
This class represents the entry point to the system.
-
-
Field Summary
Fields Modifier and Type Field Description static String
DC_PUBLIC_NAMESPACE
Name of public namespace DataClay (for DataClay classes).static String
DC_REGISTRATOR
Name of DataClay registrator (for DataClay classes).PasswordCredential
dcCredentials
Credentials of DataClay registrator (for DataClay classes).protected static boolean
DEBUG_ENABLED
Indicates if debug is enabled.static String
DEFAULT_DS_SUFFIX
Suffix for default dataset.static String
DEFAULT_JAVA_NS_SUFFIX
Suffix for default java namespace.static String
DEFAULT_PYTHON_NS_SUFFIX
Suffix for default python namespace.CommonGrpcClient
grpcClient
Grpc client.protected String
hostname
LogicModule hostname.protected static org.apache.logging.log4j.Logger
LOGGER
Logger.protected String
name
Name of the LMprotected int
port
LogicModule port.LogicMetadataIDs
publicIDs
LM public IDs (admin, contract, datasets...) This field contains all IDs that must be the same even if we restart LM or for backups.
-
Constructor Summary
Constructors Constructor Description LogicModule(String lmName, String thehostname, int theport, boolean inMemory, String theexposedIPForClient)
LogicModule constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activateTracing(int currentAvailableTaskID)
Activate tracing.void
adviseEvent(EventMessage newEvent)
Advises Notification Manager new event has occurred.StorageLocationID
autoregisterEE(ExecutionEnvironmentID id, String eeName, String eeHostname, Integer eePort, CommonMessages.Langs language)
Register execution environmentvoid
autoregisterSL(StorageLocationID id, String dsName, String dsHostname, Integer dsPort)
Register storage locationvoid
checkAlive()
Check logic module is alive.boolean
checkDataSetIsPublic(DataSetID datasetID)
Checks whether the dataset is public or notvoid
cleanCachesOfDataService(String dsName)
Resume traces in servicesvoid
cleanMetaDataCaches()
Clean MD cachesvoid
closeDb()
Close logic db.void
closeManagerDb()
Close mgr db.void
closeSession(SessionID sessionID)
Close session.void
deactivateTracing()
Deactivate Extrae tracingObjectID
deleteAlias(SessionID sessionID, String alias)
Removes the alias of an objectboolean
executeFilterMethod(ObjectID objectID, SessionID sessionID, SerializedParametersOrReturn params, OperationID opID)
Method that executes a filterMethod in a certain object without parameters.SerializedParametersOrReturn
executeImplementation(SessionID sessionID, OperationID operationID, Triple<ImplementationID,ContractID,InterfaceID> remoteImplementation, ObjectID objectID, SerializedParametersOrReturn params)
Method that executes an implementationSerializedParametersOrReturn
executeMethodOnTarget(SessionID sessionID, ObjectID objectID, String operationSignature, SerializedParametersOrReturn params, ExecutionEnvironmentID backendID)
Method that executes a method on a specific target (using an arbitrary implementation given the session info).void
executeNotificationAction(ObjectID objectID, SessionID sessionID, SerializedParametersOrReturn params, OperationID opID)
Method that executes an action in a certain object.boolean
existsActiveEnvironmentsForSL(StorageLocationID stLocID)
Check if there is an active Execution Environment associated to SL with ID provided.void
finishCacheThreads()
Finish cache threads.Set<String>
getAccountDataSets(AccountID accountID, PasswordCredential credential)
Retrieves the datasets provided by the given accountAccountID
getAccountID(String accountName)
Method that retrieves the id of an account given its nameHashSet<AccountID>
getAccountList(AccountID adminAccountID, PasswordCredential adminCredential)
The list of users registered in the systemAccountManagerDB
getAccountManagerDB()
Get manager db.Map<ExecutionEnvironmentID,ExecutionEnvironment>
getAllExecutionEnvironmentsInfo(CommonMessages.Langs execEnvLang, boolean getExternal, boolean fromBackend)
Method that retrieves the info of all the registered backendsbyte[]
getBabelStubs(AccountID applicantAccountID, PasswordCredential applicantCredential, List<ContractID> contractsIDs)
Method that allows to retrieve the "Babel" (language independent YAML-based) stubs of the given contracts (merging interfaces if necessary).Tuple<Namespace,Set<MetaClass>>
getClassesInNamespace(String namespaceName)
Get all classes from namespace with name provided in current dataClay.MetaClassID
getClassID(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, String className)
Method that retrieves the id of a class given its nameMetaClass
getClassInfo(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, String className)
Method that retrieves the id of a class given its nameClassManager
getClassManager()
Get Class manager (for testing purposes)ClassManagerDB
getClassManagerDB()
Get manager db.Tuple<String,String>
getClassNameAndNamespaceForDS(MetaClassID classID)
Get class name and namespace name for Data ServiceString
getClassNameForDS(MetaClassID classID)
Get class name for Data ServiceContractID
getContractIDOfDataClayProvider(AccountID accountID, PasswordCredential credential)
Get contract ID of DataClay classesMap<ContractID,Contract>
getContractIDsOfApplicant(AccountID applicantAccountID, PasswordCredential credential)
Method that returns all contract IDs of a user (as applicant).Map<ContractID,Contract>
getContractIDsOfApplicantWithProvider(AccountID applicantAccountID, PasswordCredential credential, NamespaceID namespaceIDofProvider)
Method that returns all contract IDs of a user (as applicant) with the given namespace provider.Map<ContractID,Contract>
getContractIDsOfProvider(AccountID accountID, PasswordCredential credential, NamespaceID namespaceIDofProvider)
Method that returns all contract IDs of a namespace (as provider).ContractManagerDB
getContractManagerDB()
Get manager db.DataClayInstanceID
getDataClayID()
Method that retrieves the ID of current dataClay instanceMap<DataContractID,DataContract>
getDataContractIDsOfApplicant(AccountID applicantAccountID, PasswordCredential credential)
Method that retrieves the data contracts that an account has (as applicant).Map<DataContractID,DataContract>
getDataContractIDsOfProvider(AccountID accountID, PasswordCredential credential, DataSetID datasetIDofProvider)
Method that retrieves the data contracts that a dataset provides.DataContract
getDataContractInfoOfApplicantWithProvider(AccountID applicantAccountID, PasswordCredential credential, DataSetID datasetIDofProvider)
Method that retrieves the data contract of an account (as applicant) with a certain dataset.DataContractManagerDB
getDataContractManagerDB()
Get manager db.DataSetID
getDataSetID(AccountID accountID, PasswordCredential credential, String datasetName)
Retrieves the id of a dataset identified by name providedDataSetManagerDB
getDataSetManagerDB()
Get manager db.DataServiceAPI
getExecutionEnvironmentAPI(ExecutionEnvironment backend)
Get remote DataService APIExecutionEnvironment
getExecutionEnvironmentInfo(ExecutionEnvironmentID backendID, boolean fromBackend)
Retrieves the backend specificationprotected Map<ExecutionEnvironmentID,Tuple<DataServiceAPI,ExecutionEnvironment>>
getExecutionEnvironments(CommonMessages.Langs lang)
Get DataService APIs for backend with support for a given language.DataClayInstanceID
getExternalDataClayID(String dcHost, int dcPort)
Tries to connect to an external dataClay instance and retrieve its ID.DataClayInstance
getExternalDataClayInfo(DataClayInstanceID extDataClayID)
Method that retrieves the info of an external dataClay instanceMap<MetaClassID,MetaClass>
getInfoOfClassesInNamespace(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID)
Method that retrieves the info of the classes registered in specific namespace.Tuple<Tuple<DataSetID,Set<DataSetID>>,Calendar>
getInfoOfSessionForDS(SessionID sessionID)
Checks provided session and returns visible datasetsInterface
getInterfaceInfo(AccountID accountID, PasswordCredential credential, InterfaceID interfaceID)
Method that retrieves the info of the interface if the account is registered in a contract that contains itInterfaceManagerDB
getInterfaceManagerDB()
Get manager db.MetaDataInfo
getMetadataByOID(SessionID sessionID, ObjectID objectID)
Method that retrieves the locations of all the replicas of a specific object and its classname.MetaDataInfo
getMetadataByOIDForDS(ObjectID objectID)
Get metadata by oid.MetaDataServiceDB
getMetaDataServiceDb()
Get logic db.MetaDataService
getMetaDataSrvApi()
NamespaceID
getNamespaceID(AccountID accountID, PasswordCredential credential, String namespaceName)
Retrieves the id of a namespace identified by name providedCommonMessages.Langs
getNamespaceLang(AccountID accountID, PasswordCredential credential, String namespaceName)
Retrieves the language of a namespace identified by name providedNamespaceManagerDB
getNamespaceManagerDB()
Get manager db.Set<String>
getNamespaces(AccountID accountID, PasswordCredential credential)
Retrieves the names of the available namespacesNotificationManagerDB
getNotificationManagerDB()
Get manager db.int
getNumObjects()
Get number of objects in dataClayDataSetID
getObjectDataSetID(SessionID sessionID, ObjectID oid)
Retrieves the id of a dataset of the object with ID provided.Triple<ObjectID,MetaClassID,ExecutionEnvironmentID>
getObjectFromAlias(SessionID sessionID, String alias)
Retrieves the objectID corresponding to the object with the specified alias.Tuple<String,String>
getObjectInfo(SessionID sessionID, ObjectID objectID)
Method to check whether an object is accessible with the specified session and returns its classname and namespace of the class.Map<ObjectID,MetaDataInfo>
getObjectsMetaDataInfoOfClassForNM(MetaClassID classID)
Retrieves the information of the objects instantiating the given class.OperationID
getOperationID(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, String className, String operationSignature)
Method that retrieves the id of an operation given its signatureAccountID
getOwner(ObjectID objectID)
Get owner of the objectPropertyID
getPropertyID(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, String className, String propertyName)
Method that retrieves the id of a property given its signatureSet<String>
getPublicDataSets(AccountID accountID, PasswordCredential credential)
Retrieves the publicly available datasetsSessionManagerDB
getSessionManagerDB()
Get manager db.StorageLocationID
getStorageLocationID(String slName)
Get ID of storage location with name providedStorageLocation
getStorageLocationInfo(StorageLocationID backendID, boolean fromBackend)
Retrieves the backend specificationprotected Map<StorageLocationID,Tuple<DataServiceAPI,StorageLocation>>
getStorageLocations()
Get DataService APIs for backend with support for a given language.Map<String,byte[]>
getStubs(AccountID applicantAccountID, PasswordCredential applicantCredential, CommonMessages.Langs language, List<ContractID> contractsIDs)
Method that allows to retrieve the stubs of the given contracts (merging interfaces if necessary)Map<String,byte[]>
getTraces()
Get Extrae traces (mpits and set files)void
importContract(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, ContractID contractID)
Imports the interfaces of the contract into a specific namespacevoid
importInterface(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, ContractID contractID, InterfaceID interfaceID)
Imports an interface in contract into a specific namespacevoid
importModelsFromExternalDataClay(String extNamespaceName, DataClayInstanceID extDataClayID)
Import classes in namespace from external dataClay providedSessionID
initializeSessionAsOwnerOfObject(AccountID ownerID)
Initialize session of owner's object.boolean
isPrefetchingEnabled()
Indicates if dataClay has prefetching enabled.boolean
isShuttingDown()
List<ObjectID>
moveObject(SessionID sessionID, ObjectID objectID, ExecutionEnvironmentID srcLocationID, ExecutionEnvironmentID destLocationID, boolean recursive)
Method that moves an object from location to location.AccountID
newAccount(AccountID adminAccountID, PasswordCredential adminCredential, Account newAccount)
This operation creates a new account in the system with the provided username.AccountID
newAccountNoAdmin(Account newAccount)
This operation creates a new account in the system without admin credentials.Map<String,MetaClass>
newClass(AccountID accountID, PasswordCredential credential, CommonMessages.Langs language, Map<String,MetaClass> newClasses)
This operation creates a new metaclass in the system with the provided specifications and associate it to the Namespace provided.ContractID
newContract(AccountID accountID, PasswordCredential credential, Contract newContract)
Method to register a new contract.DataContractID
newDataContract(AccountID accountID, PasswordCredential credential, DataContract newDataContract)
Creates a new Data ContractDataSetID
newDataSet(AccountID accountID, PasswordCredential credential, DataSet newDataSet)
Method that creates a new dataset in the system.InterfaceID
newInterface(AccountID accountID, PasswordCredential credential, Interface newInterface)
Method that registers a new interfaceNamespaceID
newNamespace(AccountID accountID, PasswordCredential credential, Namespace newNamespace)
Method that creates a new namespace in the system.SessionInfo
newSession(AccountID accountID, PasswordCredential credential, Set<ContractID> contracts, Set<DataSetID> dataSetIDs, DataSetID dataSetForStore, CommonMessages.Langs newsessionLang)
Method that registeres a new session for the given account considering the provided interfaces in contractvoid
notifyExecutionEnvironmentShutdown(ExecutionEnvironmentID execEnvID)
Notify that Execution Environment with ID provided has been shut down.DataClayInstanceID
notifyRegistrationOfExternalDataClay(DataClayInstanceID dataClayInstanceID, String thehostname, int theport)
When you register an external DataClay, we notify external dataClay about the registration and we get the ID of the external dataClay.void
notifyStorageLocationShutdown(StorageLocationID stLocID)
Notify that Storage Location with ID provided has been shut down.boolean
objectExistsInDataClay(ObjectID objectID)
Check if object exists in dataClay (in any EE memory or SL)byte[]
performSetOfNewAccounts(AccountID adminID, PasswordCredential adminCredential, byte[] yamlFile)
Perform a series of new account creations, described by a YAML parameter.byte[]
performSetOfOperations(AccountID performerID, PasswordCredential performerCredential, byte[] yamlFile)
Perform a series of operations, described by a YAML parameter.void
publishAddress(String thehostname, int theport)
Configure LogicModule to give provided address in case external dataClays require to know how to access current dataClayMap<String,MetaClass>
registerAndUpdateDependencies(AccountID accountID, PasswordCredential credentials, CommonMessages.Langs language, Map<String,MetaClass> metaClasses, NamespaceID enrichmentNamespaceID, String enrichedClassName)
This internal operation recursively registers all the required dependencies of a metaClass to be usable.void
registerEventListenerImplementation(AccountID accountID, PasswordCredential credential, ECA newEventListener)
Registers an event listener implementationDataClayInstanceID
registerExternalDataClay(String thehostname, int theport)
Method that tries to register an external instance of dataClay assigning a new ID to it.DataClayInstanceID
registerExternalDataClayOverrideAuthority(AccountID adminAccountID, PasswordCredential adminCredential, String thehostname, int theport, String authority)
For system-admin users only.void
registerObjectFromGC(RegistrationInfo regInfo, ExecutionEnvironmentID backendID, DataServiceRuntime clientLib)
Register objects in MDSList<ObjectID>
registerObjects(List<RegistrationInfo> regInfos, ExecutionEnvironmentID backendID, CommonMessages.Langs lang)
Register objects in MDSvoid
registerToPublicContract(AccountID accountID, PasswordCredential credential, ContractID contractID)
Method to register an account to a contractContractID
registerToPublicContractOfNamespace(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID)
Method to register an account to a public contract given a namespacevoid
registerToPublicDataContract(AccountID accountID, PasswordCredential credential, DataContractID datacontractID)
Method that registers a certain account to a public data contract.void
removeClass(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, String className)
Method that removes a class given its name and the name of the namespace where it belongs tovoid
removeDataSet(AccountID accountID, PasswordCredential credential, String datasetName)
This method removes a dataset from the system by checking it has no active data contract associated with it and no objects registered in it.void
removeImplementation(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, ImplementationID implementationID)
Method that removes an implementation of a certain operationvoid
removeInterface(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, InterfaceID interfaceID)
Method that removes a specific interfacevoid
removeNamespace(AccountID accountID, PasswordCredential credential, String namespaceName)
This method removes a namespace from the system by checking it has no active contract associated with it, and no classes registered on it.void
removeOperation(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, String className, String operationSignature)
Method that removes an operation given its signaturevoid
setDataSetID(SessionID sessionID, ObjectID objectID, DataSetID dataSetID)
Set dataset id of objectvoid
setDataSetIDFromGarbageCollector(ObjectID objectID, DataSetID dataSetID)
Set DataSetID from GCvoid
setObjectReadOnly(SessionID sessionID, ObjectID objectID)
Method that sets the object as read onlyvoid
setObjectReadWrite(SessionID sessionID, ObjectID objectID)
Method that sets the object as read-writevoid
setShuttingDown(boolean theshuttingDown)
void
unregisterExecutionEnvironment(ExecutionEnvironmentID execEnvID)
Unregister execution environment with ID providedvoid
unregisterObjects(Set<ObjectID> objectsToUnregister)
Unregister objects (called from GlobalGC)void
unregisterStorageLocation(StorageLocationID stLocID)
Unregister storage location with ID providedprotected void
updateAPIsFromDB()
Update APIs for all registered environments/storage locationsvoid
waitAndProcessAllAsyncRequests()
Wait for all asynchronous request to finish.void
waitForAllNodesShutdown()
Wait for all registered Storage locations and Execution environments to shut down.
-
-
-
Field Detail
-
LOGGER
protected static final org.apache.logging.log4j.Logger LOGGER
Logger.
-
DEBUG_ENABLED
protected static final boolean DEBUG_ENABLED
Indicates if debug is enabled.
-
hostname
protected String hostname
LogicModule hostname.
-
port
protected int port
LogicModule port.
-
grpcClient
public final CommonGrpcClient grpcClient
Grpc client.
-
DC_PUBLIC_NAMESPACE
public static final String DC_PUBLIC_NAMESPACE
Name of public namespace DataClay (for DataClay classes).- See Also:
- Constant Field Values
-
DC_REGISTRATOR
public static final String DC_REGISTRATOR
Name of DataClay registrator (for DataClay classes).- See Also:
- Constant Field Values
-
DEFAULT_DS_SUFFIX
public static final String DEFAULT_DS_SUFFIX
Suffix for default dataset.- See Also:
- Constant Field Values
-
DEFAULT_JAVA_NS_SUFFIX
public static final String DEFAULT_JAVA_NS_SUFFIX
Suffix for default java namespace.- See Also:
- Constant Field Values
-
DEFAULT_PYTHON_NS_SUFFIX
public static final String DEFAULT_PYTHON_NS_SUFFIX
Suffix for default python namespace.- See Also:
- Constant Field Values
-
publicIDs
public LogicMetadataIDs publicIDs
LM public IDs (admin, contract, datasets...) This field contains all IDs that must be the same even if we restart LM or for backups.
-
dcCredentials
public PasswordCredential dcCredentials
Credentials of DataClay registrator (for DataClay classes).
-
name
protected String name
Name of the LM
-
-
Constructor Detail
-
LogicModule
public LogicModule(String lmName, String thehostname, int theport, boolean inMemory, String theexposedIPForClient) throws InterruptedException
LogicModule constructor- Parameters:
lmName
- LM namethehostname
- Logic module host nametheport
- Logic Module port.theexposedIPForClient
- IPs to be send to clients when information of a registered EE/SL is required. Can be null.- Throws:
InterruptedException
- If GRPC client cannot be initialized for some reason
-
-
Method Detail
-
getExecutionEnvironmentAPI
public DataServiceAPI getExecutionEnvironmentAPI(ExecutionEnvironment backend)
Get remote DataService API- Parameters:
backend
- Backend specification- Returns:
- API of remote DS
- Throws:
Exception
- If DS not started
-
getExecutionEnvironments
protected Map<ExecutionEnvironmentID,Tuple<DataServiceAPI,ExecutionEnvironment>> getExecutionEnvironments(CommonMessages.Langs lang)
Get DataService APIs for backend with support for a given language.- Parameters:
lang
- The language required.- Returns:
- DataServiceAPIs, the ones compatible with the language
-
getStorageLocations
protected Map<StorageLocationID,Tuple<DataServiceAPI,StorageLocation>> getStorageLocations()
Get DataService APIs for backend with support for a given language.- Returns:
- DataServiceAPIs
-
updateAPIsFromDB
protected void updateAPIsFromDB()
Update APIs for all registered environments/storage locations
-
cleanCachesOfDataService
public void cleanCachesOfDataService(String dsName)
Resume traces in services- Parameters:
dsName
- Name of the data service to be cleaned- Throws:
RemoteException
- if exception occurs
-
checkAlive
public void checkAlive()
Description copied from interface:LogicModuleAPI
Check logic module is alive.- Specified by:
checkAlive
in interfaceLogicModuleAPI
-
publishAddress
public void publishAddress(String thehostname, int theport)
Description copied from interface:LogicModuleAPI
Configure LogicModule to give provided address in case external dataClays require to know how to access current dataClay- Specified by:
publishAddress
in interfaceLogicModuleAPI
- Parameters:
thehostname
- Hostname to be published (given to external dataClays)theport
- Port to be published
-
autoregisterSL
public void autoregisterSL(StorageLocationID id, String dsName, String dsHostname, Integer dsPort)
Description copied from interface:LogicModuleAPI
Register storage location- Specified by:
autoregisterSL
in interfaceLogicModuleAPI
- Parameters:
id
- ID of the storage location to registerdsName
- NamedsHostname
- HostnamedsPort
- Port
-
getStorageLocationID
public StorageLocationID getStorageLocationID(String slName)
Description copied from interface:LogicModuleAPI
Get ID of storage location with name provided- Specified by:
getStorageLocationID
in interfaceLogicModuleAPI
- Parameters:
slName
- Storage Location name- Returns:
- ID of the storage location
-
autoregisterEE
public StorageLocationID autoregisterEE(ExecutionEnvironmentID id, String eeName, String eeHostname, Integer eePort, CommonMessages.Langs language)
Description copied from interface:LogicModuleAPI
Register execution environment- Specified by:
autoregisterEE
in interfaceLogicModuleAPI
- Parameters:
id
- ID of execution environment to registereeName
- NameeeHostname
- HostnameeePort
- Portlanguage
- Language- Returns:
- Storage Location ID associated to EE
-
unregisterStorageLocation
public void unregisterStorageLocation(StorageLocationID stLocID)
Description copied from interface:LogicModuleAPI
Unregister storage location with ID provided- Specified by:
unregisterStorageLocation
in interfaceLogicModuleAPI
- Parameters:
stLocID
- ID storage location to unregister
-
unregisterExecutionEnvironment
public void unregisterExecutionEnvironment(ExecutionEnvironmentID execEnvID)
Description copied from interface:LogicModuleAPI
Unregister execution environment with ID provided- Specified by:
unregisterExecutionEnvironment
in interfaceLogicModuleAPI
- Parameters:
execEnvID
- ID of execution environment to unregister
-
notifyExecutionEnvironmentShutdown
public void notifyExecutionEnvironmentShutdown(ExecutionEnvironmentID execEnvID)
Description copied from interface:LogicModuleAPI
Notify that Execution Environment with ID provided has been shut down.- Specified by:
notifyExecutionEnvironmentShutdown
in interfaceLogicModuleAPI
- Parameters:
execEnvID
- ID of the execution environment shutted down.
-
notifyStorageLocationShutdown
public void notifyStorageLocationShutdown(StorageLocationID stLocID)
Description copied from interface:LogicModuleAPI
Notify that Storage Location with ID provided has been shut down.- Specified by:
notifyStorageLocationShutdown
in interfaceLogicModuleAPI
- Parameters:
stLocID
- ID of the storage location shutted down.
-
existsActiveEnvironmentsForSL
public boolean existsActiveEnvironmentsForSL(StorageLocationID stLocID)
Description copied from interface:LogicModuleAPI
Check if there is an active Execution Environment associated to SL with ID provided.- Specified by:
existsActiveEnvironmentsForSL
in interfaceLogicModuleAPI
- Parameters:
stLocID
- ID of the storage location to check- Returns:
- TRUE if there is an active Execution Environment associated to SL with ID provided. FALSE, otherwise.
-
waitForAllNodesShutdown
public void waitForAllNodesShutdown()
Wait for all registered Storage locations and Execution environments to shut down.
-
performSetOfNewAccounts
public byte[] performSetOfNewAccounts(AccountID adminID, PasswordCredential adminCredential, byte[] yamlFile)
Description copied from interface:LogicModuleAPI
Perform a series of new account creations, described by a YAML parameter.- Specified by:
performSetOfNewAccounts
in interfaceLogicModuleAPI
- Parameters:
adminID
- ID of the account of the user that desires to perform the operations.adminCredential
- Credential of the admin's account.yamlFile
- A YAML file containing all the new users.- Returns:
- A YAML file with the ID for the created users.
-
performSetOfOperations
public byte[] performSetOfOperations(AccountID performerID, PasswordCredential performerCredential, byte[] yamlFile)
Description copied from interface:LogicModuleAPI
Perform a series of operations, described by a YAML parameter.- Specified by:
performSetOfOperations
in interfaceLogicModuleAPI
- Parameters:
performerID
- ID of the account of the user that desires to perform the operations.performerCredential
- Credential of the performer's account.yamlFile
- A YAML file containing all the operations.- Returns:
- A YAML file with the result for all the operations.
-
newAccountNoAdmin
public AccountID newAccountNoAdmin(Account newAccount)
Description copied from interface:LogicModuleAPI
This operation creates a new account in the system without admin credentials.- Specified by:
newAccountNoAdmin
in interfaceLogicModuleAPI
- Parameters:
newAccount
- Specifications of the account to create- Returns:
- AccountID of the new account if the it was successfully created.
-
newAccount
public AccountID newAccount(AccountID adminAccountID, PasswordCredential adminCredential, Account newAccount)
Description copied from interface:LogicModuleAPI
This operation creates a new account in the system with the provided username.- Specified by:
newAccount
in interfaceLogicModuleAPI
- Parameters:
adminAccountID
- ID of the account of the user that calls the operationadminCredential
- Credential of the adminAccount providednewAccount
- Specifications of the account to create- Returns:
- AccountID of the new account if the it was successfully created.
-
getAccountID
public AccountID getAccountID(String accountName)
Description copied from interface:LogicModuleAPI
Method that retrieves the id of an account given its name- Specified by:
getAccountID
in interfaceLogicModuleAPI
- Parameters:
accountName
- the user name of the account- Returns:
- the account id if the operation succeeds. null otherwise.
-
getAccountList
public HashSet<AccountID> getAccountList(AccountID adminAccountID, PasswordCredential adminCredential)
Description copied from interface:LogicModuleAPI
The list of users registered in the system- Specified by:
getAccountList
in interfaceLogicModuleAPI
- Parameters:
adminAccountID
- ID of the account of the user that calls the operationadminCredential
- Credential of the adminAccount provided- Returns:
- the IDs of the users registered in the system.
-
newSession
public SessionInfo newSession(AccountID accountID, PasswordCredential credential, Set<ContractID> contracts, Set<DataSetID> dataSetIDs, DataSetID dataSetForStore, CommonMessages.Langs newsessionLang)
Description copied from interface:LogicModuleAPI
Method that registeres a new session for the given account considering the provided interfaces in contract- Specified by:
newSession
in interfaceLogicModuleAPI
- Parameters:
accountID
- ID of the accountcredential
- credentials for the accountcontracts
- contracts to be considereddataSetIDs
- Accessible datasets for the session (user must have one data contract for each dataset)dataSetForStore
- Dataset for store (dataset must be include among the dataSets)newsessionLang
- language for the sesssion- Returns:
- Information of the new session
-
closeSession
public void closeSession(SessionID sessionID)
Description copied from interface:LogicModuleAPI
Close session.- Specified by:
closeSession
in interfaceLogicModuleAPI
- Parameters:
sessionID
- ID of session to close.
-
getInfoOfSessionForDS
public Tuple<Tuple<DataSetID,Set<DataSetID>>,Calendar> getInfoOfSessionForDS(SessionID sessionID)
Description copied from interface:LogicModuleAPI
Checks provided session and returns visible datasets- Specified by:
getInfoOfSessionForDS
in interfaceLogicModuleAPI
- Parameters:
sessionID
- ID of the session- Returns:
- Visible datasets from this session.
-
newNamespace
public NamespaceID newNamespace(AccountID accountID, PasswordCredential credential, Namespace newNamespace)
Description copied from interface:LogicModuleAPI
Method that creates a new namespace in the system.- Specified by:
newNamespace
in interfaceLogicModuleAPI
- Parameters:
accountID
- the account id of the accountcredential
- the credential of the accountnewNamespace
- Specifications of the new namespace- Returns:
- the id of the new namespace
-
getNamespaces
public Set<String> getNamespaces(AccountID accountID, PasswordCredential credential)
Description copied from interface:LogicModuleAPI
Retrieves the names of the available namespaces- Specified by:
getNamespaces
in interfaceLogicModuleAPI
- Parameters:
accountID
- Requester account idcredential
- Requester credential- Returns:
- set of namespaces names
-
removeNamespace
public void removeNamespace(AccountID accountID, PasswordCredential credential, String namespaceName)
Description copied from interface:LogicModuleAPI
This method removes a namespace from the system by checking it has no active contract associated with it, and no classes registered on it.- Specified by:
removeNamespace
in interfaceLogicModuleAPI
- Parameters:
accountID
- the account id either of the responsible of the namespace or the the admin accountcredential
- the credential of the accountnamespaceName
- the name of the namespace
-
getNamespaceID
public NamespaceID getNamespaceID(AccountID accountID, PasswordCredential credential, String namespaceName)
Description copied from interface:LogicModuleAPI
Retrieves the id of a namespace identified by name provided- Specified by:
getNamespaceID
in interfaceLogicModuleAPI
- Parameters:
accountID
- Requester account idcredential
- Requester credentialnamespaceName
- Name of the namespace- Returns:
- ID of the namespace or NULL if an error happened.
-
getNamespaceLang
public CommonMessages.Langs getNamespaceLang(AccountID accountID, PasswordCredential credential, String namespaceName)
Description copied from interface:LogicModuleAPI
Retrieves the language of a namespace identified by name provided- Specified by:
getNamespaceLang
in interfaceLogicModuleAPI
- Parameters:
accountID
- Requester account idcredential
- Requester credentialnamespaceName
- Name of the namespace- Returns:
- Language of the namespace or NULL if an error happened.
-
importInterface
public void importInterface(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, ContractID contractID, InterfaceID interfaceID)
Description copied from interface:LogicModuleAPI
Imports an interface in contract into a specific namespace- Specified by:
importInterface
in interfaceLogicModuleAPI
- Parameters:
accountID
- the account that performs the actioncredential
- credentials of the accountnamespaceID
- ID of namespace where interface in contract is importedcontractID
- ID of the contractinterfaceID
- ID of the interface
-
importContract
public void importContract(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, ContractID contractID)
Description copied from interface:LogicModuleAPI
Imports the interfaces of the contract into a specific namespace- Specified by:
importContract
in interfaceLogicModuleAPI
- Parameters:
accountID
- the account that performs the actioncredential
- credentials of the accountnamespaceID
- ID of namespace where interface in contract is importedcontractID
- ID of the contract
-
newDataSet
public DataSetID newDataSet(AccountID accountID, PasswordCredential credential, DataSet newDataSet)
Description copied from interface:LogicModuleAPI
Method that creates a new dataset in the system.- Specified by:
newDataSet
in interfaceLogicModuleAPI
- Parameters:
accountID
- the account id of the accountcredential
- the credential of the accountnewDataSet
- Specifications of the dataset to create- Returns:
- the id of the new dataset
-
removeDataSet
public void removeDataSet(AccountID accountID, PasswordCredential credential, String datasetName)
Description copied from interface:LogicModuleAPI
This method removes a dataset from the system by checking it has no active data contract associated with it and no objects registered in it.- Specified by:
removeDataSet
in interfaceLogicModuleAPI
- Parameters:
accountID
- the account id either of the responsible of the dataset or the the admin accountcredential
- the credential of the accountdatasetName
- the name of the dataset
-
getDataSetID
public DataSetID getDataSetID(AccountID accountID, PasswordCredential credential, String datasetName)
Description copied from interface:LogicModuleAPI
Retrieves the id of a dataset identified by name provided- Specified by:
getDataSetID
in interfaceLogicModuleAPI
- Parameters:
accountID
- ID of the account responsible of the given datasetcredential
- Credential of the accountdatasetName
- Name of the dataset- Returns:
- ID of the namespace or NULL if an error happened.
-
checkDataSetIsPublic
public boolean checkDataSetIsPublic(DataSetID datasetID)
Description copied from interface:LogicModuleAPI
Checks whether the dataset is public or not- Specified by:
checkDataSetIsPublic
in interfaceLogicModuleAPI
- Parameters:
datasetID
- ID of the dataset to be chcecked- Returns:
- true if the dataset is public, false otherwise.
-
getPublicDataSets
public Set<String> getPublicDataSets(AccountID accountID, PasswordCredential credential)
Description copied from interface:LogicModuleAPI
Retrieves the publicly available datasets- Specified by:
getPublicDataSets
in interfaceLogicModuleAPI
- Parameters:
accountID
- ID of the accountcredential
- Credential of the account- Returns:
- set of public dataset names
-
getAccountDataSets
public Set<String> getAccountDataSets(AccountID accountID, PasswordCredential credential)
Description copied from interface:LogicModuleAPI
Retrieves the datasets provided by the given account- Specified by:
getAccountDataSets
in interfaceLogicModuleAPI
- Parameters:
accountID
- ID of the accountcredential
- Credential of the account- Returns:
- set of names of account's datasets
-
getObjectDataSetID
public DataSetID getObjectDataSetID(SessionID sessionID, ObjectID oid)
Description copied from interface:LogicModuleAPI
Retrieves the id of a dataset of the object with ID provided.- Specified by:
getObjectDataSetID
in interfaceLogicModuleAPI
- Parameters:
sessionID
- ID of sessionoid
- Object ID- Returns:
- ID of the dataset or NULL if an error happened.
-
newClass
public Map<String,MetaClass> newClass(AccountID accountID, PasswordCredential credential, CommonMessages.Langs language, Map<String,MetaClass> newClasses)
Description copied from interface:LogicModuleAPI
This operation creates a new metaclass in the system with the provided specifications and associate it to the Namespace provided.- Specified by:
newClass
in interfaceLogicModuleAPI
- Parameters:
accountID
- ID of the account of the user that calls the operationcredential
- Credential of the account providedlanguage
- Language of the classes providednewClasses
- Specifications of classes to create- Returns:
- info of the new MetaClass if it was successfully created.
-
registerAndUpdateDependencies
public Map<String,MetaClass> registerAndUpdateDependencies(AccountID accountID, PasswordCredential credentials, CommonMessages.Langs language, Map<String,MetaClass> metaClasses, NamespaceID enrichmentNamespaceID, String enrichedClassName)
This internal operation recursively registers all the required dependencies of a metaClass to be usable.- Parameters:
accountID
- ID of the account of the user that calls the operationcredentials
- Credentials of the account providedlanguage
- Language of the classes providedmetaClasses
- ifications of classes to createenrichmentNamespaceID
- ID of the Namespace of the enrichment (can be NULL)enrichedClassName
- if we are executing the method from en enrichment process, the name of the enriched class- Returns:
- the id or information of the new metaclass if the operation succeeds. null otherwise.
- Throws:
RemoteException
- if some exception occurs
-
removeClass
public void removeClass(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, String className)
Description copied from interface:LogicModuleAPI
Method that removes a class given its name and the name of the namespace where it belongs to- Specified by:
removeClass
in interfaceLogicModuleAPI
- Parameters:
accountID
- ID of the account responsible of the namespace of the classcredential
- Credential of the account responsible of the namespace of the classnamespaceID
- ID of the namespace of the class to removeclassName
- Name of the class to remove
-
removeOperation
public void removeOperation(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, String className, String operationSignature)
Description copied from interface:LogicModuleAPI
Method that removes an operation given its signature- Specified by:
removeOperation
in interfaceLogicModuleAPI
- Parameters:
accountID
- the account of the responsible of the namespacecredential
- the credentials of the accountnamespaceID
- the ID of the namespace of the class of the operationclassName
- the name of the class of the opreationoperationSignature
- the signature of the operation
-
removeImplementation
public void removeImplementation(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, ImplementationID implementationID)
Description copied from interface:LogicModuleAPI
Method that removes an implementation of a certain operation- Specified by:
removeImplementation
in interfaceLogicModuleAPI
- Parameters:
accountID
- the account of the responsible of the namespacecredential
- the credentials of the accountnamespaceID
- ID of the namespace of the implementationimplementationID
- the id of the implementation
-
getOperationID
public OperationID getOperationID(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, String className, String operationSignature)
Description copied from interface:LogicModuleAPI
Method that retrieves the id of an operation given its signature- Specified by:
getOperationID
in interfaceLogicModuleAPI
- Parameters:
accountID
- the account of the responsible of the namespacecredential
- the credentials of the accountnamespaceID
- the id of the namespaceclassName
- the name of the classoperationSignature
- signature of the operation- Returns:
- the operation id if the operation succeeds. null otherwise.
-
getPropertyID
public PropertyID getPropertyID(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, String className, String propertyName)
Description copied from interface:LogicModuleAPI
Method that retrieves the id of a property given its signature- Specified by:
getPropertyID
in interfaceLogicModuleAPI
- Parameters:
accountID
- the account of the responsible of the namespacecredential
- the credentials of the accountnamespaceID
- the id of the namespaceclassName
- the name of the classpropertyName
- the name of the property- Returns:
- the property id if the operation succeeds. null otherwise.
-
getClassID
public MetaClassID getClassID(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, String className)
Description copied from interface:LogicModuleAPI
Method that retrieves the id of a class given its name- Specified by:
getClassID
in interfaceLogicModuleAPI
- Parameters:
accountID
- the account of the responsible of the namespacecredential
- the credentials of the accountnamespaceID
- the id of the namespaceclassName
- the name of the class- Returns:
- the class id if the operation succeeds. null otherwise.
-
getClassInfo
public MetaClass getClassInfo(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, String className)
Description copied from interface:LogicModuleAPI
Method that retrieves the id of a class given its name- Specified by:
getClassInfo
in interfaceLogicModuleAPI
- Parameters:
accountID
- the account of the responsible of the namespacecredential
- the credentials of the accountnamespaceID
- the id of the namespaceclassName
- the name of the class- Returns:
- the class id if the operation succeeds. null otherwise.
-
getInfoOfClassesInNamespace
public Map<MetaClassID,MetaClass> getInfoOfClassesInNamespace(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID)
Description copied from interface:LogicModuleAPI
Method that retrieves the info of the classes registered in specific namespace.- Specified by:
getInfoOfClassesInNamespace
in interfaceLogicModuleAPI
- Parameters:
accountID
- the account of the responsible of the namespacecredential
- the credentials of the accountnamespaceID
- the id of the namespace- Returns:
- The info of the classes registered in the given namespace if the operation succeeds. null otherwise.
-
newContract
public ContractID newContract(AccountID accountID, PasswordCredential credential, Contract newContract)
Description copied from interface:LogicModuleAPI
Method to register a new contract.- Specified by:
newContract
in interfaceLogicModuleAPI
- Parameters:
accountID
- The account of the contract providercredential
- Credential of the accountnewContract
- the specification of the contract (dates, interfaces, etc.)- Returns:
- the contract id if the operation succeeds. null otherwise.
-
registerToPublicContract
public void registerToPublicContract(AccountID accountID, PasswordCredential credential, ContractID contractID)
Description copied from interface:LogicModuleAPI
Method to register an account to a contract- Specified by:
registerToPublicContract
in interfaceLogicModuleAPI
- Parameters:
accountID
- The account of the applicant for the contractcredential
- The credential of the applicant for the contractcontractID
- ID of the contract in which to register.
-
registerToPublicContractOfNamespace
public ContractID registerToPublicContractOfNamespace(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID)
Description copied from interface:LogicModuleAPI
Method to register an account to a public contract given a namespace- Specified by:
registerToPublicContractOfNamespace
in interfaceLogicModuleAPI
- Parameters:
accountID
- The account of the applicant for the contractcredential
- The credential of the applicant for the contractnamespaceID
- ID of the namespace in which to register (in case it provides a public contract)- Returns:
- ID of the public contract associated with the namespace
-
getContractIDsOfProvider
public Map<ContractID,Contract> getContractIDsOfProvider(AccountID accountID, PasswordCredential credential, NamespaceID namespaceIDofProvider)
Description copied from interface:LogicModuleAPI
Method that returns all contract IDs of a namespace (as provider).- Specified by:
getContractIDsOfProvider
in interfaceLogicModuleAPI
- Parameters:
accountID
- ID of the responsible of the namespace.credential
- credentails of the responsible of the namespace.namespaceIDofProvider
- ID of the namespace provider- Returns:
- A list of Contract IDs of the namespace as provider.
-
getContractIDsOfApplicant
public Map<ContractID,Contract> getContractIDsOfApplicant(AccountID applicantAccountID, PasswordCredential credential)
Description copied from interface:LogicModuleAPI
Method that returns all contract IDs of a user (as applicant).- Specified by:
getContractIDsOfApplicant
in interfaceLogicModuleAPI
- Parameters:
applicantAccountID
- Account ID of the user that queries for its contract IDscredential
- Credential of the account- Returns:
- A list of Contract IDs of the account provided.
-
getContractIDsOfApplicantWithProvider
public Map<ContractID,Contract> getContractIDsOfApplicantWithProvider(AccountID applicantAccountID, PasswordCredential credential, NamespaceID namespaceIDofProvider)
Description copied from interface:LogicModuleAPI
Method that returns all contract IDs of a user (as applicant) with the given namespace provider.- Specified by:
getContractIDsOfApplicantWithProvider
in interfaceLogicModuleAPI
- Parameters:
applicantAccountID
- Account ID of the user that queries for its contract IDs.credential
- Credential of the account.namespaceIDofProvider
- ID of the namespace that provides the contracts to be retrieved.- Returns:
- A list of Contract IDs of the specified account with the given namespace provider.
-
newDataContract
public DataContractID newDataContract(AccountID accountID, PasswordCredential credential, DataContract newDataContract)
Description copied from interface:LogicModuleAPI
Creates a new Data Contract- Specified by:
newDataContract
in interfaceLogicModuleAPI
- Parameters:
accountID
- ID of the responsible of the datasetcredential
- credential of the account responsible of datasetnewDataContract
- specifications of the datacontract to create- Returns:
- The id of the new contract if it success, error otherwise.
-
registerToPublicDataContract
public void registerToPublicDataContract(AccountID accountID, PasswordCredential credential, DataContractID datacontractID)
Description copied from interface:LogicModuleAPI
Method that registers a certain account to a public data contract.- Specified by:
registerToPublicDataContract
in interfaceLogicModuleAPI
- Parameters:
accountID
- ID of the account that wants to be registered to the contractcredential
- the credential of the acountdatacontractID
- the ID of the public data contract
-
getDataContractIDsOfProvider
public Map<DataContractID,DataContract> getDataContractIDsOfProvider(AccountID accountID, PasswordCredential credential, DataSetID datasetIDofProvider)
Description copied from interface:LogicModuleAPI
Method that retrieves the data contracts that a dataset provides.- Specified by:
getDataContractIDsOfProvider
in interfaceLogicModuleAPI
- Parameters:
accountID
- ID of a responsible of the data contract (or admin)credential
- credential of the accountdatasetIDofProvider
- ID of the dataset providing the contracts- Returns:
- The set of data contracts provided by the dataset.
-
getDataContractIDsOfApplicant
public Map<DataContractID,DataContract> getDataContractIDsOfApplicant(AccountID applicantAccountID, PasswordCredential credential)
Description copied from interface:LogicModuleAPI
Method that retrieves the data contracts that an account has (as applicant).- Specified by:
getDataContractIDsOfApplicant
in interfaceLogicModuleAPI
- Parameters:
applicantAccountID
- ID of the account to be checkedcredential
- credential of the account- Returns:
- The set of data contracts that the account has applied to.
-
getDataContractInfoOfApplicantWithProvider
public DataContract getDataContractInfoOfApplicantWithProvider(AccountID applicantAccountID, PasswordCredential credential, DataSetID datasetIDofProvider)
Description copied from interface:LogicModuleAPI
Method that retrieves the data contract of an account (as applicant) with a certain dataset.- Specified by:
getDataContractInfoOfApplicantWithProvider
in interfaceLogicModuleAPI
- Parameters:
applicantAccountID
- ID of the account to be checked.credential
- credential of the accountdatasetIDofProvider
- ID of the dataset as provider- Returns:
- the data contract the account has applied to with the given dataset
-
newInterface
public InterfaceID newInterface(AccountID accountID, PasswordCredential credential, Interface newInterface)
Description copied from interface:LogicModuleAPI
Method that registers a new interface- Specified by:
newInterface
in interfaceLogicModuleAPI
- Parameters:
accountID
- the account of the responsible of the namespace of the classcredential
- the credentials of the accountnewInterface
- specifications of interface to create- Returns:
- ID of the new interface created or NULL if it failed.
-
getInterfaceInfo
public Interface getInterfaceInfo(AccountID accountID, PasswordCredential credential, InterfaceID interfaceID)
Description copied from interface:LogicModuleAPI
Method that retrieves the info of the interface if the account is registered in a contract that contains it- Specified by:
getInterfaceInfo
in interfaceLogicModuleAPI
- Parameters:
accountID
- ID of the account registered in a contract with the interface presentcredential
- the credential of the accountinterfaceID
- the ID of the interface to be retrieved- Returns:
- info of the interface
-
removeInterface
public void removeInterface(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, InterfaceID interfaceID)
Description copied from interface:LogicModuleAPI
Method that removes a specific interface- Specified by:
removeInterface
in interfaceLogicModuleAPI
- Parameters:
accountID
- the account of the responsible of the namespace of the interfacecredential
- the credentials of the acountnamespaceID
- ID of the namespace of the interfaceinterfaceID
- the id of the interface to be removed
-
registerObjects
public List<ObjectID> registerObjects(List<RegistrationInfo> regInfos, ExecutionEnvironmentID backendID, CommonMessages.Langs lang)
Description copied from interface:LogicModuleAPI
Register objects in MDS- Specified by:
registerObjects
in interfaceLogicModuleAPI
- Parameters:
regInfos
- Registration infosbackendID
- ID of the backend in which the object is storedlang
- Language
-
unregisterObjects
public void unregisterObjects(Set<ObjectID> objectsToUnregister)
Description copied from interface:LogicModuleAPI
Unregister objects (called from GlobalGC)- Specified by:
unregisterObjects
in interfaceLogicModuleAPI
- Parameters:
objectsToUnregister
- Objects to unregister
-
registerObjectFromGC
public void registerObjectFromGC(RegistrationInfo regInfo, ExecutionEnvironmentID backendID, DataServiceRuntime clientLib)
Description copied from interface:LogicModuleAPI
Register objects in MDS- Specified by:
registerObjectFromGC
in interfaceLogicModuleAPI
- Parameters:
regInfo
- Registration infobackendID
- ID of the backend in which the objects were storedclientLib
- DataService objects Map to be modified since this call is ASYNCHRONOUS. Thus, modified by GRPC (see Logic module grpc client)
-
getAllExecutionEnvironmentsInfo
public Map<ExecutionEnvironmentID,ExecutionEnvironment> getAllExecutionEnvironmentsInfo(CommonMessages.Langs execEnvLang, boolean getExternal, boolean fromBackend)
Description copied from interface:LogicModuleAPI
Method that retrieves the info of all the registered backends- Specified by:
getAllExecutionEnvironmentsInfo
in interfaceLogicModuleAPI
- Parameters:
execEnvLang
- Language of execution environments to get information ofgetExternal
- Indicates if external execution environments must be also obtainedfromBackend
- Indicates request was done from backend (dsjava, dspython) i.e. do not use exposed IP.- Returns:
- the info of the registered Storage Locations in a table indexed by their IDs
-
getStorageLocationInfo
public StorageLocation getStorageLocationInfo(StorageLocationID backendID, boolean fromBackend)
Description copied from interface:LogicModuleAPI
Retrieves the backend specification- Specified by:
getStorageLocationInfo
in interfaceLogicModuleAPI
- Parameters:
backendID
- ID of the backendfromBackend
- Indicates request was done from backend (dsjava, dspython) i.e. do not use exposed IP.- Returns:
- the specification of the backend
-
getExecutionEnvironmentInfo
public ExecutionEnvironment getExecutionEnvironmentInfo(ExecutionEnvironmentID backendID, boolean fromBackend)
Description copied from interface:LogicModuleAPI
Retrieves the backend specification- Specified by:
getExecutionEnvironmentInfo
in interfaceLogicModuleAPI
- Parameters:
backendID
- ID of the backendfromBackend
- Indicates request was done from backend (dsjava, dspython) i.e. do not use exposed IP.- Returns:
- the specification of the backend
-
getObjectInfo
public Tuple<String,String> getObjectInfo(SessionID sessionID, ObjectID objectID)
Description copied from interface:LogicModuleAPI
Method to check whether an object is accessible with the specified session and returns its classname and namespace of the class.- Specified by:
getObjectInfo
in interfaceLogicModuleAPI
- Parameters:
sessionID
- ID of the sessionobjectID
- ID of object- Returns:
- a tuple [class name, namespace] containing the class of the object, and the namespace of the class.
-
getObjectFromAlias
public Triple<ObjectID,MetaClassID,ExecutionEnvironmentID> getObjectFromAlias(SessionID sessionID, String alias)
Description copied from interface:LogicModuleAPI
Retrieves the objectID corresponding to the object with the specified alias.- Specified by:
getObjectFromAlias
in interfaceLogicModuleAPI
- Parameters:
sessionID
- ID of the sessionalias
- alias of the object- Returns:
- ID of the resulting object, class ID, and Hint for fast execution.
-
deleteAlias
public ObjectID deleteAlias(SessionID sessionID, String alias)
Description copied from interface:LogicModuleAPI
Removes the alias of an object- Specified by:
deleteAlias
in interfaceLogicModuleAPI
- Parameters:
sessionID
- ID of the sessionalias
- alias of the object- Returns:
- ID of object with deleted alias
-
getObjectsMetaDataInfoOfClassForNM
public Map<ObjectID,MetaDataInfo> getObjectsMetaDataInfoOfClassForNM(MetaClassID classID)
Description copied from interface:LogicModuleAPI
Retrieves the information of the objects instantiating the given class.- Specified by:
getObjectsMetaDataInfoOfClassForNM
in interfaceLogicModuleAPI
- Parameters:
classID
- the id of the class- Returns:
- the information of the objects of the class indexed by Object ID
-
getDataClayID
public DataClayInstanceID getDataClayID()
Description copied from interface:LogicModuleAPI
Method that retrieves the ID of current dataClay instance- Specified by:
getDataClayID
in interfaceLogicModuleAPI
- Returns:
- ID of current dataclay
-
getExternalDataClayID
public DataClayInstanceID getExternalDataClayID(String dcHost, int dcPort)
Description copied from interface:LogicModuleAPI
Tries to connect to an external dataClay instance and retrieve its ID. *- Specified by:
getExternalDataClayID
in interfaceLogicModuleAPI
- Parameters:
dcHost
- hostname of the external dataClay instancedcPort
- port of the external dataClay instance- Returns:
- id of the external dataClay instance
-
getExternalDataClayInfo
public DataClayInstance getExternalDataClayInfo(DataClayInstanceID extDataClayID)
Description copied from interface:LogicModuleAPI
Method that retrieves the info of an external dataClay instance- Specified by:
getExternalDataClayInfo
in interfaceLogicModuleAPI
- Parameters:
extDataClayID
- id of the external (already registered) dataClay- Returns:
- info of dataClay instance identified by specified ID. null if it is not registered in the system.
-
registerExternalDataClay
public DataClayInstanceID registerExternalDataClay(String thehostname, int theport)
Description copied from interface:LogicModuleAPI
Method that tries to register an external instance of dataClay assigning a new ID to it. If if is already registered, method is ignored.- Specified by:
registerExternalDataClay
in interfaceLogicModuleAPI
- Parameters:
thehostname
- host name of the main service of the external dataClay instance.theport
- port of the external main service of the dataClay instance- Returns:
- ID of dataClay registered.
-
registerExternalDataClayOverrideAuthority
public DataClayInstanceID registerExternalDataClayOverrideAuthority(AccountID adminAccountID, PasswordCredential adminCredential, String thehostname, int theport, String authority)
Description copied from interface:LogicModuleAPI
For system-admin users only. Method that registers an external dataclay overriding authority specified.- Specified by:
registerExternalDataClayOverrideAuthority
in interfaceLogicModuleAPI
- Parameters:
adminAccountID
- Admin account iDadminCredential
- Admin credentialsthehostname
- Hostnametheport
- Portauthority
- Authority- Returns:
- ID of the dataClay registered
-
notifyRegistrationOfExternalDataClay
public DataClayInstanceID notifyRegistrationOfExternalDataClay(DataClayInstanceID dataClayInstanceID, String thehostname, int theport)
Description copied from interface:LogicModuleAPI
When you register an external DataClay, we notify external dataClay about the registration and we get the ID of the external dataClay. Destination dataClay then, is aware of all dataClays 'connected' to him.- Specified by:
notifyRegistrationOfExternalDataClay
in interfaceLogicModuleAPI
- Parameters:
dataClayInstanceID
- ID of dataClay registering current dataClay as externalthehostname
- Host nametheport
- Port- Returns:
- ID of current dataClay or Null if not allowed or some error ocurred
-
getClassesInNamespace
public Tuple<Namespace,Set<MetaClass>> getClassesInNamespace(String namespaceName)
Description copied from interface:LogicModuleAPI
Get all classes from namespace with name provided in current dataClay.- Specified by:
getClassesInNamespace
in interfaceLogicModuleAPI
- Parameters:
namespaceName
- Name of the namespace to get data from- Returns:
- Namespace information, information of all classes registered in namespace and code of classes to deploy
-
importModelsFromExternalDataClay
public void importModelsFromExternalDataClay(String extNamespaceName, DataClayInstanceID extDataClayID)
Description copied from interface:LogicModuleAPI
Import classes in namespace from external dataClay provided- Specified by:
importModelsFromExternalDataClay
in interfaceLogicModuleAPI
- Parameters:
extNamespaceName
- Name of the external namespace to getextDataClayID
- External dataClay ID to get namespace/classes from
-
setDataSetID
public void setDataSetID(SessionID sessionID, ObjectID objectID, DataSetID dataSetID)
Description copied from interface:LogicModuleAPI
Set dataset id of object- Specified by:
setDataSetID
in interfaceLogicModuleAPI
- Parameters:
sessionID
- ID of sessionobjectID
- ID of objectdataSetID
- ID of dataset
-
setDataSetIDFromGarbageCollector
public void setDataSetIDFromGarbageCollector(ObjectID objectID, DataSetID dataSetID)
Description copied from interface:LogicModuleAPI
Set DataSetID from GC- Specified by:
setDataSetIDFromGarbageCollector
in interfaceLogicModuleAPI
- Parameters:
objectID
- ID of the objectdataSetID
- ID of the dataset
-
moveObject
public List<ObjectID> moveObject(SessionID sessionID, ObjectID objectID, ExecutionEnvironmentID srcLocationID, ExecutionEnvironmentID destLocationID, boolean recursive)
Description copied from interface:LogicModuleAPI
Method that moves an object from location to location.- Specified by:
moveObject
in interfaceLogicModuleAPI
- Parameters:
sessionID
- ID of the sessionobjectID
- ID of the objectsrcLocationID
- ID of the source locationdestLocationID
- ID of the destination locationrecursive
- Indicates if sub-objects (int the src location or others) must be also moved or not.- Returns:
- List of moved objects.
-
setObjectReadOnly
public void setObjectReadOnly(SessionID sessionID, ObjectID objectID)
Description copied from interface:LogicModuleAPI
Method that sets the object as read only- Specified by:
setObjectReadOnly
in interfaceLogicModuleAPI
- Parameters:
sessionID
- ID of the sessionobjectID
- ID of the object
-
setObjectReadWrite
public void setObjectReadWrite(SessionID sessionID, ObjectID objectID)
Description copied from interface:LogicModuleAPI
Method that sets the object as read-write- Specified by:
setObjectReadWrite
in interfaceLogicModuleAPI
- Parameters:
sessionID
- ID of the sessionobjectID
- ID of the object
-
getMetadataByOID
public MetaDataInfo getMetadataByOID(SessionID sessionID, ObjectID objectID)
Description copied from interface:LogicModuleAPI
Method that retrieves the locations of all the replicas of a specific object and its classname.- Specified by:
getMetadataByOID
in interfaceLogicModuleAPI
- Parameters:
sessionID
- ID of the sessionobjectID
- ID of the object- Returns:
- MetaDataInfo of the object
-
getMetadataByOIDForDS
public MetaDataInfo getMetadataByOIDForDS(ObjectID objectID)
Description copied from interface:LogicModuleAPI
Get metadata by oid. TODO: functions without session ids (garbage collector for isntance) should be used in different way (dgasull)- Specified by:
getMetadataByOIDForDS
in interfaceLogicModuleAPI
- Parameters:
objectID
- Object ID- Returns:
- Metadata info for EE.
-
executeMethodOnTarget
public SerializedParametersOrReturn executeMethodOnTarget(SessionID sessionID, ObjectID objectID, String operationSignature, SerializedParametersOrReturn params, ExecutionEnvironmentID backendID)
Description copied from interface:LogicModuleAPI
Method that executes a method on a specific target (using an arbitrary implementation given the session info).- Specified by:
executeMethodOnTarget
in interfaceLogicModuleAPI
- Parameters:
sessionID
- ID of the session.objectID
- ID of the object on which the implementation is executedoperationSignature
- the operation signature of the method to be executedparams
- the serialized parameters for the methodbackendID
- the backend where the method must be executed- Returns:
- Result of the operation (all objects serialized) or null if void.
-
executeImplementation
public SerializedParametersOrReturn executeImplementation(SessionID sessionID, OperationID operationID, Triple<ImplementationID,ContractID,InterfaceID> remoteImplementation, ObjectID objectID, SerializedParametersOrReturn params)
Description copied from interface:LogicModuleAPI
Method that executes an implementation- Specified by:
executeImplementation
in interfaceLogicModuleAPI
- Parameters:
sessionID
- ID of the sessionoperationID
- the operation to be executedremoteImplementation
- info of the implementation to be executedobjectID
- the object on which the implementation is executedparams
- the serialized parameters for the operation- Returns:
- Result of the operation (all objects serialized) or null if void.
-
executeNotificationAction
public void executeNotificationAction(ObjectID objectID, SessionID sessionID, SerializedParametersOrReturn params, OperationID opID)
Method that executes an action in a certain object. This method is called from notification manager. Note that executions from this method have NO session.- Parameters:
objectID
- ID of the objectsessionID
- ID of the session of who triggered actionparams
- the serialized parameters for the operationopID
- id of the operation to be executed
-
executeFilterMethod
public boolean executeFilterMethod(ObjectID objectID, SessionID sessionID, SerializedParametersOrReturn params, OperationID opID)
Method that executes a filterMethod in a certain object without parameters. This method is called from notification manager. Note that executions from this method have NO session.- Parameters:
objectID
- ID of the objectsessionID
- ID of the session of who triggered actionparams
- the serialized parameters for the operationopID
- id of the operation to be executed- Returns:
- a boolean value with the result of the execution of the implementation (all of them, separately)
-
isPrefetchingEnabled
public boolean isPrefetchingEnabled()
Description copied from interface:LogicModuleAPI
Indicates if dataClay has prefetching enabled.- Specified by:
isPrefetchingEnabled
in interfaceLogicModuleAPI
- Returns:
- TRUE if prefetching is enabled in dataClay. FALSE otherwise.
-
objectExistsInDataClay
public boolean objectExistsInDataClay(ObjectID objectID)
Description copied from interface:LogicModuleAPI
Check if object exists in dataClay (in any EE memory or SL)- Specified by:
objectExistsInDataClay
in interfaceLogicModuleAPI
- Parameters:
objectID
- ID of the object to check- Returns:
- TRUE if the object exists. FALSE otherwise.
-
getNumObjects
public int getNumObjects()
Description copied from interface:LogicModuleAPI
Get number of objects in dataClay- Specified by:
getNumObjects
in interfaceLogicModuleAPI
- Returns:
- number of objects in dataClay
-
getOwner
public AccountID getOwner(ObjectID objectID)
Get owner of the object- Parameters:
objectID
- ID of the object- Returns:
- Owner of the object
-
initializeSessionAsOwnerOfObject
public SessionID initializeSessionAsOwnerOfObject(AccountID ownerID)
Initialize session of owner's object.- Parameters:
ownerID
- ID of the owner.- Returns:
- Session ID
-
getStubs
public Map<String,byte[]> getStubs(AccountID applicantAccountID, PasswordCredential applicantCredential, CommonMessages.Langs language, List<ContractID> contractsIDs)
Description copied from interface:LogicModuleAPI
Method that allows to retrieve the stubs of the given contracts (merging interfaces if necessary)- Specified by:
getStubs
in interfaceLogicModuleAPI
- Parameters:
applicantAccountID
- the applicant of the contractapplicantCredential
- the credentials of the applicantlanguage
- the language of the stub to generatecontractsIDs
- IDs of the contracts- Returns:
- a Map of byte arrays with bytecode (or similar) for each stub
-
getBabelStubs
public byte[] getBabelStubs(AccountID applicantAccountID, PasswordCredential applicantCredential, List<ContractID> contractsIDs)
Description copied from interface:LogicModuleAPI
Method that allows to retrieve the "Babel" (language independent YAML-based) stubs of the given contracts (merging interfaces if necessary).- Specified by:
getBabelStubs
in interfaceLogicModuleAPI
- Parameters:
applicantAccountID
- the applicant of the contractapplicantCredential
- the credentials of the applicantcontractsIDs
- IDs of the contracts- Returns:
- a byte array with a YAML document, with each
-
getClassNameForDS
public String getClassNameForDS(MetaClassID classID)
Description copied from interface:LogicModuleAPI
Get class name for Data Service- Specified by:
getClassNameForDS
in interfaceLogicModuleAPI
- Parameters:
classID
- ID of the class- Returns:
- Name of the class
-
getClassNameAndNamespaceForDS
public Tuple<String,String> getClassNameAndNamespaceForDS(MetaClassID classID)
Description copied from interface:LogicModuleAPI
Get class name and namespace name for Data Service- Specified by:
getClassNameAndNamespaceForDS
in interfaceLogicModuleAPI
- Parameters:
classID
- ID of the class- Returns:
- Class name and namespace name of the class
-
registerEventListenerImplementation
public void registerEventListenerImplementation(AccountID accountID, PasswordCredential credential, ECA newEventListener)
Description copied from interface:LogicModuleAPI
Registers an event listener implementation- Specified by:
registerEventListenerImplementation
in interfaceLogicModuleAPI
- Parameters:
accountID
- ID of account registering the event listenercredential
- Credentials of the accountnewEventListener
- Event listener implementation to register.
-
adviseEvent
public void adviseEvent(EventMessage newEvent)
Description copied from interface:LogicModuleAPI
Advises Notification Manager new event has occurred.- Specified by:
adviseEvent
in interfaceLogicModuleAPI
- Parameters:
newEvent
- New event
-
getMetaDataSrvApi
public MetaDataService getMetaDataSrvApi()
- Returns:
- the metaDataSrvApi
-
activateTracing
public void activateTracing(int currentAvailableTaskID)
Description copied from interface:LogicModuleAPI
Activate tracing.- Specified by:
activateTracing
in interfaceLogicModuleAPI
- Parameters:
currentAvailableTaskID
- Current starting task ID in Extrae
-
deactivateTracing
public void deactivateTracing()
Description copied from interface:LogicModuleAPI
Deactivate Extrae tracing- Specified by:
deactivateTracing
in interfaceLogicModuleAPI
-
cleanMetaDataCaches
public void cleanMetaDataCaches()
Description copied from interface:LogicModuleAPI
Clean MD caches- Specified by:
cleanMetaDataCaches
in interfaceLogicModuleAPI
-
getTraces
public Map<String,byte[]> getTraces()
Description copied from interface:LogicModuleAPI
Get Extrae traces (mpits and set files)- Specified by:
getTraces
in interfaceLogicModuleAPI
- Returns:
- Extrae traces (mpits and set files)
-
waitAndProcessAllAsyncRequests
public void waitAndProcessAllAsyncRequests()
Wait for all asynchronous request to finish.
-
closeManagerDb
public void closeManagerDb()
Description copied from interface:LogicModuleAPI
Close mgr db.- Specified by:
closeManagerDb
in interfaceLogicModuleAPI
-
finishCacheThreads
public void finishCacheThreads()
Finish cache threads.
-
closeDb
public void closeDb()
Description copied from interface:LogicModuleAPI
Close logic db.- Specified by:
closeDb
in interfaceLogicModuleAPI
-
getAccountManagerDB
public AccountManagerDB getAccountManagerDB()
Get manager db. For testing purposes.- Returns:
- Manager db.
-
getClassManagerDB
public ClassManagerDB getClassManagerDB()
Get manager db. For testing purposes.- Returns:
- Manager db.
-
getContractManagerDB
public ContractManagerDB getContractManagerDB()
Get manager db. For testing purposes.- Returns:
- Manager db.
-
getDataContractManagerDB
public DataContractManagerDB getDataContractManagerDB()
Get manager db. For testing purposes.- Returns:
- Manager db.
-
getDataSetManagerDB
public DataSetManagerDB getDataSetManagerDB()
Get manager db. For testing purposes.- Returns:
- Manager db.
-
getNamespaceManagerDB
public NamespaceManagerDB getNamespaceManagerDB()
Get manager db. For testing purposes.- Returns:
- Manager db.
-
getInterfaceManagerDB
public InterfaceManagerDB getInterfaceManagerDB()
Get manager db. For testing purposes.- Returns:
- Manager db.
-
getNotificationManagerDB
public NotificationManagerDB getNotificationManagerDB()
Get manager db. For testing purposes.- Returns:
- Manager db.
-
getSessionManagerDB
public SessionManagerDB getSessionManagerDB()
Get manager db. For testing purposes.- Returns:
- Manager db.
-
getMetaDataServiceDb
public MetaDataServiceDB getMetaDataServiceDb()
Get logic db. For testing purposes.- Returns:
- metadataservice db.
-
getClassManager
public ClassManager getClassManager()
Get Class manager (for testing purposes)- Returns:
- ClassManager of this logicModule
-
getContractIDOfDataClayProvider
public ContractID getContractIDOfDataClayProvider(AccountID accountID, PasswordCredential credential)
Description copied from interface:LogicModuleAPI
Get contract ID of DataClay classes- Specified by:
getContractIDOfDataClayProvider
in interfaceLogicModuleAPI
- Parameters:
accountID
- ID of the account queryingcredential
- Credentials- Returns:
- Contract ID of DataClay provider
-
isShuttingDown
public boolean isShuttingDown()
- Returns:
- the shuttingDown
-
setShuttingDown
public void setShuttingDown(boolean theshuttingDown)
- Parameters:
theshuttingDown
- the shuttingDown to set
-
-