<reset-cache>

Purpose/Function

Reposition the cursor of a Trebuchet cache. Requires a cache reference from the environment. Cache must be open or an exception will be thrown.

Attributes

NAME

TYPE

DEFAULT VALUE

DESCRIPTION

cache

ncsa.tools.trebuchet.core.cache.OperationCache

(required)

cache whose cursor is to be reset

end

boolean

false

put the cursor at the end of the cache (after last entry)

entryIndex

java.lang.Integer

null

put the cursor at the beginning of the kth (= index) entry

entryId

java.lang.Long

null

put the cursor at the entry id (the first byte of the entry)

firstEntry

boolean

true

put the cursor at the beginning of the first entry

lastEntry

boolean

false

put the cursor at the beginning of the last entry

Elements

None.

ReturnValues

None.

NOTES

Examples

<ogrescript>
   ...
   <declare name="cache"/>
   <ls dir="file:/tmp/dir0">
   	<return-value assignedName="cache" defaultName="listCache"/>
   </ls>
   <open-cache cache="${cache}"/>
   <reset-cache end="true"/>
   <while condition="$E{true}">
      <cache-entry previous="true" cache="${cache}">
	<return-value assignedName="entry" defaultName="entryString"/>
      </cache-entry>
      <if>
	<is-null object="${entry}"/>
	<break/>
      </if>
      <echo message="${entry}" stdout="true"/>
   </while>
   ...	
</ogrescript>
  • No labels