|
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
public abstract class 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,
java.lang.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(java.lang.String aURI)
Create a subrequest with a given base URI. |
boolean |
delete(java.lang.String aURI)
Delete a resource for the given URI |
boolean |
exists(java.lang.String aURI)
Check for the existence of a resource for the given URI |
IURAspect |
fragment(IURAspect aSource,
java.lang.String aFragment,
java.lang.String aMimeType,
java.lang.Class aAspectClass)
Apply a fragment identifier to an internally created resource. |
java.lang.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(java.lang.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)
|
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. |
java.lang.String |
requestNew(java.lang.String aURIBase,
IURAspect aOptionalSource)
Request the creation of a new resource |
void |
setCWU(java.lang.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(java.lang.String aURI,
IURAspect aAspect)
Sink an aspect to the resource at a URI |
IURRepresentation |
source(java.lang.String aURI)
Source a resource from its URI |
IURRepresentation |
source(java.lang.String aURI,
java.lang.Class aAspectClass)
Source a resource from its URI |
IURAspect |
sourceAspect(java.lang.String aURI,
java.lang.Class aAspectClass)
Source a specific aspect of a resource from its URI |
IURAspect |
transrept(IURAspect aSource,
java.lang.Class aAspectClass)
Transrept a internally created resource into alternative aspect. |
IURAspect |
transrept(IURRepresentation aSource,
java.lang.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 INKFKernelHelperpublic ModuleDefinition getOwningModule()
INKFKernelHelper
getOwningModule in interface INKFKernelHelper
public URRequest getThisKernelRequest()
throws NKFException
INKFKernelHelper
getThisKernelRequest in interface INKFKernelHelperNKFException - thrown if no parent request initiated this invocation
public IURRepresentation issueRequest(URRequest aRequest)
throws NetKernelException
INKFKernelHelper
issueRequest in interface INKFKernelHelperNetKernelExceptionpublic void setResponse(IURRepresentation aResponse)
INKFKernelHelper
setResponse in interface INKFKernelHelperaResponse - an IURRepresentation
public INKFRequestReadOnly getThisRequest()
throws NKFException
INKFBasicHelper
getThisRequest in interface INKFBasicHelperNKFException - thrown if no parent request initiated this invocationpublic INKFResponse createResponseFrom(IURRepresentation aRepresentation)
INKFBasicHelper
createResponseFrom in interface INKFBasicHelperaRepresentation - a representation who aspects and metadata
should be used as the basis for the responsepublic INKFResponse createResponseFrom(IURAspect aAspect)
INKFBasicHelper
createResponseFrom in interface INKFBasicHelperaAspect - an aspect which should be used as the basis for the responsepublic void setResponse(INKFResponse aResponse)
INKFBasicHelper
setResponse in interface INKFBasicHelperaResponse - 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(java.lang.String aURI)
throws NKFException
INKFBasicHelper
createSubRequest in interface INKFBasicHelperNKFException - thrown if aURI is relative and cwu not inherited from parent
public IURRepresentation issueSubRequest(INKFRequest aRequest)
throws NKFException
INKFBasicHelper
issueSubRequest in interface INKFBasicHelperNKFException - if there is a failure executing the request
public IURAspect issueSubRequestForAspect(INKFRequest aRequest)
throws NKFException
INKFBasicHelper
issueSubRequestForAspect in interface INKFBasicHelperNKFException - if there is a failure executing the request
public INKFAsyncRequestHandle issueAsyncSubRequest(INKFRequest aRequest)
throws NKFException
INKFBasicHelper
issueAsyncSubRequest in interface INKFBasicHelperNKFExceptionpublic void setCWU(java.lang.String aURI)
INKFBasicHelper
setCWU in interface INKFBasicHelperaURI - the new current working URI, may be null
so signify that relative URIs cannot be resolved.public java.lang.String getCWU()
INKFBasicHelper
getCWU in interface INKFBasicHelper
public void sinkAspect(java.lang.String aURI,
IURAspect aAspect)
throws NKFException
INKFConvenienceHelper
sinkAspect in interface INKFConvenienceHelperNKFException
public IURRepresentation source(java.lang.String aURI)
throws NKFException
INKFConvenienceHelper
source in interface INKFConvenienceHelperNKFException
public IURRepresentation source(java.lang.String aURI,
java.lang.Class aAspectClass)
throws NKFException
INKFConvenienceHelper
source in interface INKFConvenienceHelperNKFException
public IURAspect sourceAspect(java.lang.String aURI,
java.lang.Class aAspectClass)
throws NKFException
INKFConvenienceHelper
sourceAspect in interface INKFConvenienceHelperNKFException
public IURAspect transrept(IURAspect aSource,
java.lang.Class aAspectClass)
throws NKFException
INKFConvenienceHelper
transrept in interface INKFConvenienceHelperaSource - An internally generated resourceaAspectClass - The class of the desired aspect for the resource
NKFException - thrown if no transreptor available or transreptor fails
public IURAspect transrept(IURRepresentation aSource,
java.lang.Class aAspectClass)
throws NKFException
INKFConvenienceHelper
transrept in interface INKFConvenienceHelperaSource - An internally generated resourceaAspectClass - The class of the desired aspect for the resource
NKFException - thrown if no transreptor available or transreptor fails
public IURAspect fragment(IURAspect aSource,
java.lang.String aFragment,
java.lang.String aMimeType,
java.lang.Class aAspectClass)
throws NKFException
INKFConvenienceHelper
fragment in interface INKFConvenienceHelperaSource - 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 fails
public java.lang.String requestNew(java.lang.String aURIBase,
IURAspect aOptionalSource)
throws NKFException
INKFConvenienceHelper
requestNew in interface INKFConvenienceHelperaURIBase - 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(java.lang.String aURI)
throws NKFException
INKFConvenienceHelper
exists in interface INKFConvenienceHelperNKFException
public boolean delete(java.lang.String aURI)
throws NKFException
INKFConvenienceHelper
delete in interface INKFConvenienceHelperNKFExceptionprotected abstract void innerIssueAsyncRequest(URRequest aRequest)
protected abstract IURRepresentation innerIssueSyncRequest(URRequest aRequest)
throws NetKernelException
NetKernelException
public IURRepresentation createIntermediateRepresentationForAspect(IURAspect aAspect,
java.lang.String aMimeType)
INKFConvenienceHelper
createIntermediateRepresentationForAspect in interface INKFConvenienceHelperaAspect - the single aspect it should containaMimeType - the mimetype of the representationpublic INKFKernelHelper getKernelHelper()
INKFBasicHelper
getKernelHelper in interface INKFBasicHelperpublic void handleAsyncResponse(IURRepresentation aResponse)
public void handleAsyncException(java.lang.Exception aException)
|
NetKernel APIs |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||