Class ContractManagerDB


  • public final class ContractManagerDB
    extends Object
    Data base connection.
    • 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 ID
        namespaceID - ID of namespace
        Returns:
        The Contracts
      • close

        public void close()
        Close DB.