Class NamespaceManagerDB
- java.lang.Object
-
- es.bsc.dataclay.logic.namespacemgr.NamespaceManagerDB
-
public final class NamespaceManagerDB extends Object
Data base connection.
-
-
Constructor Summary
Constructors Constructor Description NamespaceManagerDB(SQLiteDataSource dataSource)MetaDataServiceDB constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close DB.voidcreateTables()Create tables of MDS.voiddeleteNamespaceByID(NamespaceID namespaceID)Delete by IDvoiddropTables()Delete the tables of MDS.booleanexistsObjectByID(NamespaceID dataClayID)Check if namespace existsList<Namespace>getAllNamespacesImportingClass(MetaClassID classID)Get Namespaces using classNamespacegetNamespaceByID(NamespaceID namespaceID)Get by IDNamespacegetNamespaceByName(String name)Get by nameNamespacegetNamespaceByNameAndID(String name, NamespaceID namespaceID)Get by name and idSet<String>getNamespacesNames()Get by nameList<Namespace>getNamespacesWithProvider(AccountID providerAccountID)Get Namespaces containing providervoidstore(Namespace namespace)Store namespace into databasevoidupdateImportedInterfaceAddImplementation(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, ImplementationID implementationID)Update by IDvoidupdateImportedInterfaceAddOperation(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, OperationID operationID)Update by IDvoidupdateImportedInterfaceAddProperty(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, PropertyID propertyID)Update by IDvoidupdateImportedInterfaceAddSubClass(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, MetaClassID subClassID)Update by IDvoidupdateImportedInterfaceRemoveImplementation(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, ImplementationID implementationID)Update by IDvoidupdateImportedInterfaceRemoveOperation(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, OperationID operationID)Update by IDvoidupdateImportedInterfaceRemoveProperty(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, PropertyID propertyID)Update by IDvoidupdateImportedInterfaceRemoveSubClass(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, MetaClassID subClassID)Update by IDvoidupdateNamespaceAddImport(NamespaceID namespaceID, ImportedInterface importedIface)Update by IDvoidupdateNamespaceRemoveImport(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID)Update by ID
-
-
-
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 namenamespaceID- 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 objectimportedIface- Iface added
-
updateNamespaceRemoveImport
public void updateNamespaceRemoveImport(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID)
Update by ID- Parameters:
namespaceID- ID of objectifaceID- Iface IDcontractID- 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 objectifaceID- Iface IDcontractID- Contract IDpropertyID- Property ID
-
updateImportedInterfaceAddOperation
public void updateImportedInterfaceAddOperation(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, OperationID operationID)
Update by ID- Parameters:
namespaceID- ID of objectifaceID- Iface IDcontractID- Contract IDoperationID- Operation ID
-
updateImportedInterfaceAddImplementation
public void updateImportedInterfaceAddImplementation(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, ImplementationID implementationID)
Update by ID- Parameters:
namespaceID- ID of objectifaceID- Iface IDcontractID- Contract IDimplementationID- Implementation ID
-
updateImportedInterfaceAddSubClass
public void updateImportedInterfaceAddSubClass(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, MetaClassID subClassID)
Update by ID- Parameters:
namespaceID- ID of objectifaceID- Iface IDcontractID- Contract IDsubClassID- MetaClass ID
-
updateImportedInterfaceRemoveProperty
public void updateImportedInterfaceRemoveProperty(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, PropertyID propertyID)
Update by ID- Parameters:
namespaceID- ID of objectifaceID- Iface IDcontractID- Contract IDpropertyID- Property ID
-
updateImportedInterfaceRemoveOperation
public void updateImportedInterfaceRemoveOperation(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, OperationID operationID)
Update by ID- Parameters:
namespaceID- ID of objectifaceID- Iface IDcontractID- Contract IDoperationID- Operation ID
-
updateImportedInterfaceRemoveImplementation
public void updateImportedInterfaceRemoveImplementation(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, ImplementationID implementationID)
Update by ID- Parameters:
namespaceID- ID of objectifaceID- Iface IDcontractID- Contract IDimplementationID- Implementation ID
-
updateImportedInterfaceRemoveSubClass
public void updateImportedInterfaceRemoveSubClass(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, MetaClassID subClassID)
Update by ID- Parameters:
namespaceID- ID of objectifaceID- Iface IDcontractID- Contract IDsubClassID- 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.
-
-