public class TcProviderMultiplexer extends Object implements TcProvider
Modifier and Type | Field and Description |
---|---|
protected SortedSet<WeightedTcProvider> |
providerList |
Constructor and Description |
---|
TcProviderMultiplexer() |
Modifier and Type | Method and Description |
---|---|
void |
addWeightedTcProvider(WeightedTcProvider provider)
Registers a provider
|
Graph |
createGraph(UriRef name,
TripleCollection triples)
Creates a
Graph with a specified name |
LockableMGraph |
createMGraph(UriRef name)
Creates an initially empty
MGraph with a specified name |
void |
deleteTripleCollection(UriRef name)
Deletes the
Graph or MGraph of a specified name. |
Graph |
getGraph(UriRef name)
Get a
Graph by its name |
LockableMGraph |
getMGraph(UriRef name)
Get an
MGraph by its name. |
Set<UriRef> |
getNames(Graph graph)
get a set of the names of a
Graph |
SortedSet<WeightedTcProvider> |
getProviderList() |
TripleCollection |
getTriples(UriRef name)
This method is used to get a
TripleCollection indifferently
whether it's a Graph or an MGraph. |
protected void |
graphAppears(UriRef name)
subclasses overwrite this method to be notified when a new
Graph is available (either because it has been created or being
provided by a newly added WeightedTcProvider).
|
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. |
protected void |
mGraphAppears(UriRef name)
subclasses overwrite this method to be notified when a new
MGraph is available (either because it has been created or being
provided by a newly added WeightedTcProvider).
|
void |
removeWeightedTcProvider(WeightedTcProvider provider)
Unregister a provider
|
protected void |
tcDisappears(UriRef name)
subclasses overwrite this method to be notified whenTripleCollection is
no longer available (either because it has been deleted or bacause its
WeightedTcProvider was removed).
|
protected SortedSet<WeightedTcProvider> providerList
public void addWeightedTcProvider(WeightedTcProvider provider)
provider
- the provider to be registeredpublic void removeWeightedTcProvider(WeightedTcProvider provider)
provider
- the provider to be deregisteredprotected void graphAppears(UriRef name)
name
- protected void mGraphAppears(UriRef name)
name
- protected void tcDisappears(UriRef name)
name
- 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 LockableMGraph 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 LockableMGraph createMGraph(UriRef name) throws UnsupportedOperationException
TcProvider
MGraph
with a specified namecreateMGraph
in interface TcProvider
name
- names the new MGraph
MGraph
UnsupportedOperationException
- if this provider doesn't support
creating MGraph
Spublic Graph createGraph(UriRef name, TripleCollection triples)
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
public void deleteTripleCollection(UriRef name)
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 removedpublic Set<UriRef> getNames(Graph graph)
TcProvider
Graph
getNames
in interface TcProvider
Graph
, the set is empty if
Graph
is unknownpublic 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 SortedSet<WeightedTcProvider> getProviderList()
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.