public class SpecManagerImpl extends Object implements SpecManager
Modifier and Type | Field and Description |
---|---|
protected ModelLoader |
modelLoader |
protected Router |
router |
protected Map<String,SpecEntry> |
specs |
Constructor and Description |
---|
SpecManagerImpl(Router router,
ModelLoader modelLoader) |
Modifier and Type | Method and Description |
---|---|
APISpec |
addSpec(String prefixPath,
String appName,
String context,
String uri,
String key,
com.hp.hpl.jena.rdf.model.Model spec)
Load and record the specification for a new API (which might
be associated with multiple APIEndpoints).
|
List<SpecEntry> |
allSpecs()
Answer a list of all the specs in this manager.
|
void |
deleteSpec(String context,
String uri,
String key)
Remove the specification for an API.
|
APISpec |
getAPISpec(com.hp.hpl.jena.rdf.model.Resource specRoot)
Get an APISpec object for the given spec
|
com.hp.hpl.jena.rdf.model.Model |
getSpecForAPI(String api)
Return the RDF model which specifies a particular API
|
com.hp.hpl.jena.rdf.model.Model |
getSpecForEndpoint(String url)
Return the RDF model which specifies the API corresponding to
and endpoint matching the given URL.
|
void |
loadSpecFor(String uriRequest)
Request that the specification which includes an APIEndpoint matching the
given request URL be located and loaded into the routing table.
|
APISpec |
updateSpec(String prefixPath,
String appName,
String context,
String uri,
String key,
com.hp.hpl.jena.rdf.model.Model spec)
Update the specification for an API.
|
protected Router router
protected ModelLoader modelLoader
public SpecManagerImpl(Router router, ModelLoader modelLoader)
public APISpec addSpec(String prefixPath, String appName, String context, String uri, String key, com.hp.hpl.jena.rdf.model.Model spec) throws APISecurityException
SpecManager
addSpec
in interface SpecManager
uri
- The uri for the RDF resource which identifies this API specification.key
- An arbitrary key to identify the provider of the specification.spec
- An RDF model containing the specification of the API and its
associate endpoints.APISecurityException
- if the key does match the key used to create the matching existing entrypublic void deleteSpec(String context, String uri, String key) throws APISecurityException
SpecManager
deleteSpec
in interface SpecManager
uri
- The uri for the RDF resource which identifies this API specification.key
- An arbitrary key to identify the provider of the specification.APISecurityException
- if the key does match the key used to create the matching existing entrypublic void loadSpecFor(String uriRequest)
SpecManager
loadSpecFor
in interface SpecManager
uriRequest
- the incoming request with the server root removedpublic APISpec updateSpec(String prefixPath, String appName, String context, String uri, String key, com.hp.hpl.jena.rdf.model.Model spec) throws APISecurityException
SpecManager
updateSpec
in interface SpecManager
uri
- The uri for the RDF resource which identifies this API specification.key
- An arbitrary key to identify the provider of the specification.spec
- An RDF model containing the specification of the API and its
associate endpoints.APISecurityException
- if the key does match the key used to create the matching existing entrypublic com.hp.hpl.jena.rdf.model.Model getSpecForAPI(String api)
SpecManager
getSpecForAPI
in interface SpecManager
api
- the URI of the RDF resource identifying the APIpublic com.hp.hpl.jena.rdf.model.Model getSpecForEndpoint(String url)
SpecManager
getSpecForEndpoint
in interface SpecManager
public List<SpecEntry> allSpecs()
SpecManager
allSpecs
in interface SpecManager
public APISpec getAPISpec(com.hp.hpl.jena.rdf.model.Resource specRoot)
SpecManager
getAPISpec
in interface SpecManager
Copyright © 2014. All Rights Reserved.