Package es.bsc.dataclay.logic.classmgr
Class ClassManagerDB
- java.lang.Object
-
- es.bsc.dataclay.logic.classmgr.ClassManagerDB
-
public final class ClassManagerDB extends Object
Class manager data base.
-
-
Constructor Summary
Constructors Constructor Description ClassManagerDB(SQLiteDataSource dataSource)
ClassManagerDB constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close DB.void
createTables()
Create tables.void
deleteClass(MetaClassID classID)
Deletevoid
deleteImplementation(Implementation impl)
Delete implementation recursivelyvoid
deleteOperation(OperationID dataClayID)
Delete operation recursivelyvoid
dropTables()
Delete the tables of MDS.boolean
existsAccessedImplementationWithID(ImplementationID implID)
Check if exists accessed implementationboolean
existsClassInNamespace(NamespaceID namespaceID)
Check if exists class in namespaceboolean
existsClassInSomeType(MetaClassID classID)
Check if exists class in some typeMetaClass
getClassByNameAndNamespace(String className, String namespace)
Get class by name and namespace idMetaClass
getClassByNameAndNamespaceID(String className, NamespaceID namespaceID)
Get class by name and namespace idList<MetaClass>
getClassesInNamespace(NamespaceID namespaceID)
Get classes in namespaceMetaClassID
getClassIDByNameAndNamespaceID(String className, NamespaceID nspaceID)
Implementation
getImplementationByID(ImplementationID id)
Get Implementation by IDMetaClass
getMetaClassByID(MetaClassID metaClassID)
Get MetaClass by IDOperation
getOperationByID(OperationID id)
Get Operation by IDOperation
getOperationByNames(String operationSignature, String className, String namespace)
Get operation by namesList<Operation>
getOperationsByClassIDAndNamespaceID(MetaClassID classID, NamespaceID namespaceID)
Get operations by class id and namespace idList<Property>
getPropertiesByClassIDAndNamespaceID(MetaClassID classID, NamespaceID namespaceID)
Get properties by class id and namespace idProperty
getPropertyByID(PropertyID id)
Get Property by IDProperty
getPropertyByNames(String propertyName, String className, String namespace)
Get property by namesType
getTypeByID(UUID typeID)
Get Type by IDUUID
storeAccessedImplementation(AccessedImplementation accessedImplementation)
Store accessedImplementation into databaseUUID
storeAccessedProperty(AccessedProperty accessedProperty)
Store accessedProperty into databaseUUID
storeAnnotation(Annotation annotation)
Store Annotation into databaseUUID
storeArchitectureFeature(ArchitectureFeature feature)
Store ArchitectureFeature into databaseUUID
storeCPUFeature(CPUFeature feature)
Store CPUFeature into databaseUUID
storeJavaClassInfo(JavaClassInfo info)
Store JavaClassInfo into databaseUUID
storeJavaImplementation(JavaImplementation implementation)
Store JavaImplementation into databaseUUID
storeJavaOperationInfo(JavaOperationInfo type)
Store JavaOperationInfo into databaseUUID
storeJavaPropertyInfo(JavaPropertyInfo type)
Store JavaPropertyInfo into databaseUUID
storeJavaTypeInfo(JavaTypeInfo type)
Store JavaTypeInfo into databaseUUID
storeLanguageFeature(LanguageFeature feature)
Store LanguageFeature into databaseUUID
storeMemoryFeature(MemoryFeature memFeature)
Store MemoryFeature into databaseUUID
storeMetaClass(MetaClass metaclass)
Store MetaClass into databaseUUID
storeOperation(Operation operation)
Store Operation into databaseUUID
storePrefecthingInfo(PrefetchingInformation prefetchingInfo)
Store prefetchingInfo into databaseUUID
storeProperty(Property property)
Store Property into databaseUUID
storePythonClassInfo(PythonClassInfo info)
Store PythonClassInfo into databaseUUID
storePythonImplementation(PythonImplementation implementation)
Store PythonImplementation into databaseUUID
storePythonOperationInfo(PythonOperationInfo type)
Store PythonOperationInfo into databaseUUID
storePythonPropertyInfo(PythonPropertyInfo type)
Store PythonPropertyInfo into databaseUUID
storePythonTypeInfo(PythonTypeInfo type)
Store PythonTypeInfo into databaseUUID
storeType(Type type)
Store type into databasevoid
updateClassAddOperation(MetaClassID classID, Operation newoperation)
Update class with new operationvoid
updateClassPropertiesAndOperations(MetaClassID classID, Property newProperty, OperationID newSetter, OperationID newGetter)
Update class with new properties and operationsvoid
updateClassPropertiesAndOperations(MetaClassID classID, Property newProperty, Operation newSetter, Operation newGetter, Operation newUpdate)
Update class with new properties and operationsvoid
updateClassRemoveOperation(MetaClassID classID, OperationID opID)
Update class removing operationvoid
updateJavaClassByteCode(UUID javaClassInfoUUID, byte[] newByteCode)
Update java bytecodevoid
updateOperationAddImplementation(OperationID opID, Implementation impl)
Update operation adding implementationvoid
updateOperationRemoveImplementation(OperationID opID, ImplementationID implID)
Update operation removing implementation
-
-
-
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 JavaClassInfonewByteCode
- 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 classnewProperty
- New propertynewSetter
- New setter operationnewGetter
- 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 classnewProperty
- New propertynewSetter
- New setter operationnewGetter
- New getter operation
-
updateClassAddOperation
public void updateClassAddOperation(MetaClassID classID, Operation newoperation)
Update class with new operation- Parameters:
classID
- ID of classnewoperation
- New operation
-
updateClassRemoveOperation
public void updateClassRemoveOperation(MetaClassID classID, OperationID opID)
Update class removing operation- Parameters:
classID
- ID of classopID
- ID of operation
-
updateOperationRemoveImplementation
public void updateOperationRemoveImplementation(OperationID opID, ImplementationID implID)
Update operation removing implementation- Parameters:
opID
- ID of operationimplID
- ID of implementation
-
updateOperationAddImplementation
public void updateOperationAddImplementation(OperationID opID, Implementation impl)
Update operation adding implementation- Parameters:
opID
- ID of operationimpl
- 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 classnamespaceID
- Namespace ID- Returns:
- The class
-
getClassByNameAndNamespace
public MetaClass getClassByNameAndNamespace(String className, String namespace)
Get class by name and namespace id- Parameters:
className
- Name of classnamespace
- Namespace- Returns:
- The class
-
getPropertyByNames
public Property getPropertyByNames(String propertyName, String className, String namespace)
Get property by names- Parameters:
propertyName
- property nameclassName
- Name of classnamespace
- Namespace- Returns:
- The property
-
getOperationByNames
public Operation getOperationByNames(String operationSignature, String className, String namespace)
Get operation by names- Parameters:
operationSignature
- signatureclassName
- Name of classnamespace
- 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 classnamespaceID
- 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 classnamespaceID
- Namespace ID- Returns:
- The operations
-
getClassesInNamespace
public List<MetaClass> getClassesInNamespace(NamespaceID namespaceID)
Get classes in namespace- Parameters:
namespaceID
- Namespace ID- Returns:
- The classes
-
getClassIDByNameAndNamespaceID
public MetaClassID getClassIDByNameAndNamespaceID(String className, NamespaceID nspaceID)
-
close
public void close()
Close DB.
-
-