Class NamespaceManagerDB


  • public final class NamespaceManagerDB
    extends Object
    Data base connection.
    • Constructor Detail

      • NamespaceManagerDB

        public NamespaceManagerDB​(SQLiteDataSource dataSource)
        MetaDataServiceDB constructor.
    • 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 void store​(Namespace namespace)
        Store namespace into database
        Parameters:
        namespace - namespace
      • getNamespaceByID

        public Namespace getNamespaceByID​(NamespaceID namespaceID)
        Get by ID
        Parameters:
        namespaceID - ID of object
        Returns:
        The object
        Throws:
        SQLException - if not found
      • deleteNamespaceByID

        public void deleteNamespaceByID​(NamespaceID namespaceID)
        Delete by ID
        Parameters:
        namespaceID - ID of object
      • getNamespacesNames

        public Set<String> getNamespacesNames()
        Get by name
        Returns:
        The object
        Throws:
        SQLException - if not found
      • getNamespaceByName

        public Namespace getNamespaceByName​(String name)
        Get by name
        Parameters:
        name - the name
        Returns:
        The object
        Throws:
        SQLException - if not found
      • getNamespaceByNameAndID

        public Namespace getNamespaceByNameAndID​(String name,
                                                 NamespaceID namespaceID)
        Get by name and id
        Parameters:
        name - the name
        namespaceID - ID of the namespace
        Returns:
        The object
        Throws:
        SQLException - if not found
      • updateNamespaceAddImport

        public void updateNamespaceAddImport​(NamespaceID namespaceID,
                                             ImportedInterface importedIface)
        Update by ID
        Parameters:
        namespaceID - ID of object
        importedIface - Iface added
      • updateNamespaceRemoveImport

        public void updateNamespaceRemoveImport​(NamespaceID namespaceID,
                                                InterfaceID ifaceID,
                                                ContractID contractID)
        Update by ID
        Parameters:
        namespaceID - ID of object
        ifaceID - Iface ID
        contractID - Contract ID
      • getNamespacesWithProvider

        public List<Namespace> getNamespacesWithProvider​(AccountID providerAccountID)
        Get Namespaces containing provider
        Parameters:
        providerAccountID - Account ID
        Returns:
        The Namespace
      • getAllNamespacesImportingClass

        public List<Namespace> getAllNamespacesImportingClass​(MetaClassID classID)
        Get Namespaces using class
        Parameters:
        classID - class id
        Returns:
        The Namespace
      • updateImportedInterfaceAddProperty

        public void updateImportedInterfaceAddProperty​(NamespaceID namespaceID,
                                                       InterfaceID ifaceID,
                                                       ContractID contractID,
                                                       PropertyID propertyID)
        Update by ID
        Parameters:
        namespaceID - ID of object
        ifaceID - Iface ID
        contractID - Contract ID
        propertyID - Property ID
      • updateImportedInterfaceAddOperation

        public void updateImportedInterfaceAddOperation​(NamespaceID namespaceID,
                                                        InterfaceID ifaceID,
                                                        ContractID contractID,
                                                        OperationID operationID)
        Update by ID
        Parameters:
        namespaceID - ID of object
        ifaceID - Iface ID
        contractID - Contract ID
        operationID - Operation ID
      • updateImportedInterfaceAddImplementation

        public void updateImportedInterfaceAddImplementation​(NamespaceID namespaceID,
                                                             InterfaceID ifaceID,
                                                             ContractID contractID,
                                                             ImplementationID implementationID)
        Update by ID
        Parameters:
        namespaceID - ID of object
        ifaceID - Iface ID
        contractID - Contract ID
        implementationID - Implementation ID
      • updateImportedInterfaceAddSubClass

        public void updateImportedInterfaceAddSubClass​(NamespaceID namespaceID,
                                                       InterfaceID ifaceID,
                                                       ContractID contractID,
                                                       MetaClassID subClassID)
        Update by ID
        Parameters:
        namespaceID - ID of object
        ifaceID - Iface ID
        contractID - Contract ID
        subClassID - MetaClass ID
      • updateImportedInterfaceRemoveProperty

        public void updateImportedInterfaceRemoveProperty​(NamespaceID namespaceID,
                                                          InterfaceID ifaceID,
                                                          ContractID contractID,
                                                          PropertyID propertyID)
        Update by ID
        Parameters:
        namespaceID - ID of object
        ifaceID - Iface ID
        contractID - Contract ID
        propertyID - Property ID
      • updateImportedInterfaceRemoveOperation

        public void updateImportedInterfaceRemoveOperation​(NamespaceID namespaceID,
                                                           InterfaceID ifaceID,
                                                           ContractID contractID,
                                                           OperationID operationID)
        Update by ID
        Parameters:
        namespaceID - ID of object
        ifaceID - Iface ID
        contractID - Contract ID
        operationID - Operation ID
      • updateImportedInterfaceRemoveImplementation

        public void updateImportedInterfaceRemoveImplementation​(NamespaceID namespaceID,
                                                                InterfaceID ifaceID,
                                                                ContractID contractID,
                                                                ImplementationID implementationID)
        Update by ID
        Parameters:
        namespaceID - ID of object
        ifaceID - Iface ID
        contractID - Contract ID
        implementationID - Implementation ID
      • updateImportedInterfaceRemoveSubClass

        public void updateImportedInterfaceRemoveSubClass​(NamespaceID namespaceID,
                                                          InterfaceID ifaceID,
                                                          ContractID contractID,
                                                          MetaClassID subClassID)
        Update by ID
        Parameters:
        namespaceID - ID of object
        ifaceID - Iface ID
        contractID - Contract ID
        subClassID - MetaClass ID
      • close

        public void close()
        Close DB.
      • existsObjectByID

        public boolean existsObjectByID​(NamespaceID dataClayID)
        Check if namespace exists
        Parameters:
        dataClayID - ID of namespace
        Returns:
        TRUE if exists.