WARNING: This server provides a static reference view of the NetKernel documentation. Links to dynamic content do not work. For the best experience we recommend you install NetKernel and view the documentation in the live system .

No metadata for layer1:scratch:scheme

The scratch: scheme is a transient storage area, or scratch pad that can be used to store information for the duration of a request or process.

The scheme is implemented by the Scratch Pad Overlay, please see that documentation for information about how to configure the overlay within your application design.

Syntax

The syntax for the scheme is:

Resource Identifier Syntax

scratch: {any-identifier}

This means users are free to use any type of URI compliant identifier.

SOURCE

When a request with the SOURCE verb is issued to the scratch: scheme the scratch pad context space is searched for that identifier, if found, then the previously stored representation is returned. If the specified resource is not found a java.lang.Exception is thrown.

The response contains the requested resource representation.

Example

In the following example the contents of a file are requested as a String class. (Note: because the verb SOURCE is the default, it is not necessary to explicitly call the setVerb() method.)

request.context.createRequest("scratch:myTemporary/data/list.txt");
cachedValue = context.issueRequest(request);

SINK

When a request with the SINK verb is issued to the scratch: the supplied representation is saved in the scratch context space with the identifier as the key.

There is no returned representation from this request.

Example

object = ... // the object to be saved is given a representation
request.context.createRequest("scratch:myTemporary/data/list.txt");
request.setVerb(INKFRequestReadOnly.VERB_SINK);
request.addPrimaryArgument(object);
context.issueRequest(request);

EXISTS

When a request with the EXISTS verb is issued to the scratch: scheme the scratch pad context space is searched for that identifier and the response indicates if it is found.

The response contains a boolean value of either true or false indicating if the item exists or not.

Example

request.context.createRequest("scratch:myTemporary/data/list.txt");
request.setVerb(INKFRequestReadOnly.VERB_EXISTS);
result = context.issueRequest(request);

DELETE

When a request with the DELETE verb is issued to the scratch: scheme the scratch pad context space is searched for that identifier and it is removed.

The response contains a boolean value of either true or false indicating if the item was deleted or not. If the identified resource does not exist then the result contains false

Example

request.context.createRequest("scratch:myTemporary/data/list.txt");
request.setVerb(INKFRequestReadOnly.VERB_DELETE);
result = context.issueRequest(request);