|
NetKernel APIs |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ten60.netkernel.layer1.nkf.impl.NKFHelperImpl
The main helper implementation implements INKFCovenienceHelper
Constructor Summary | |
NKFHelperImpl(Container aContainer,
IRequestorContext aContext,
URRequest aRequest)
Creates a new instance of NKFHelperImpl |
Method Summary | |
IURRepresentation |
createIntermediateRepresentationForAspect(IURAspect aAspect,
String aMimeType)
Create a representation around one aspect that has been internally created and give it the specified mimetype. |
INKFResponse |
createResponseFrom(IURAspect aAspect)
Create a response which should then be configured before being set as the overall response for the accessor. |
INKFResponse |
createResponseFrom(IURRepresentation aRepresentation)
Create a response which should then be configured before being set as the overall response for the accessor. |
INKFRequest |
createSubRequest()
Create a subrequest which can then be configured with target URI, arguments, type etc before being issued to the kernel for scheduling. |
INKFRequest |
createSubRequest(String aURI)
Create a subrequest with a given base URI. |
boolean |
delete(String aURI)
Delete a resource for the given URI |
boolean |
exists(String aURI)
Check for the existence of a resource for the given URI |
IURAspect |
fragment(IURAspect aSource,
String aFragment,
String aMimeType,
Class aAspectClass)
Apply a fragment identifier to an internally created resource. |
String |
getCWU()
Gets the current working URI for created subrequests. |
Container |
getKernel()
Advanced Return a reference to the Kernel Container. |
INKFKernelHelper |
getKernelHelper()
Advanced Return the kernel helper API for a set of low-level APIs for advanced use. |
ModuleDefinition |
getOwningModule()
Advanced Return the owning module of this accessor |
URRequest |
getThisKernelRequest()
Advanced Return the request which initiated this invocation of the accessor |
INKFRequestReadOnly |
getThisRequest()
Return a wrapper around the request which initiated the invocation of this accessor |
void |
handleAsyncException(Exception aException)
log the exception as we cannot throw exception asyncronously |
void |
handleAsyncResponse(IURRepresentation aResponse)
no response can be handled asynchronously |
protected abstract void |
innerIssueAsyncRequest(URRequest aRequest)
|
protected abstract IURRepresentation |
innerIssueSyncRequest(URRequest aRequest)
|
boolean |
isResponseSet()
Test if the response has been set. |
INKFAsyncRequestHandle |
issueAsyncSubRequest(INKFRequest aRequest)
Issue an asynchronous subrequest. |
IURRepresentation |
issueRequest(URRequest aRequest)
Advanced Issue a resource request to the kernel using a URRequest. |
IURRepresentation |
issueSubRequest(INKFRequest aRequest)
Issue a subrequest. |
IURAspect |
issueSubRequestForAspect(INKFRequest aRequest)
Issue a subrequest. |
String |
requestNew(String aURIBase,
IURAspect aOptionalSource)
Request the creation of a new resource |
void |
setCWU(String aURI)
Set the current working URI for created subrequests |
void |
setResponse(INKFResponse aResponse)
Set the response to be returned as the result for the invocation of this accessor |
void |
setResponse(IURRepresentation aResponse)
Advanced Sets the response that will be issued as the result of this invocation of the accessor. |
void |
sinkAspect(String aURI,
IURAspect aAspect)
Sink an aspect to the resource at a URI |
IURRepresentation |
source(String aURI)
Source a resource from its URI |
IURRepresentation |
source(String aURI,
Class aAspectClass)
Source a resource from its URI |
IURAspect |
sourceAspect(String aURI,
Class aAspectClass)
Source a specific aspect of a resource from its URI |
IURAspect |
transrept(IURAspect aSource,
Class aAspectClass)
Transrept a internally created resource into alternative aspect. |
IURAspect |
transrept(IURRepresentation aSource,
Class aAspectClass)
Transrept a internally created resource into alternative aspect. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NKFHelperImpl(Container aContainer, IRequestorContext aContext, URRequest aRequest)
Method Detail |
public Container getKernel()
INKFKernelHelper
getKernel
in interface INKFKernelHelper
public ModuleDefinition getOwningModule()
INKFKernelHelper
getOwningModule
in interface INKFKernelHelper
public URRequest getThisKernelRequest() throws NKFException
INKFKernelHelper
getThisKernelRequest
in interface INKFKernelHelper
NKFException
- thrown if no parent request initiated this invocationpublic IURRepresentation issueRequest(URRequest aRequest) throws NetKernelException
INKFKernelHelper
issueRequest
in interface INKFKernelHelper
aRequest
-
NetKernelException
public void setResponse(IURRepresentation aResponse)
INKFKernelHelper
setResponse
in interface INKFKernelHelper
aResponse
- an IURRepresentationpublic INKFRequestReadOnly getThisRequest() throws NKFException
INKFBasicHelper
getThisRequest
in interface INKFBasicHelper
NKFException
- thrown if no parent request initiated this invocationpublic INKFResponse createResponseFrom(IURRepresentation aRepresentation)
INKFBasicHelper
createResponseFrom
in interface INKFBasicHelper
aRepresentation
- a representation who aspects and metadata
should be used as the basis for the responsepublic INKFResponse createResponseFrom(IURAspect aAspect)
INKFBasicHelper
createResponseFrom
in interface INKFBasicHelper
aAspect
- an aspect which should be used as the basis for the responsepublic void setResponse(INKFResponse aResponse)
INKFBasicHelper
setResponse
in interface INKFBasicHelper
aResponse
- a response object as created by createResponseFrom methods.
If no response is set then a default Void aspect result is returned. It is an error
to set the response to null for anything other than an accessor - in this case it
has the effect of causing the accessor to not issue a response (this must be used
with care in combination with INFKAsyncRequestListener.)public INKFRequest createSubRequest()
INKFBasicHelper
createSubRequest
in interface INKFBasicHelper
public INKFRequest createSubRequest(String aURI) throws NKFException
INKFBasicHelper
createSubRequest
in interface INKFBasicHelper
aURI
-
NKFException
- thrown if aURI is relative and cwu not inherited from parentpublic IURRepresentation issueSubRequest(INKFRequest aRequest) throws NKFException
INKFBasicHelper
issueSubRequest
in interface INKFBasicHelper
aRequest
-
NKFException
- if there is a failure executing the requestpublic IURAspect issueSubRequestForAspect(INKFRequest aRequest) throws NKFException
INKFBasicHelper
issueSubRequestForAspect
in interface INKFBasicHelper
aRequest
-
NKFException
- if there is a failure executing the requestpublic INKFAsyncRequestHandle issueAsyncSubRequest(INKFRequest aRequest) throws NKFException
INKFBasicHelper
issueAsyncSubRequest
in interface INKFBasicHelper
aRequest
-
NKFException
public void setCWU(String aURI)
INKFBasicHelper
setCWU
in interface INKFBasicHelper
aURI
- the new current working URI, may be null
so signify that relative URIs cannot be resolved.public String getCWU()
INKFBasicHelper
getCWU
in interface INKFBasicHelper
public void sinkAspect(String aURI, IURAspect aAspect) throws NKFException
INKFConvenienceHelper
sinkAspect
in interface INKFConvenienceHelper
aURI
- aAspect
-
NKFException
public IURRepresentation source(String aURI) throws NKFException
INKFConvenienceHelper
source
in interface INKFConvenienceHelper
aURI
-
NKFException
public IURRepresentation source(String aURI, Class aAspectClass) throws NKFException
INKFConvenienceHelper
source
in interface INKFConvenienceHelper
aURI
- aAspectClass
-
NKFException
public IURAspect sourceAspect(String aURI, Class aAspectClass) throws NKFException
INKFConvenienceHelper
sourceAspect
in interface INKFConvenienceHelper
aURI
- aAspectClass
-
NKFException
public IURAspect transrept(IURAspect aSource, Class aAspectClass) throws NKFException
INKFConvenienceHelper
transrept
in interface INKFConvenienceHelper
aSource
- An internally generated resourceaAspectClass
- The class of the desired aspect for the resource
NKFException
- thrown if no transreptor available or transreptor failspublic IURAspect transrept(IURRepresentation aSource, Class aAspectClass) throws NKFException
INKFConvenienceHelper
transrept
in interface INKFConvenienceHelper
aSource
- An internally generated resourceaAspectClass
- The class of the desired aspect for the resource
NKFException
- thrown if no transreptor available or transreptor failspublic IURAspect fragment(IURAspect aSource, String aFragment, String aMimeType, Class aAspectClass) throws NKFException
INKFConvenienceHelper
fragment
in interface INKFConvenienceHelper
aSource
- An internally generated resourceaFragment
- A valid fragment identifier stringaMimeType
- The mimetype of the resourceaAspectClass
- The class of the desired aspect for the resource
NKFException
- thrown if no transreptor available or transreptor failspublic String requestNew(String aURIBase, IURAspect aOptionalSource) throws NKFException
INKFConvenienceHelper
requestNew
in interface INKFConvenienceHelper
aURIBase
- A base URI that can identify which accessor to target
the request ataOptionalSource
- Optional resource aspect that the accessor can
use to seed the state of the new resource.
NKFException
- Thrown if no accessor could be located or it
didn't support the NEW operation or the failed for some other accessor
specific reason.public boolean exists(String aURI) throws NKFException
INKFConvenienceHelper
exists
in interface INKFConvenienceHelper
NKFException
public boolean delete(String aURI) throws NKFException
INKFConvenienceHelper
delete
in interface INKFConvenienceHelper
NKFException
protected abstract void innerIssueAsyncRequest(URRequest aRequest)
protected abstract IURRepresentation innerIssueSyncRequest(URRequest aRequest) throws NetKernelException
NetKernelException
public IURRepresentation createIntermediateRepresentationForAspect(IURAspect aAspect, String aMimeType)
INKFConvenienceHelper
createIntermediateRepresentationForAspect
in interface INKFConvenienceHelper
aAspect
- the single aspect it should containaMimeType
- the mimetype of the representationpublic INKFKernelHelper getKernelHelper()
INKFBasicHelper
getKernelHelper
in interface INKFBasicHelper
public void handleAsyncResponse(IURRepresentation aResponse)
public void handleAsyncException(Exception aException)
public boolean isResponseSet()
INKFBasicHelper
isResponseSet
in interface INKFBasicHelper
|
NetKernel APIs |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |