NetKernel APIs


org.ten60.netkernel.layer1.nkf
Interface INKFConvenienceHelper

All Superinterfaces:
INKFBasicHelper
All Known Implementing Classes:
NKFHelperImpl

public interface INKFConvenienceHelper
extends INKFBasicHelper

Convenience helper methods for sourcing and sinking resources. Implemented over INKFBasicHelper


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.
 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 requestNew(String aURIBase, IURAspect aOptionalSource)
          Request the creation of a new resource
 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 interface org.ten60.netkernel.layer1.nkf.INKFBasicHelper
createResponseFrom, createResponseFrom, createSubRequest, createSubRequest, getCWU, getKernelHelper, getThisRequest, isResponseSet, issueAsyncSubRequest, issueSubRequest, issueSubRequestForAspect, setCWU, setResponse
 

Method Detail

source

public IURRepresentation source(String aURI)
                         throws NKFException
Source a resource from its URI

Parameters:
aURI -
Throws:
NKFException

source

public IURRepresentation source(String aURI,
                                Class aAspectClass)
                         throws NKFException
Source a resource from its URI

Parameters:
aURI -
aAspectClass -
Throws:
NKFException

sourceAspect

public IURAspect sourceAspect(String aURI,
                              Class aAspectClass)
                       throws NKFException
Source a specific aspect of a resource from its URI

Parameters:
aURI -
aAspectClass -
Throws:
NKFException

sinkAspect

public void sinkAspect(String aURI,
                       IURAspect aAspect)
                throws NKFException
Sink an aspect to the resource at a URI

Parameters:
aURI -
aAspect -
Throws:
NKFException

exists

public boolean exists(String aURI)
               throws NKFException
Check for the existence of a resource for the given URI

Throws:
NKFException

delete

public boolean delete(String aURI)
               throws NKFException
Delete a resource for the given URI

Returns:
true if it was deleted
Throws:
NKFException

transrept

public IURAspect transrept(IURAspect aSource,
                           Class aAspectClass)
                    throws NKFException
Transrept a internally created resource into alternative aspect. There must be a registered Transreptor capable of performing the transrepresentation. - Do not use to transrept external resources source these using one of the methods which take an aspect class parameter.

Parameters:
aSource - An internally generated resource
aAspectClass - The class of the desired aspect for the resource
Returns:
An aspect of class aAspectClass for resource aSource
Throws:
NKFException - thrown if no transreptor available or transreptor fails

transrept

public IURAspect transrept(IURRepresentation aSource,
                           Class aAspectClass)
                    throws NKFException
Transrept a internally created resource into alternative aspect. There must be a registered Transreptor capable of performing the transrepresentation. - Do not use to transrept external resources source these using one of the methods which take an aspect class parameter.

Parameters:
aSource - An internally generated resource
aAspectClass - The class of the desired aspect for the resource
Returns:
An aspect of class aAspectClass for resource aSource
Throws:
NKFException - thrown if no transreptor available or transreptor fails

requestNew

public String requestNew(String aURIBase,
                         IURAspect aOptionalSource)
                  throws NKFException
Request the creation of a new resource

Parameters:
aURIBase - A base URI that can identify which accessor to target the request at
aOptionalSource - Optional resource aspect that the accessor can use to seed the state of the new resource.
Returns:
The URI of the created resource
Throws:
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.

fragment

public IURAspect fragment(IURAspect aSource,
                          String aFragment,
                          String aMimeType,
                          Class aAspectClass)
                   throws NKFException
Apply a fragment identifier to an internally created resource. There must be a registered Fragmentor capable of performing the fragmentation. - Do not use to transrept external resources source these with a fragment identifier on the URI

Parameters:
aSource - An internally generated resource
aFragment - A valid fragment identifier string
aMimeType - The mimetype of the resource
aAspectClass - The class of the desired aspect for the resource
Returns:
An aspect of class aAspectClass for resource aSource
Throws:
NKFException - thrown if no transreptor available or transreptor fails

createIntermediateRepresentationForAspect

public IURRepresentation createIntermediateRepresentationForAspect(IURAspect aAspect,
                                                                   String aMimeType)
Create a representation around one aspect that has been internally created and give it the specified mimetype. The created representation is not expired but has no dependencies.

Parameters:
aAspect - the single aspect it should contain
aMimeType - the mimetype of the representation

NetKernel APIs


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