Class ClassManagerDB


  • public final class ClassManagerDB
    extends Object
    Class manager data base.
    • Constructor Detail

      • ClassManagerDB

        public ClassManagerDB​(SQLiteDataSource dataSource)
        ClassManagerDB constructor.
        Parameters:
        dataSource - Name of the LM service managing.
    • Method Detail

      • createTables

        public void createTables()
        Create tables.
      • dropTables

        public void dropTables()
        Delete the tables of MDS. Just the other way around of createTables --much simpler.
      • storeAccessedImplementation

        public UUID storeAccessedImplementation​(AccessedImplementation accessedImplementation)
        Store accessedImplementation into database
        Parameters:
        accessedImplementation - accessedImplementation
        Returns:
        UUID of stored object
      • storeAccessedProperty

        public UUID storeAccessedProperty​(AccessedProperty accessedProperty)
        Store accessedProperty into database
        Parameters:
        accessedProperty - accessedProperty
        Returns:
        UUID of stored object
      • storeType

        public UUID storeType​(Type type)
        Store type into database
        Parameters:
        type - type
        Returns:
        UUID of stored object
      • storeJavaTypeInfo

        public UUID storeJavaTypeInfo​(JavaTypeInfo type)
        Store JavaTypeInfo into database
        Parameters:
        type - JavaTypeInfo
        Returns:
        UUID of stored object
      • storePythonTypeInfo

        public UUID storePythonTypeInfo​(PythonTypeInfo type)
        Store PythonTypeInfo into database
        Parameters:
        type - PythonTypeInfo
        Returns:
        UUID of stored object
      • storeMemoryFeature

        public UUID storeMemoryFeature​(MemoryFeature memFeature)
        Store MemoryFeature into database
        Parameters:
        memFeature - MemoryFeature
        Returns:
        UUID of stored object
      • storeCPUFeature

        public UUID storeCPUFeature​(CPUFeature feature)
        Store CPUFeature into database
        Parameters:
        feature - CPUFeature
        Returns:
        UUID of stored object
      • storeLanguageFeature

        public UUID storeLanguageFeature​(LanguageFeature feature)
        Store LanguageFeature into database
        Parameters:
        feature - LanguageFeature
        Returns:
        UUID of stored object
      • storeArchitectureFeature

        public UUID storeArchitectureFeature​(ArchitectureFeature feature)
        Store ArchitectureFeature into database
        Parameters:
        feature - ArchitectureFeature
        Returns:
        UUID of stored object
      • storePrefecthingInfo

        public UUID storePrefecthingInfo​(PrefetchingInformation prefetchingInfo)
        Store prefetchingInfo into database
        Parameters:
        prefetchingInfo - prefetchingInfo
        Returns:
        UUID of stored object
      • storeJavaImplementation

        public UUID storeJavaImplementation​(JavaImplementation implementation)
        Store JavaImplementation into database
        Parameters:
        implementation - implementation
        Returns:
        UUID of stored object
      • storePythonImplementation

        public UUID storePythonImplementation​(PythonImplementation implementation)
        Store PythonImplementation into database
        Parameters:
        implementation - implementation
        Returns:
        UUID of stored object
      • storeProperty

        public UUID storeProperty​(Property property)
        Store Property into database
        Parameters:
        property - property
        Returns:
        UUID of stored object
      • storeJavaPropertyInfo

        public UUID storeJavaPropertyInfo​(JavaPropertyInfo type)
        Store JavaPropertyInfo into database
        Parameters:
        type - JavaPropertyInfo
        Returns:
        UUID of stored object
      • storeAnnotation

        public UUID storeAnnotation​(Annotation annotation)
        Store Annotation into database
        Parameters:
        annotation - Annotation
        Returns:
        UUID of stored object
      • storePythonPropertyInfo

        public UUID storePythonPropertyInfo​(PythonPropertyInfo type)
        Store PythonPropertyInfo into database
        Parameters:
        type - PythonPropertyInfo
        Returns:
        UUID of stored object
      • storeOperation

        public UUID storeOperation​(Operation operation)
        Store Operation into database
        Parameters:
        operation - operation
        Returns:
        UUID of stored object
      • storeJavaOperationInfo

        public UUID storeJavaOperationInfo​(JavaOperationInfo type)
        Store JavaOperationInfo into database
        Parameters:
        type - JavaOperationInfo
        Returns:
        UUID of stored object
      • storePythonOperationInfo

        public UUID storePythonOperationInfo​(PythonOperationInfo type)
        Store PythonOperationInfo into database
        Parameters:
        type - PythonOperationInfo
        Returns:
        UUID of stored object
      • storeMetaClass

        public UUID storeMetaClass​(MetaClass metaclass)
        Store MetaClass into database
        Parameters:
        metaclass - metaclass
        Returns:
        UUID of stored object
      • storeJavaClassInfo

        public UUID storeJavaClassInfo​(JavaClassInfo info)
        Store JavaClassInfo into database
        Parameters:
        info - JavaClassInfo
        Returns:
        UUID of stored object
      • storePythonClassInfo

        public UUID storePythonClassInfo​(PythonClassInfo info)
        Store PythonClassInfo into database
        Parameters:
        info - PythonClassInfo
        Returns:
        UUID of stored object
      • getTypeByID

        public Type getTypeByID​(UUID typeID)
                         throws SQLException
        Get Type by ID
        Parameters:
        typeID - ID of the type
        Returns:
        The type
        Throws:
        SQLException - if type not found
      • getMetaClassByID

        public MetaClass getMetaClassByID​(MetaClassID metaClassID)
        Get MetaClass by ID
        Parameters:
        metaClassID - ID of the object
        Returns:
        The MetaClass
      • getOperationByID

        public Operation getOperationByID​(OperationID id)
        Get Operation by ID
        Parameters:
        id - ID of the object
        Returns:
        The Operation
      • getPropertyByID

        public Property getPropertyByID​(PropertyID id)
        Get Property by ID
        Parameters:
        id - ID of the object
        Returns:
        The Property
      • getImplementationByID

        public Implementation getImplementationByID​(ImplementationID id)
        Get Implementation by ID
        Parameters:
        id - ID of the object
        Returns:
        The Property
      • deleteClass

        public void deleteClass​(MetaClassID classID)
        Delete
        Parameters:
        classID - ID of object to delete
      • updateJavaClassByteCode

        public void updateJavaClassByteCode​(UUID javaClassInfoUUID,
                                            byte[] newByteCode)
        Update java bytecode
        Parameters:
        javaClassInfoUUID - UUID of JavaClassInfo
        newByteCode - New bytecode
      • existsClassInNamespace

        public boolean existsClassInNamespace​(NamespaceID namespaceID)
        Check if exists class in namespace
        Parameters:
        namespaceID - ID of namespace
        Returns:
        TRUE if exists.
      • updateClassPropertiesAndOperations

        public void updateClassPropertiesAndOperations​(MetaClassID classID,
                                                       Property newProperty,
                                                       Operation newSetter,
                                                       Operation newGetter,
                                                       Operation newUpdate)
        Update class with new properties and operations
        Parameters:
        classID - ID of class
        newProperty - New property
        newSetter - New setter operation
        newGetter - New getter operation
      • updateClassPropertiesAndOperations

        public void updateClassPropertiesAndOperations​(MetaClassID classID,
                                                       Property newProperty,
                                                       OperationID newSetter,
                                                       OperationID newGetter)
        Update class with new properties and operations
        Parameters:
        classID - ID of class
        newProperty - New property
        newSetter - New setter operation
        newGetter - New getter operation
      • updateClassAddOperation

        public void updateClassAddOperation​(MetaClassID classID,
                                            Operation newoperation)
        Update class with new operation
        Parameters:
        classID - ID of class
        newoperation - New operation
      • updateClassRemoveOperation

        public void updateClassRemoveOperation​(MetaClassID classID,
                                               OperationID opID)
        Update class removing operation
        Parameters:
        classID - ID of class
        opID - ID of operation
      • updateOperationRemoveImplementation

        public void updateOperationRemoveImplementation​(OperationID opID,
                                                        ImplementationID implID)
        Update operation removing implementation
        Parameters:
        opID - ID of operation
        implID - ID of implementation
      • updateOperationAddImplementation

        public void updateOperationAddImplementation​(OperationID opID,
                                                     Implementation impl)
        Update operation adding implementation
        Parameters:
        opID - ID of operation
        impl - implementation
      • deleteOperation

        public void deleteOperation​(OperationID dataClayID)
        Delete operation recursively
        Parameters:
        dataClayID - ID of operation
      • deleteImplementation

        public void deleteImplementation​(Implementation impl)
        Delete implementation recursively
        Parameters:
        impl - implementation
      • existsClassInSomeType

        public boolean existsClassInSomeType​(MetaClassID classID)
        Check if exists class in some type
        Parameters:
        classID - ID of class
        Returns:
        TRUE if exists.
      • existsAccessedImplementationWithID

        public boolean existsAccessedImplementationWithID​(ImplementationID implID)
        Check if exists accessed implementation
        Parameters:
        implID - ID of implementation
        Returns:
        TRUE if exists.
      • getClassByNameAndNamespaceID

        public MetaClass getClassByNameAndNamespaceID​(String className,
                                                      NamespaceID namespaceID)
        Get class by name and namespace id
        Parameters:
        className - Name of class
        namespaceID - Namespace ID
        Returns:
        The class
      • getClassByNameAndNamespace

        public MetaClass getClassByNameAndNamespace​(String className,
                                                    String namespace)
        Get class by name and namespace id
        Parameters:
        className - Name of class
        namespace - Namespace
        Returns:
        The class
      • getPropertyByNames

        public Property getPropertyByNames​(String propertyName,
                                           String className,
                                           String namespace)
        Get property by names
        Parameters:
        propertyName - property name
        className - Name of class
        namespace - Namespace
        Returns:
        The property
      • getOperationByNames

        public Operation getOperationByNames​(String operationSignature,
                                             String className,
                                             String namespace)
        Get operation by names
        Parameters:
        operationSignature - signature
        className - Name of class
        namespace - Namespace
        Returns:
        The Operation
      • getPropertiesByClassIDAndNamespaceID

        public List<Property> getPropertiesByClassIDAndNamespaceID​(MetaClassID classID,
                                                                   NamespaceID namespaceID)
        Get properties by class id and namespace id
        Parameters:
        classID - ID of class
        namespaceID - Namespace ID
        Returns:
        The properties
      • getOperationsByClassIDAndNamespaceID

        public List<Operation> getOperationsByClassIDAndNamespaceID​(MetaClassID classID,
                                                                    NamespaceID namespaceID)
        Get operations by class id and namespace id
        Parameters:
        classID - ID of class
        namespaceID - Namespace ID
        Returns:
        The operations
      • getClassesInNamespace

        public List<MetaClass> getClassesInNamespace​(NamespaceID namespaceID)
        Get classes in namespace
        Parameters:
        namespaceID - Namespace ID
        Returns:
        The classes
      • close

        public void close()
        Close DB.