Package es.bsc.dataclay.logic.api
Interface LogicModuleAPI
-
- All Known Implementing Classes:
LogicModule
,LogicModuleGrpcClient
public interface LogicModuleAPI
This interface define the methods of the Logic Module that can be executed remotely.
-
-
Method Summary
All Methods Instance Methods Abstract 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
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 exeEnvLang, 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.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 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
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 provided
-
-
-
Method Detail
-
autoregisterSL
void autoregisterSL(StorageLocationID id, String dsName, String dsHostname, Integer dsPort)
Register storage location- Parameters:
id
- ID of the storage location to registerdsName
- NamedsHostname
- HostnamedsPort
- Port
-
getStorageLocationID
StorageLocationID getStorageLocationID(String slName)
Get ID of storage location with name provided- Parameters:
slName
- Storage Location name- Returns:
- ID of the storage location
-
autoregisterEE
StorageLocationID autoregisterEE(ExecutionEnvironmentID id, String eeName, String eeHostname, Integer eePort, CommonMessages.Langs language)
Register execution environment- Parameters:
id
- ID of execution environment to registereeName
- NameeeHostname
- HostnameeePort
- Portlanguage
- Language- Returns:
- Storage Location ID associated to EE
-
unregisterStorageLocation
void unregisterStorageLocation(StorageLocationID stLocID)
Unregister storage location with ID provided- Parameters:
stLocID
- ID storage location to unregister
-
unregisterExecutionEnvironment
void unregisterExecutionEnvironment(ExecutionEnvironmentID execEnvID)
Unregister execution environment with ID provided- Parameters:
execEnvID
- ID of execution environment to unregister
-
notifyExecutionEnvironmentShutdown
void notifyExecutionEnvironmentShutdown(ExecutionEnvironmentID execEnvID)
Notify that Execution Environment with ID provided has been shut down.- Parameters:
execEnvID
- ID of the execution environment shutted down.
-
notifyStorageLocationShutdown
void notifyStorageLocationShutdown(StorageLocationID stLocID)
Notify that Storage Location with ID provided has been shut down.- Parameters:
stLocID
- ID of the storage location shutted down.
-
existsActiveEnvironmentsForSL
boolean existsActiveEnvironmentsForSL(StorageLocationID stLocID)
Check if there is an active Execution Environment associated to SL with ID provided.- 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.
-
checkAlive
void checkAlive()
Check logic module is alive.
-
publishAddress
void publishAddress(String hostname, int port)
Configure LogicModule to give provided address in case external dataClays require to know how to access current dataClay- Parameters:
hostname
- Hostname to be published (given to external dataClays)port
- Port to be published
-
performSetOfNewAccounts
byte[] performSetOfNewAccounts(AccountID adminID, PasswordCredential adminCredential, byte[] yamlFile)
Perform a series of new account creations, described by a YAML parameter.- 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
byte[] performSetOfOperations(AccountID performerID, PasswordCredential performerCredential, byte[] yamlFile)
Perform a series of operations, described by a YAML parameter.- 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
AccountID newAccountNoAdmin(Account newAccount)
This operation creates a new account in the system without admin credentials.- Parameters:
newAccount
- Specifications of the account to create- Returns:
- AccountID of the new account if the it was successfully created.
-
newAccount
AccountID newAccount(AccountID adminAccountID, PasswordCredential adminCredential, Account newAccount)
This operation creates a new account in the system with the provided username.- 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
AccountID getAccountID(String accountName)
Method that retrieves the id of an account given its name- Parameters:
accountName
- the user name of the account- Returns:
- the account id if the operation succeeds. null otherwise.
-
getAccountList
Set<AccountID> getAccountList(AccountID adminAccountID, PasswordCredential adminCredential)
The list of users registered in the system- 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
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 contract- 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
void closeSession(SessionID sessionID)
Close session.- Parameters:
sessionID
- ID of session to close.
-
getInfoOfSessionForDS
Tuple<Tuple<DataSetID,Set<DataSetID>>,Calendar> getInfoOfSessionForDS(SessionID sessionID)
Checks provided session and returns visible datasets- Parameters:
sessionID
- ID of the session- Returns:
- Visible datasets from this session.
-
newNamespace
NamespaceID newNamespace(AccountID accountID, PasswordCredential credential, Namespace newNamespace)
Method that creates a new namespace in the system.- 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
void 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.- 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
NamespaceID getNamespaceID(AccountID accountID, PasswordCredential credential, String namespaceName)
Retrieves the id of a namespace identified by name provided- Parameters:
accountID
- Requester account idcredential
- Requester credentialnamespaceName
- Name of the namespace- Returns:
- ID of the namespace or NULL if an error happened.
-
getNamespaces
Set<String> getNamespaces(AccountID accountID, PasswordCredential credential)
Retrieves the names of the available namespaces- Parameters:
accountID
- Requester account idcredential
- Requester credential- Returns:
- set of namespaces names
-
getNamespaceLang
CommonMessages.Langs getNamespaceLang(AccountID accountID, PasswordCredential credential, String namespaceName)
Retrieves the language of a namespace identified by name provided- Parameters:
accountID
- Requester account idcredential
- Requester credentialnamespaceName
- Name of the namespace- Returns:
- Language of the namespace or NULL if an error happened.
-
getObjectDataSetID
DataSetID getObjectDataSetID(SessionID sessionID, ObjectID oid)
Retrieves the id of a dataset of the object with ID provided.- Parameters:
sessionID
- ID of sessionoid
- Object ID- Returns:
- ID of the dataset or NULL if an error happened.
- Throws:
Exception
- if an exception occurs.
-
importInterface
void importInterface(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, ContractID contractID, InterfaceID interfaceID)
Imports an interface in contract into a specific namespace- 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
void importContract(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, ContractID contractID)
Imports the interfaces of the contract into a specific namespace- 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
DataSetID newDataSet(AccountID accountID, PasswordCredential credential, DataSet dataset)
Method that creates a new dataset in the system.- 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
void 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.- 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
DataSetID getDataSetID(AccountID accountID, PasswordCredential credential, String datasetName)
Retrieves the id of a dataset identified by name provided- 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
boolean checkDataSetIsPublic(DataSetID dataSetID)
Checks whether the dataset is public or not- Parameters:
dataSetID
- ID of the dataset to be chcecked- Returns:
- true if the dataset is public, false otherwise.
-
getPublicDataSets
Set<String> getPublicDataSets(AccountID accountID, PasswordCredential credential)
Retrieves the publicly available datasets- Parameters:
accountID
- ID of the accountcredential
- Credential of the account- Returns:
- set of public dataset names
-
getAccountDataSets
Set<String> getAccountDataSets(AccountID accountID, PasswordCredential credential)
Retrieves the datasets provided by the given account- Parameters:
accountID
- ID of the accountcredential
- Credential of the account- Returns:
- set of names of account's datasets
-
newClass
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.- 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
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 to- 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
void removeOperation(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, String className, String operationSignature)
Method that removes an operation given its signature- 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
void removeImplementation(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, ImplementationID implementationID)
Method that removes an implementation of a certain operation- 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
OperationID getOperationID(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, String className, String operationSignature)
Method that retrieves the id of an operation given its signature- 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
PropertyID getPropertyID(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, String className, String propertyName)
Method that retrieves the id of a property given its signature- 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
MetaClassID getClassID(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, String className)
Method that retrieves the id of a class given its name- 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
MetaClass getClassInfo(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, String className)
Method that retrieves the id of a class given its name- 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
Map<MetaClassID,MetaClass> getInfoOfClassesInNamespace(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID)
Method that retrieves the info of the classes registered in specific namespace.- 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
ContractID newContract(AccountID accountID, PasswordCredential credential, Contract newContract)
Method to register a new contract.- 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
void registerToPublicContract(AccountID accountID, PasswordCredential credential, ContractID contractID)
Method to register an account to a contract- 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
ContractID registerToPublicContractOfNamespace(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID)
Method to register an account to a public contract given a namespace- 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
Map<ContractID,Contract> getContractIDsOfApplicant(AccountID applicantAccountID, PasswordCredential credential)
Method that returns all contract IDs of a user (as applicant).- 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
Map<ContractID,Contract> getContractIDsOfProvider(AccountID accountID, PasswordCredential credential, NamespaceID namespaceIDofProvider)
Method that returns all contract IDs of a namespace (as provider).- 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
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.- 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
DataContractID newDataContract(AccountID accountID, PasswordCredential credential, DataContract newDataContract)
Creates a new Data Contract- 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
void registerToPublicDataContract(AccountID accountID, PasswordCredential credential, DataContractID datacontractID)
Method that registers a certain account to a public data contract.- 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
Map<DataContractID,DataContract> getDataContractIDsOfProvider(AccountID accountID, PasswordCredential credential, DataSetID datasetIDofProvider)
Method that retrieves the data contracts that a dataset provides.- 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
Map<DataContractID,DataContract> getDataContractIDsOfApplicant(AccountID applicantAccountID, PasswordCredential credential)
Method that retrieves the data contracts that an account has (as applicant).- 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
DataContract getDataContractInfoOfApplicantWithProvider(AccountID applicantAccountID, PasswordCredential credential, DataSetID datasetIDofProvider)
Method that retrieves the data contract of an account (as applicant) with a certain dataset.- 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
InterfaceID newInterface(AccountID accountID, PasswordCredential credential, Interface newInterface)
Method that registers a new interface- 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
Interface 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 it- 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
void removeInterface(AccountID accountID, PasswordCredential credential, NamespaceID namespaceID, InterfaceID interfaceID)
Method that removes a specific interface- 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
List<ObjectID> registerObjects(List<RegistrationInfo> regInfos, ExecutionEnvironmentID backendID, CommonMessages.Langs lang)
Register objects in MDS- Parameters:
regInfos
- Registration infosbackendID
- ID of the backend in which the object is storedlang
- Language
-
registerObjectFromGC
void registerObjectFromGC(RegistrationInfo regInfo, ExecutionEnvironmentID backendID, DataServiceRuntime clientLib)
Register objects in MDS- 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
Map<ExecutionEnvironmentID,ExecutionEnvironment> getAllExecutionEnvironmentsInfo(CommonMessages.Langs exeEnvLang, boolean getExternal, boolean fromBackend)
Method that retrieves the info of all the registered backends- Parameters:
exeEnvLang
- 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
StorageLocation getStorageLocationInfo(StorageLocationID backendID, boolean fromBackend)
Retrieves the backend specification- 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
ExecutionEnvironment getExecutionEnvironmentInfo(ExecutionEnvironmentID backendID, boolean fromBackend)
Retrieves the backend specification- 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
-
registerExternalDataClay
DataClayInstanceID registerExternalDataClay(String hostname, int port)
Method that tries to register an external instance of dataClay assigning a new ID to it. If if is already registered, method is ignored.- 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
DataClayInstanceID registerExternalDataClayOverrideAuthority(AccountID adminAccountID, PasswordCredential adminCredential, String hostname, int port, String authority)
For system-admin users only. Method that registers an external dataclay overriding authority specified.- Parameters:
adminAccountID
- Admin account iDadminCredential
- Admin credentialshostname
- Hostnameport
- Portauthority
- Authority- Returns:
- ID of the dataClay registered
-
notifyRegistrationOfExternalDataClay
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. Destination dataClay then, is aware of all dataClays 'connected' to him.- 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
-
getExternalDataClayID
DataClayInstanceID getExternalDataClayID(String dcHost, int dcPort)
Tries to connect to an external dataClay instance and retrieve its ID. *- Parameters:
dcHost
- hostname of the external dataClay instancedcPort
- port of the external dataClay instance- Returns:
- id of the external dataClay instance
-
getExternalDataClayInfo
DataClayInstance getExternalDataClayInfo(DataClayInstanceID extDataClayID)
Method that retrieves the info of an external dataClay instance- 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.
-
getClassesInNamespace
Tuple<Namespace,Set<MetaClass>> getClassesInNamespace(String namespaceName)
Get all classes from namespace with name provided in current dataClay.- 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
void importModelsFromExternalDataClay(String extNamespaceName, DataClayInstanceID extDataClayID)
Import classes in namespace from external dataClay provided- Parameters:
extNamespaceName
- Name of the external namespace to getextDataClayID
- External dataClay ID to get namespace/classes from- Throws:
Exception
- If registration fails
-
getObjectInfo
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.- 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
Triple<ObjectID,MetaClassID,ExecutionEnvironmentID> getObjectFromAlias(SessionID sessionID, String alias)
Retrieves the objectID corresponding to the object with the specified alias.- Parameters:
sessionID
- ID of the sessionalias
- alias of the object- Returns:
- ID of the resulting object, class ID, and Hint for fast execution.
-
deleteAlias
ObjectID deleteAlias(SessionID sessionID, String alias)
Removes the alias of an object- Parameters:
sessionID
- ID of the sessionalias
- alias of the object- Returns:
- ID of object with deleted alias
-
getObjectsMetaDataInfoOfClassForNM
Map<ObjectID,MetaDataInfo> getObjectsMetaDataInfoOfClassForNM(MetaClassID classID)
Retrieves the information of the objects instantiating the given class.- Parameters:
classID
- the id of the class- Returns:
- the information of the objects of the class indexed by Object ID
-
setDataSetIDFromGarbageCollector
void setDataSetIDFromGarbageCollector(ObjectID objectID, DataSetID dataSetID)
Set DataSetID from GC- Parameters:
objectID
- ID of the objectdataSetID
- ID of the dataset
-
setDataSetID
void setDataSetID(SessionID sessionID, ObjectID objectID, DataSetID dataSetID)
Set dataset id of object- Parameters:
sessionID
- ID of sessionobjectID
- ID of objectdataSetID
- ID of dataset
-
moveObject
List<ObjectID> moveObject(SessionID sessionID, ObjectID objectID, ExecutionEnvironmentID srcBackendID, ExecutionEnvironmentID destBackendID, boolean recursive)
Method that moves an object from location to location.- 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
void setObjectReadOnly(SessionID sessionID, ObjectID objectID)
Method that sets the object as read only- Parameters:
sessionID
- ID of the sessionobjectID
- ID of the object
-
setObjectReadWrite
void setObjectReadWrite(SessionID sessionID, ObjectID objectID)
Method that sets the object as read-write- Parameters:
sessionID
- ID of the sessionobjectID
- ID of the object
-
getMetadataByOID
MetaDataInfo getMetadataByOID(SessionID sessionID, ObjectID objectID)
Method that retrieves the locations of all the replicas of a specific object and its classname.- Parameters:
sessionID
- ID of the sessionobjectID
- ID of the object- Returns:
- MetaDataInfo of the object
-
getMetadataByOIDForDS
MetaDataInfo getMetadataByOIDForDS(ObjectID objectID)
Get metadata by oid. TODO: functions without session ids (garbage collector for isntance) should be used in different way (dgasull)- Parameters:
objectID
- Object ID- Returns:
- Metadata info for EE.
-
executeImplementation
SerializedParametersOrReturn executeImplementation(SessionID sessionID, OperationID operationID, Triple<ImplementationID,ContractID,InterfaceID> remoteImplementation, ObjectID objectID, SerializedParametersOrReturn params)
Method that executes an implementation- 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
SerializedParametersOrReturn 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).- 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.
-
isPrefetchingEnabled
boolean isPrefetchingEnabled()
Indicates if dataClay has prefetching enabled.- Returns:
- TRUE if prefetching is enabled in dataClay. FALSE otherwise.
-
getDataClayID
DataClayInstanceID getDataClayID()
Method that retrieves the ID of current dataClay instance- Returns:
- ID of current dataclay
-
getStubs
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)- 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
byte[] 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).- 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
String getClassNameForDS(MetaClassID classID)
Get class name for Data Service- Parameters:
classID
- ID of the class- Returns:
- Name of the class
-
getClassNameAndNamespaceForDS
Tuple<String,String> getClassNameAndNamespaceForDS(MetaClassID classID)
Get class name and namespace name for Data Service- Parameters:
classID
- ID of the class- Returns:
- Class name and namespace name of the class
-
registerEventListenerImplementation
void registerEventListenerImplementation(AccountID accountID, PasswordCredential credential, ECA newEventListener)
Registers an event listener implementation- Parameters:
accountID
- ID of account registering the event listenercredential
- Credentials of the accountnewEventListener
- Event listener implementation to register.
-
objectExistsInDataClay
boolean objectExistsInDataClay(ObjectID objectID)
Check if object exists in dataClay (in any EE memory or SL)- Parameters:
objectID
- ID of the object to check- Returns:
- TRUE if the object exists. FALSE otherwise.
-
adviseEvent
void adviseEvent(EventMessage newEvent)
Advises Notification Manager new event has occurred.- Parameters:
newEvent
- New event
-
activateTracing
void activateTracing(int currentAvailableTaskID)
Activate tracing.- Parameters:
currentAvailableTaskID
- Current starting task ID in Extrae
-
deactivateTracing
void deactivateTracing()
Deactivate Extrae tracing
-
getTraces
Map<String,byte[]> getTraces()
Get Extrae traces (mpits and set files)- Returns:
- Extrae traces (mpits and set files)
-
cleanMetaDataCaches
void cleanMetaDataCaches()
Clean MD caches
-
closeManagerDb
void closeManagerDb()
Close mgr db.
-
closeDb
void closeDb()
Close logic db.
-
getContractIDOfDataClayProvider
ContractID getContractIDOfDataClayProvider(AccountID accountID, PasswordCredential credential)
Get contract ID of DataClay classes- Parameters:
accountID
- ID of the account queryingcredential
- Credentials- Returns:
- Contract ID of DataClay provider
-
unregisterObjects
void unregisterObjects(Set<ObjectID> objectsToUnregister)
Unregister objects (called from GlobalGC)- Parameters:
objectsToUnregister
- Objects to unregister
-
getNumObjects
int getNumObjects()
Get number of objects in dataClay- Returns:
- number of objects in dataClay
-
-