public class APIEndpointImpl extends Object implements APIEndpoint
APIEndpoint.Request
Modifier and Type | Field and Description |
---|---|
protected Cache |
cache |
protected APIEndpointSpec |
spec |
protected boolean |
specWantsContext |
Constructor and Description |
---|
APIEndpointImpl(APIEndpointSpec spec) |
APIEndpointImpl(APIEndpointSpec spec,
Cache cache) |
Modifier and Type | Method and Description |
---|---|
ResponseResult |
call(APIEndpoint.Request r,
NoteBoard nb)
Called by the Router to invoke the API and return set of result matches
|
Bindings |
defaults()
Return any default bindings that this endpoint has set up (which need
not be ones specified by a config).
|
com.hp.hpl.jena.rdf.model.Resource |
getMetadata(Bindings context,
URI ru,
String formatName,
com.hp.hpl.jena.rdf.model.Model metadata)
Return a metadata description for the query that would be run by this endpoint
|
String |
getPrefixPath()
Return this endpoints prefix path, which is the prefix path of its
parent API spec.
|
Renderer |
getRendererByType(MediaType mt)
Answer a Renderer appropriate to the given MediaType
mt ,
configured with the appropriate shortname service. |
Renderer |
getRendererNamed(String name)
Answer a Renderer of the format named
name , configured
with the appropriate shortname service. |
String |
getSelectQuery()
Answer the SELECT query that would be used in the current
state of this endpoint to find the items of interest.
|
APIEndpointSpec |
getSpec()
Return the specification for this endpoint
|
String |
getURITemplate()
The URI template at which this APIEndpoint should be attached
|
String |
toString() |
protected final APIEndpointSpec spec
protected final boolean specWantsContext
protected final Cache cache
public APIEndpointImpl(APIEndpointSpec spec)
public APIEndpointImpl(APIEndpointSpec spec, Cache cache)
public String getPrefixPath()
getPrefixPath
in interface APIEndpoint
public Bindings defaults()
APIEndpoint
defaults
in interface APIEndpoint
public ResponseResult call(APIEndpoint.Request r, NoteBoard nb)
APIEndpoint
call
in interface APIEndpoint
r
- the requestpublic com.hp.hpl.jena.rdf.model.Resource getMetadata(Bindings context, URI ru, String formatName, com.hp.hpl.jena.rdf.model.Model metadata)
getMetadata
in interface APIEndpoint
public String getURITemplate()
getURITemplate
in interface APIEndpoint
public APIEndpointSpec getSpec()
getSpec
in interface APIEndpoint
public String getSelectQuery()
public Renderer getRendererNamed(String name)
name
, configured
with the appropriate shortname service.getRendererNamed
in interface APIEndpoint
public Renderer getRendererByType(MediaType mt)
mt
,
configured with the appropriate shortname service.getRendererByType
in interface APIEndpoint
Copyright © 2014. All Rights Reserved.