@Service(value=WeightedTcProvider.class) public class SystemConfig extends Object implements WeightedTcProvider
SystemConfig
component is activated it checks if the system
graph exists, in case it does not exist then it creates the system graph and
writes the default platform configuration into it.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_SYSTEM_GRAPH |
static String |
PARSER_FILTER |
static String |
SERIALIZER_FILTER |
static String |
SYSTEM_GRAPH_FILTER
A filter that can be used to get the system graph as OSGi service, that
is provided by
org.apache.clerezza.rdf.core.access.TcManager . |
static UriRef |
SYSTEM_GRAPH_URI
Deprecated.
use org.apache.clerezza.platform.Contants instead
|
Constructor and Description |
---|
SystemConfig() |
Modifier and Type | Method and Description |
---|---|
protected void |
activate(org.osgi.service.component.ComponentContext componentContext) |
Graph |
createGraph(UriRef name,
TripleCollection triples)
Creates a
Graph with a specified name |
MGraph |
createMGraph(UriRef name)
Creates an initially empty
MGraph with a specified name |
protected void |
deactivate(org.osgi.service.component.ComponentContext componentContext) |
void |
deleteTripleCollection(UriRef name)
Deletes the
Graph or MGraph of a specified name. |
Graph |
getGraph(UriRef name)
Get a
Graph by its name |
MGraph |
getMGraph(UriRef name)
Get an
MGraph by its name. |
Set<UriRef> |
getNames(Graph graph)
get a set of the names of a
Graph |
TripleCollection |
getTriples(UriRef name)
This method is used to get a
TripleCollection indifferently
whether it's a Graph or an MGraph. |
int |
getWeight()
Get the weight of this provider.
|
Set<UriRef> |
listGraphs()
Lists the name of the
Graph s available through this
TcProvider , implementations may take into account the
security context and omit Graph s for which access is not
allowed. |
Set<UriRef> |
listMGraphs()
Lists the name of the
MGraph s available through this
TcProvider , implementations may take into account the
security context and omit MGraph s for which access is not
allowed. |
Set<UriRef> |
listTripleCollections()
Lists the name of the
TripleCollection s available through this
TcProvider indifferently whether they are Graphs or an
MGraphs, implementations may take into account the security context and
omit TripleCollection s for which access is not allowed. |
public static final String DEFAULT_SYSTEM_GRAPH
@Deprecated public static final UriRef SYSTEM_GRAPH_URI
public static final String SYSTEM_GRAPH_FILTER
org.apache.clerezza.rdf.core.access.TcManager
.public static final String PARSER_FILTER
public static final String SERIALIZER_FILTER
protected void activate(org.osgi.service.component.ComponentContext componentContext)
protected void deactivate(org.osgi.service.component.ComponentContext componentContext)
public int getWeight()
WeightedTcProvider
TcManager
will prioritize
TcProvider
s with greater weight.getWeight
in interface WeightedTcProvider
public Graph getGraph(UriRef name) throws NoSuchEntityException
TcProvider
Graph
by its namegetGraph
in interface TcProvider
name
- the name of the GraphGraph
with the specified nameNoSuchEntityException
- if there is no Graph
with the specified namepublic MGraph getMGraph(UriRef name) throws NoSuchEntityException
TcProvider
MGraph
by its name. The instances
returned in different invocations are equals
.getMGraph
in interface TcProvider
MGraph
with the specified nameNoSuchEntityException
- if there is no MGraph
with the specified namepublic TripleCollection getTriples(UriRef name) throws NoSuchEntityException
TcProvider
TripleCollection
indifferently
whether it's a Graph or an MGraph. If the name
names an
MGraph
the result is the same as when invoking
getMGraph
with that argument, analogously for
Graph
S the method returns an instance equals to what
getGraph
would return.getTriples
in interface TcProvider
name
- the name of the Graph
or MGraph
Graph
or MGraph
NoSuchEntityException
- if there is no Graph
or MGraph
with the specified namepublic Set<UriRef> listGraphs()
TcProvider
Graph
s available through this
TcProvider
, implementations may take into account the
security context and omit Graph
s for which access is not
allowed.listGraphs
in interface TcProvider
Graph
spublic Set<UriRef> listMGraphs()
TcProvider
MGraph
s available through this
TcProvider
, implementations may take into account the
security context and omit MGraph
s for which access is not
allowed.listMGraphs
in interface TcProvider
MGraph
spublic Set<UriRef> listTripleCollections()
TcProvider
TripleCollection
s available through this
TcProvider
indifferently whether they are Graphs or an
MGraphs, implementations may take into account the security context and
omit TripleCollection
s for which access is not allowed.listTripleCollections
in interface TcProvider
TripleCollection
spublic MGraph createMGraph(UriRef name) throws UnsupportedOperationException, EntityAlreadyExistsException
TcProvider
MGraph
with a specified namecreateMGraph
in interface TcProvider
name
- names the new MGraph
MGraph
UnsupportedOperationException
- if this provider doesn't support
creating MGraph
SEntityAlreadyExistsException
- if an MGraph with the specified name
already existspublic Graph createGraph(UriRef name, TripleCollection triples) throws UnsupportedOperationException, EntityAlreadyExistsException
TcProvider
Graph
with a specified namecreateGraph
in interface TcProvider
name
- the name of the Graph
to be createdtriples
- the triples of the new Graph
Graph
UnsupportedOperationException
- if this provider doesn't support
creating Graph
SEntityAlreadyExistsException
- if a Graph with the specified name
already existspublic void deleteTripleCollection(UriRef name) throws UnsupportedOperationException, NoSuchEntityException, EntityUndeletableException
TcProvider
Graph
or MGraph
of a specified name.
If name
references a Graph and the graph has other names, it
will still be available with those other names.deleteTripleCollection
in interface TcProvider
name
- the entity to be removedUnsupportedOperationException
- if this provider doesn't support
entities deletion.NoSuchEntityException
- if name
doesn't refer to a
Graph
or an MGraph
.EntityUndeletableException
- if the specified Graph is undeletablepublic Set<UriRef> getNames(Graph graph)
TcProvider
Graph
getNames
in interface TcProvider
Graph
, the set is empty if
Graph
is unknownCopyright © 2014 The Apache Software Foundation. All Rights Reserved.