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 void
close()
Close DB.void
createTables()
Create tables of MDS.void
deleteNamespaceByID(NamespaceID namespaceID)
Delete by IDvoid
dropTables()
Delete the tables of MDS.boolean
existsObjectByID(NamespaceID dataClayID)
Check if namespace existsList<Namespace>
getAllNamespacesImportingClass(MetaClassID classID)
Get Namespaces using classNamespace
getNamespaceByID(NamespaceID namespaceID)
Get by IDNamespace
getNamespaceByName(String name)
Get by nameNamespace
getNamespaceByNameAndID(String name, NamespaceID namespaceID)
Get by name and idSet<String>
getNamespacesNames()
Get by nameList<Namespace>
getNamespacesWithProvider(AccountID providerAccountID)
Get Namespaces containing providervoid
store(Namespace namespace)
Store namespace into databasevoid
updateImportedInterfaceAddImplementation(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, ImplementationID implementationID)
Update by IDvoid
updateImportedInterfaceAddOperation(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, OperationID operationID)
Update by IDvoid
updateImportedInterfaceAddProperty(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, PropertyID propertyID)
Update by IDvoid
updateImportedInterfaceAddSubClass(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, MetaClassID subClassID)
Update by IDvoid
updateImportedInterfaceRemoveImplementation(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, ImplementationID implementationID)
Update by IDvoid
updateImportedInterfaceRemoveOperation(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, OperationID operationID)
Update by IDvoid
updateImportedInterfaceRemoveProperty(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, PropertyID propertyID)
Update by IDvoid
updateImportedInterfaceRemoveSubClass(NamespaceID namespaceID, InterfaceID ifaceID, ContractID contractID, MetaClassID subClassID)
Update by IDvoid
updateNamespaceAddImport(NamespaceID namespaceID, ImportedInterface importedIface)
Update by IDvoid
updateNamespaceRemoveImport(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.
-
-