Class LogicModuleGrpcClient
- java.lang.Object
-
- es.bsc.dataclay.communication.grpc.clients.logicmodule.LogicModuleGrpcClient
-
- All Implemented Interfaces:
LogicModuleAPI
public final class LogicModuleGrpcClient extends Object implements LogicModuleAPI
Client code that makes gRPC calls to the server.
-
-
Field Summary
Fields Modifier and Type Field Description protected static boolean
DEBUG_ENABLED
Indicates if debug is enabled.
-
Constructor Summary
Constructors Constructor Description LogicModuleGrpcClient(String host, int port)
Construct client for accessing LogicModule server athost:port
.
-
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 dsTCPPort)
Register storage locationvoid
checkAlive()
Check logic module is alive.boolean
checkDataSetIsPublic(DataSetID dataSetID)
Checks whether the dataset is public or notvoid
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 objectSerializedParametersOrReturn
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).boolean
existsActiveEnvironmentsForSL(StorageLocationID stLocID)
Check if there is an active Execution Environment associated to SL with ID provided.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 nameSet<AccountID>
getAccountList(AccountID adminAccountID, PasswordCredential adminCredential)
The list of users registered in the systemMap<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 nameTuple<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).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.DataSetID
getDataSetID(AccountID accountID, PasswordCredential credential, String datasetName)
Retrieves the id of a dataset identified by name providedExecutionEnvironment
getExecutionEnvironmentInfo(ExecutionEnvironmentID backendID, boolean fromBackend)
Retrieves the backend specificationDataClayInstanceID
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 itMetaDataInfo
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.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 providedSet<String>
getNamespaces(AccountID accountID, PasswordCredential credential)
Retrieves the names of the available namespacesint
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.HashMap<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 signaturePropertyID
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 datasetsStorageLocationID
getStorageLocationID(String slName)
Get ID of storage location with name providedStorageLocation
getStorageLocationInfo(StorageLocationID backendID, boolean fromBackend)
Retrieves the backend specificationMap<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 providedboolean
isPrefetchingEnabled()
Indicates if dataClay has prefetching enabled.List<ObjectID>
moveObject(SessionID sessionID, ObjectID objectID, ExecutionEnvironmentID srcBackendID, ExecutionEnvironmentID destBackendID, 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 dataset)
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 hostname, int port)
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 hostname, int port)
Configure LogicModule to give provided address in case external dataClays require to know how to access current dataClayvoid
registerEventListenerImplementation(AccountID accountID, PasswordCredential credential, ECA newEventListener)
Registers an event listener implementationDataClayInstanceID
registerExternalDataClay(String hostname, int port)
Method that tries to register an external instance of dataClay assigning a new ID to it.DataClayInstanceID
registerExternalDataClayOverrideAuthority(AccountID adminAccountID, PasswordCredential adminCredential, String hostname, int port, 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
shutdown()
Shutdown clientvoid
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 providedvoid
waitAndProcessAllAsyncRequests()
Wait all async.
-
-
-
Constructor Detail
-
LogicModuleGrpcClient
public LogicModuleGrpcClient(String host, int port)
Construct client for accessing LogicModule server athost:port
.- Parameters:
host
- Hostport
- Port
-
-
Method Detail
-
shutdown
public void shutdown() throws InterruptedException
Shutdown client- Throws:
InterruptedException
- if some exception occurs
-
checkAlive
public void checkAlive()
Description copied from interface:LogicModuleAPI
Check logic module is alive.- Specified by:
checkAlive
in interfaceLogicModuleAPI
-
autoregisterSL
public void autoregisterSL(StorageLocationID id, String dsName, String dsHostname, Integer dsTCPPort)
Description copied from interface:LogicModuleAPI
Register storage location- Specified by:
autoregisterSL
in interfaceLogicModuleAPI
- Parameters:
id
- ID of the storage location to registerdsName
- NamedsHostname
- HostnamedsTCPPort
- Port
-
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
-
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 Set<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
-
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
-
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
-
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.
-
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.
-
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 dataset)
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 accountdataset
- 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
-
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.
-
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
-
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.
-
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.
-
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
-
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
-
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
-
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.
-
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
-
registerExternalDataClay
public DataClayInstanceID registerExternalDataClay(String hostname, int port)
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:
hostname
- host name of the main service of the external dataClay instance.port
- port of the external main service of the dataClay instance- Returns:
- ID of dataClay registered.
-
registerExternalDataClayOverrideAuthority
public DataClayInstanceID registerExternalDataClayOverrideAuthority(AccountID adminAccountID, PasswordCredential adminCredential, String hostname, int port, 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 credentialshostname
- Hostnameport
- Portauthority
- Authority- Returns:
- ID of the dataClay registered
-
notifyRegistrationOfExternalDataClay
public DataClayInstanceID notifyRegistrationOfExternalDataClay(DataClayInstanceID dataClayInstanceID, String hostname, int port)
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 externalhostname
- Host nameport
- Port- Returns:
- ID of current dataClay or Null if not allowed or some error ocurred
-
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)
-
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
-
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
-
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
-
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
-
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 HashMap<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
-
moveObject
public List<ObjectID> moveObject(SessionID sessionID, ObjectID objectID, ExecutionEnvironmentID srcBackendID, ExecutionEnvironmentID destBackendID, 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 objectsrcBackendID
- ID of the source locationdestBackendID
- 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
-
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.
-
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.
-
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.
-
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.
-
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
-
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
-
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)
-
cleanMetaDataCaches
public void cleanMetaDataCaches()
Description copied from interface:LogicModuleAPI
Clean MD caches- Specified by:
cleanMetaDataCaches
in interfaceLogicModuleAPI
-
closeManagerDb
public void closeManagerDb()
Description copied from interface:LogicModuleAPI
Close mgr db.- Specified by:
closeManagerDb
in interfaceLogicModuleAPI
-
closeDb
public void closeDb()
Description copied from interface:LogicModuleAPI
Close logic db.- Specified by:
closeDb
in interfaceLogicModuleAPI
-
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
-
waitAndProcessAllAsyncRequests
public void waitAndProcessAllAsyncRequests()
Wait all async. requests
-
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
-
publishAddress
public void publishAddress(String hostname, int port)
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:
hostname
- Hostname to be published (given to external dataClays)port
- Port to be published
-
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
-
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
-
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.
-
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
-
-