Class ContractManagerDB
- java.lang.Object
-
- es.bsc.dataclay.logic.contractmgr.ContractManagerDB
-
public final class ContractManagerDB extends Object
Data base connection.
-
-
Constructor Summary
Constructors Constructor Description ContractManagerDB(SQLiteDataSource dataSource)
MetaDataServiceDB constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close DB.void
createTables()
Create tables of MDS.void
deleteContractByID(ContractID contractID)
Delete by IDvoid
dropTables()
Delete the tables of MDS.Contract
getContractByID(ContractID contractID)
Get by IDList<Contract>
getContractsContainingInterface(InterfaceID interfaceID)
Get contracts containing interfaceList<Contract>
getContractsOfNamespace(NamespaceID namespaceID)
Get contracts of namespaceList<Contract>
getContractsWithApplicant(AccountID applicantAccountID)
Get contracts containing applicantList<Contract>
getContractsWithApplicantAndNamespace(AccountID applicantAccountID, NamespaceID namespaceID)
Get contracts containing applicant and namespaceList<Contract>
getContractsWithProvider(AccountID providerAccountID)
Get contracts containing providerList<OpImplementations>
getOpImplementationsWithImpl(ImplementationID implementationID)
Get OpImplementations with implementation idvoid
store(Contract contract)
Store contract into databaseUUID
store(InterfaceInContract ifaceInContract)
Store ifaceInContract into databaseUUID
store(OpImplementations opImplementations)
Store opImplementations into databasevoid
updateContractsAddApplicant(ContractID contractID, AccountID applicantAccountID)
Update by ID
-
-
-
Constructor Detail
-
ContractManagerDB
public ContractManagerDB(SQLiteDataSource dataSource)
MetaDataServiceDB constructor.- Parameters:
dataSource
- Name of the LM service managing.
-
-
Method Detail
-
createTables
public void createTables()
Create tables of MDS.
-
dropTables
public void dropTables()
Delete the tables of MDS. Just the other way around of createTables --much simpler.
-
store
public UUID store(OpImplementations opImplementations)
Store opImplementations into database- Parameters:
opImplementations
- opImplementations- Returns:
- uuid of stored object
-
store
public UUID store(InterfaceInContract ifaceInContract)
Store ifaceInContract into database- Parameters:
ifaceInContract
- ifaceInContract- Returns:
- uuid of stored object
-
store
public void store(Contract contract)
Store contract into database- Parameters:
contract
- contract
-
getContractByID
public Contract getContractByID(ContractID contractID)
Get by ID- Parameters:
contractID
- ID of object- Returns:
- The object
- Throws:
SQLException
- if not found
-
deleteContractByID
public void deleteContractByID(ContractID contractID)
Delete by ID- Parameters:
contractID
- ID of object
-
updateContractsAddApplicant
public void updateContractsAddApplicant(ContractID contractID, AccountID applicantAccountID)
Update by ID- Parameters:
contractID
- ID of object
-
getContractsOfNamespace
public List<Contract> getContractsOfNamespace(NamespaceID namespaceID)
Get contracts of namespace- Parameters:
namespaceID
- contracts ID- Returns:
- The Contracts
-
getContractsContainingInterface
public List<Contract> getContractsContainingInterface(InterfaceID interfaceID)
Get contracts containing interface- Parameters:
interfaceID
- interface ID- Returns:
- The Contracts
-
getContractsWithApplicant
public List<Contract> getContractsWithApplicant(AccountID applicantAccountID)
Get contracts containing applicant- Parameters:
applicantAccountID
- Account ID- Returns:
- The Contracts
-
getContractsWithProvider
public List<Contract> getContractsWithProvider(AccountID providerAccountID)
Get contracts containing provider- Parameters:
providerAccountID
- Account ID- Returns:
- The Contracts
-
getOpImplementationsWithImpl
public List<OpImplementations> getOpImplementationsWithImpl(ImplementationID implementationID)
Get OpImplementations with implementation id- Parameters:
implementationID
- ID of implementation- Returns:
- The OpImplementations
-
getContractsWithApplicantAndNamespace
public List<Contract> getContractsWithApplicantAndNamespace(AccountID applicantAccountID, NamespaceID namespaceID)
Get contracts containing applicant and namespace- Parameters:
applicantAccountID
- Account IDnamespaceID
- ID of namespace- Returns:
- The Contracts
-
close
public void close()
Close DB.
-
-