Package org.trellisldp.jdbc
Class DBNamespaceService
- java.lang.Object
-
- org.trellisldp.jdbc.DBNamespaceService
-
- All Implemented Interfaces:
NamespaceService
@Alternative public class DBNamespaceService extends Object implements NamespaceService
A namespace service that stores data in a database.
-
-
Constructor Summary
Constructors Constructor Description DBNamespaceService()Create a namespace service.DBNamespaceService(DataSource ds)Create a namespace service.DBNamespaceService(org.jdbi.v3.core.Jdbi jdbi)Create a namespace service.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>getNamespaces()Fetch the entire namespace mapping.booleansetPrefix(String prefix, String namespace)Set the namespace for a given prefix.
-
-
-
Constructor Detail
-
DBNamespaceService
public DBNamespaceService()
Create a namespace service.Note: this is generally used for CDI proxies and should not be invoked directly
-
DBNamespaceService
@Inject public DBNamespaceService(DataSource ds)
Create a namespace service.- Parameters:
ds- the datasource
-
DBNamespaceService
public DBNamespaceService(org.jdbi.v3.core.Jdbi jdbi)
Create a namespace service.- Parameters:
jdbi- the Jdbi object
-
-
Method Detail
-
getNamespaces
public Map<String,String> getNamespaces()
Description copied from interface:NamespaceServiceFetch the entire namespace mapping.- Specified by:
getNamespacesin interfaceNamespaceService- Returns:
- the namespace mapping as prefix, namespace pairs
-
setPrefix
public boolean setPrefix(String prefix, String namespace)
Description copied from interface:NamespaceServiceSet the namespace for a given prefix.- Specified by:
setPrefixin interfaceNamespaceService- Parameters:
prefix- the prefixnamespace- the namespace- Returns:
- whether the new prefix was set
-
-