NetKernel APIs


org.ten60.netkernel.layer1.nkf
Interface INKFBasicHelper

All Known Subinterfaces:
INKFConvenienceHelper
All Known Implementing Classes:
NKFHelperImpl

public interface INKFBasicHelper

High-level helper methods for implementing accessors. This Interface provides methods that will cover 80% of Accessor development cases. For additional convenience methods to source/sink resources see INKFConvenienceHelper


Method Summary
 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.
 String getCWU()
          Gets the current working URI for created subrequests.
 INKFKernelHelper getKernelHelper()
          Advanced Return the kernel helper API for a set of low-level APIs for advanced use.
 INKFRequestReadOnly getThisRequest()
          Return a wrapper around the request which initiated the invocation of this accessor
 boolean isResponseSet()
          Test if the response has been set.
 INKFAsyncRequestHandle issueAsyncSubRequest(INKFRequest aRequest)
          Issue an asynchronous subrequest.
 IURRepresentation issueSubRequest(INKFRequest aRequest)
          Issue a subrequest.
 IURAspect issueSubRequestForAspect(INKFRequest aRequest)
          Issue a subrequest.
 void setCWU(String aCWU)
          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
 

Method Detail

getThisRequest

public INKFRequestReadOnly getThisRequest()
                                   throws NKFException
Return a wrapper around the request which initiated the invocation of this accessor

Throws:
NKFException - thrown if no parent request initiated this invocation

createSubRequest

public INKFRequest createSubRequest()
Create a subrequest which can then be configured with target URI, arguments, type etc before being issued to the kernel for scheduling. A subrequest will automatically acquire the calling request as its parent.


createSubRequest

public INKFRequest createSubRequest(String aURI)
                             throws NKFException
Create a subrequest with a given base URI. Equivalent to calling createSubRequest().setURI(aURI)

Parameters:
aURI -
Throws:
NKFException - thrown if aURI is relative and cwu not inherited from parent

issueSubRequest

public IURRepresentation issueSubRequest(INKFRequest aRequest)
                                  throws NKFException
Issue a subrequest. Make a secondary request to the kernel for scheduling. The request is synchronous.

Parameters:
aRequest -
Returns:
the resulting resource representation
Throws:
NKFException - if there is a failure executing the request

issueSubRequestForAspect

public IURAspect issueSubRequestForAspect(INKFRequest aRequest)
                                   throws NKFException
Issue a subrequest. Make a secondary request to the kernel for scheduling. The request is synchronous.

Parameters:
aRequest -
Returns:
the chosen aspect from the resulting resource representation
Throws:
NKFException - if there is a failure executing the request

issueAsyncSubRequest

public INKFAsyncRequestHandle issueAsyncSubRequest(INKFRequest aRequest)
                                            throws NKFException
Issue an asynchronous subrequest. Make a secondary request to the kernel for scheduling

Parameters:
aRequest -
Returns:
Throws:
NKFException

setCWU

public void setCWU(String aCWU)
Set the current working URI for created subrequests

Parameters:
aCWU - the new current working URI, may be null so signify that relative URIs cannot be resolved.

getCWU

public String getCWU()
Gets the current working URI for created subrequests. By default this value is inherited from the request which initiated the accessor. This value may be null- in which case relative URI resolution will fail

Returns:
the current working URI

createResponseFrom

public INKFResponse createResponseFrom(IURRepresentation aRepresentation)
Create a response which should then be configured before being set as the overall response for the accessor.

Parameters:
aRepresentation - a representation who aspects and metadata should be used as the basis for the response

createResponseFrom

public INKFResponse createResponseFrom(IURAspect aAspect)
Create a response which should then be configured before being set as the overall response for the accessor.

Parameters:
aAspect - an aspect which should be used as the basis for the response

setResponse

public void setResponse(INKFResponse aResponse)
Set the response to be returned as the result for the invocation of this accessor

Parameters:
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.)

getKernelHelper

public INKFKernelHelper getKernelHelper()
Advanced Return the kernel helper API for a set of low-level APIs for advanced use.


isResponseSet

public boolean isResponseSet()
Test if the response has been set.

Returns:
boolean

NetKernel APIs


Copyright © 2002-2004 1060 Research Ltd. All Rights Reserved.