public class ServiceRegistry extends Object
Modifier | Constructor and Description |
---|---|
protected |
ServiceRegistry() |
Modifier and Type | Method and Description |
---|---|
void |
add(org.openrdf.model.URI serviceURI,
ServiceFactory factory)
Register a service.
|
void |
addAlias(org.openrdf.model.URI serviceURI,
org.openrdf.model.URI aliasURI)
Register one URI as an alias for another.
|
void |
addWhitelistURL(String URL)
Add URL to service whitelist
|
Iterator<CustomServiceFactory> |
customServices()
Return an
Iterator providing a read-only view of the registered
CustomServiceFactory s. |
ServiceFactory |
get(org.openrdf.model.URI serviceURI)
Return the
ServiceFactory for that URI. |
ServiceFactory |
getDefaultServiceFactory() |
static ServiceRegistry |
getInstance() |
ServiceFactory |
getNullServiceFactory() |
ServiceFactory |
getServiceFactoryByServiceURI(org.openrdf.model.URI serviceUri)
Maps a URI to a service factory.
|
boolean |
isWhitelistEnabled()
Check if whitelisting is enabled
|
boolean |
remove(org.openrdf.model.URI serviceURI)
Remove a service from the registry and/or set of known aliases.
|
void |
removeWhitelistURL(String URL)
Remove URL to service whitelist
|
void |
setDefaultServiceFactory(ServiceFactory defaultServiceFactory)
Set the default
ServiceFactory . |
void |
setWhitelistEnabled(boolean enable)
Set whitelist status.
|
ServiceCall<? extends Object> |
toServiceCall(AbstractTripleStore store,
org.eclipse.jetty.client.HttpClient cm,
org.openrdf.model.URI serviceURI,
ServiceNode serviceNode,
BaseJoinStats stats)
Resolve a
ServiceCall for a service URI . |
public static ServiceRegistry getInstance()
public void setDefaultServiceFactory(ServiceFactory defaultServiceFactory)
ServiceFactory
. This will be used when the
serviceURI is not associated with an explicitly registered service. For
example, you can use this to control whether or not the service end point
is assumed to support SPARQL 1.0
or SPARQL 1.1
.defaultServiceFactory
- The default ServiceFactory
.IllegalArgumentException
- if the argument is null
.public ServiceFactory getDefaultServiceFactory()
public ServiceFactory getNullServiceFactory()
public final void add(org.openrdf.model.URI serviceURI, ServiceFactory factory)
serviceURI
- The service URI.factory
- The factory to execute calls against that service.public final boolean remove(org.openrdf.model.URI serviceURI)
serviceURI
- The URI of the service -or- the URI of an alias registered
using addAlias(URI, URI)
.true
iff a service for that URI was removed.public final void addAlias(org.openrdf.model.URI serviceURI, org.openrdf.model.URI aliasURI)
serviceURI
- The URI of a service. It is expressly permitted to register an
alias for a URI which does not have a registered
ServiceFactory
. This may be used to alias a remote URI
which you want to intercept locally.aliasURI
- The URI of an alias under which that service may be accessed.IllegalStateException
- if the serviceURI has already been registered as a
alias (you must remove(URI)
the old alias before you
can map it against a different serviceURI).IllegalStateException
- if the aliasURI has already been registered as a
service (you can not mask an existing service registration).public void addWhitelistURL(String URL)
URL
- the URL to addpublic void removeWhitelistURL(String URL)
URL
- the URL to removepublic void setWhitelistEnabled(boolean enable)
enable
- true if enabled, false if disabledpublic boolean isWhitelistEnabled()
public Iterator<CustomServiceFactory> customServices()
Iterator
providing a read-only view of the registered
CustomServiceFactory
s.public ServiceFactory get(org.openrdf.model.URI serviceURI)
ServiceFactory
for that URI. If the URI
is a
known alias, then it is resolved before looking up the
ServiceFactory
.serviceURI
- The URI
.ServiceFactory
if one is registered for that
URI
.public final ServiceCall<? extends Object> toServiceCall(AbstractTripleStore store, org.eclipse.jetty.client.HttpClient cm, org.openrdf.model.URI serviceURI, ServiceNode serviceNode, BaseJoinStats stats)
ServiceCall
for a service URI
. If a
ServiceFactory
was registered for that serviceURI, then it
will be returned. Otherwise getDefaultServiceFactory()
is used
to obtain the ServiceFactory
that will be used to create the
ServiceCall
object for that end point.store
- The AbstractTripleStore
.cm
- The ClientConnectionManager
will be used to make
remote HTTP connections.serviceURI
- The as-bound URI
of the service end point.serviceNode
- The AST model of the SERVICE clause.ServiceCall
for that service.public ServiceFactory getServiceFactoryByServiceURI(org.openrdf.model.URI serviceUri)
serviceUri
- the URI for which we look up the serviceCopyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.