org.w3c.jigsaw.ssi.commands
Class EndloopCommand

java.lang.Object
  extended by org.w3c.jigsaw.ssi.commands.EndloopCommand
All Implemented Interfaces:
Command, ControlCommand

public class EndloopCommand
extends java.lang.Object
implements ControlCommand

Implementation of the SSI endloop command.


Field Summary
protected static java.util.Hashtable endloops
           
 
Constructor Summary
EndloopCommand()
           
 
Method Summary
 boolean acceptCaching()
          return true if reply can be cached.
 Reply execute(SSIFrame ssiframe, Request request, ArrayDictionary parameters, java.util.Dictionary variables)
          Executes this command.
 java.lang.String getName()
          Returns the name of this command.
protected static int getPosition(java.lang.String name)
           
 java.lang.String getValue(java.util.Dictionary variables, java.lang.String var, Request request)
          Returns the (String) value of the given variable.
 int jumpTo(SSIFrame ssiframe, Request request, CommandRegistry registry, ArrayDictionary parameters, java.util.Dictionary variables)
          Give the next position in the structure witch store the SSIFrame.
 void setPosition(SSIFrame ssiframe, Request request, CommandRegistry registry, ArrayDictionary parameters, java.util.Dictionary variables, int position)
          register the command position in the structure witch store the SSIFrame.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

endloops

protected static java.util.Hashtable endloops
Constructor Detail

EndloopCommand

public EndloopCommand()
Method Detail

acceptCaching

public boolean acceptCaching()
return true if reply can be cached.

Specified by:
acceptCaching in interface Command
Returns:
a boolean.

getPosition

protected static int getPosition(java.lang.String name)
                          throws ControlCommandException
Throws:
ControlCommandException

setPosition

public void setPosition(SSIFrame ssiframe,
                        Request request,
                        CommandRegistry registry,
                        ArrayDictionary parameters,
                        java.util.Dictionary variables,
                        int position)
Description copied from interface: ControlCommand
register the command position in the structure witch store the SSIFrame.

Specified by:
setPosition in interface ControlCommand

getValue

public java.lang.String getValue(java.util.Dictionary variables,
                                 java.lang.String var,
                                 Request request)
Description copied from interface: Command
Returns the (String) value of the given variable.

Specified by:
getValue in interface Command
Returns:
a String instance.

execute

public Reply execute(SSIFrame ssiframe,
                     Request request,
                     ArrayDictionary parameters,
                     java.util.Dictionary variables)
Description copied from interface: Command
Executes this command. Might modify variables. Must not modify the parameters.

It may handle conditional requests, except that if it replies with a status of HTTP.NOT_MODIFIED, it must still reply with a content (the same content that it would have returned for an inconditional request). This is because further SSI commands down the line may decide thay they have been modified, and then a content must be emitted by SSIFrame.

Specified by:
execute in interface Command
request - the original HTTP request
parameters - The parameters for this command
variables - The global variables for the parse
Returns:
a Reply with the output from the command

jumpTo

public int jumpTo(SSIFrame ssiframe,
                  Request request,
                  CommandRegistry registry,
                  ArrayDictionary parameters,
                  java.util.Dictionary variables)
           throws ControlCommandException
Description copied from interface: ControlCommand
Give the next position in the structure witch store the SSIFrame.

Specified by:
jumpTo in interface ControlCommand
Returns:
An integer
Throws:
ControlCommandException - if action failed.

getName

public java.lang.String getName()
Description copied from interface: Command
Returns the name of this command. (Case sensitivity is up to the lookupCommand method in the command registry.)

Specified by:
getName in interface Command
Returns:
the name of the command
See Also:
CommandRegistry.lookupCommand(java.lang.String)