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 voidclose()Close DB.voidcreateTables()Create tables.voiddeleteClass(MetaClassID classID)DeletevoiddeleteImplementation(Implementation impl)Delete implementation recursivelyvoiddeleteOperation(OperationID dataClayID)Delete operation recursivelyvoiddropTables()Delete the tables of MDS.booleanexistsAccessedImplementationWithID(ImplementationID implID)Check if exists accessed implementationbooleanexistsClassInNamespace(NamespaceID namespaceID)Check if exists class in namespacebooleanexistsClassInSomeType(MetaClassID classID)Check if exists class in some typeMetaClassgetClassByNameAndNamespace(String className, String namespace)Get class by name and namespace idMetaClassgetClassByNameAndNamespaceID(String className, NamespaceID namespaceID)Get class by name and namespace idList<MetaClass>getClassesInNamespace(NamespaceID namespaceID)Get classes in namespaceMetaClassIDgetClassIDByNameAndNamespaceID(String className, NamespaceID nspaceID)ImplementationgetImplementationByID(ImplementationID id)Get Implementation by IDMetaClassgetMetaClassByID(MetaClassID metaClassID)Get MetaClass by IDOperationgetOperationByID(OperationID id)Get Operation by IDOperationgetOperationByNames(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 idPropertygetPropertyByID(PropertyID id)Get Property by IDPropertygetPropertyByNames(String propertyName, String className, String namespace)Get property by namesTypegetTypeByID(UUID typeID)Get Type by IDUUIDstoreAccessedImplementation(AccessedImplementation accessedImplementation)Store accessedImplementation into databaseUUIDstoreAccessedProperty(AccessedProperty accessedProperty)Store accessedProperty into databaseUUIDstoreAnnotation(Annotation annotation)Store Annotation into databaseUUIDstoreArchitectureFeature(ArchitectureFeature feature)Store ArchitectureFeature into databaseUUIDstoreCPUFeature(CPUFeature feature)Store CPUFeature into databaseUUIDstoreJavaClassInfo(JavaClassInfo info)Store JavaClassInfo into databaseUUIDstoreJavaImplementation(JavaImplementation implementation)Store JavaImplementation into databaseUUIDstoreJavaOperationInfo(JavaOperationInfo type)Store JavaOperationInfo into databaseUUIDstoreJavaPropertyInfo(JavaPropertyInfo type)Store JavaPropertyInfo into databaseUUIDstoreJavaTypeInfo(JavaTypeInfo type)Store JavaTypeInfo into databaseUUIDstoreLanguageFeature(LanguageFeature feature)Store LanguageFeature into databaseUUIDstoreMemoryFeature(MemoryFeature memFeature)Store MemoryFeature into databaseUUIDstoreMetaClass(MetaClass metaclass)Store MetaClass into databaseUUIDstoreOperation(Operation operation)Store Operation into databaseUUIDstorePrefecthingInfo(PrefetchingInformation prefetchingInfo)Store prefetchingInfo into databaseUUIDstoreProperty(Property property)Store Property into databaseUUIDstorePythonClassInfo(PythonClassInfo info)Store PythonClassInfo into databaseUUIDstorePythonImplementation(PythonImplementation implementation)Store PythonImplementation into databaseUUIDstorePythonOperationInfo(PythonOperationInfo type)Store PythonOperationInfo into databaseUUIDstorePythonPropertyInfo(PythonPropertyInfo type)Store PythonPropertyInfo into databaseUUIDstorePythonTypeInfo(PythonTypeInfo type)Store PythonTypeInfo into databaseUUIDstoreType(Type type)Store type into databasevoidupdateClassAddOperation(MetaClassID classID, Operation newoperation)Update class with new operationvoidupdateClassPropertiesAndOperations(MetaClassID classID, Property newProperty, OperationID newSetter, OperationID newGetter)Update class with new properties and operationsvoidupdateClassPropertiesAndOperations(MetaClassID classID, Property newProperty, Operation newSetter, Operation newGetter, Operation newUpdate)Update class with new properties and operationsvoidupdateClassRemoveOperation(MetaClassID classID, OperationID opID)Update class removing operationvoidupdateJavaClassByteCode(UUID javaClassInfoUUID, byte[] newByteCode)Update java bytecodevoidupdateOperationAddImplementation(OperationID opID, Implementation impl)Update operation adding implementationvoidupdateOperationRemoveImplementation(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.
-
-