com.planet_ink.coffee_mud.WebMacros
Class SipletInterface

java.lang.Object
  extended by com.planet_ink.coffee_mud.WebMacros.StdWebMacro
      extended by com.planet_ink.coffee_mud.WebMacros.SipletInterface
All Implemented Interfaces:
CMObject, WebMacro, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class SipletInterface
extends StdWebMacro


Nested Class Summary
static class SipletInterface.WSState
           
 
Field Summary
static boolean initialized
           
static java.lang.Object sipletConnectSync
           
static java.util.Map<java.lang.String,com.planet_ink.coffee_mud.WebMacros.SipletInterface.SipletSession> siplets
           
 
Constructor Summary
SipletInterface()
           
 
Method Summary
protected  void initialize()
           
 boolean isAWebPath()
          Whether this macro substitutes as an aspect of the web path instead of a standard web macro.
 java.lang.String name()
          The public name of this macro
 java.lang.String processRequest(com.planet_ink.coffee_web.interfaces.HTTPRequest httpReq, com.planet_ink.coffee_mud.WebMacros.SipletInterface.SipletProtocolHander handler)
           
 java.lang.String runMacro(com.planet_ink.coffee_web.interfaces.HTTPRequest httpReq, java.lang.String parm, com.planet_ink.coffee_web.interfaces.HTTPResponse httpResp)
          This method is executed only if this macro returns false for preferBinary().
 
Methods inherited from class com.planet_ink.coffee_mud.WebMacros.StdWebMacro
clearWebMacros, clearWebMacros, colorwebifyOnly, compareTo, copyOf, getHTTPFileData, grabFile, helpHelp, helpHelp, helpHelp, htmlIncomingFilter, htmlIncomingFilter, htmlOutgoingFilter, htmlOutgoingFilter, ID, initializeClass, isAdminMacro, L, newInstance, parseOrderedParms, parseParms, parseParms, preferBinary, runBinaryMacro, safeIncomingfilter, webify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sipletConnectSync

public static final java.lang.Object sipletConnectSync

initialized

public static volatile boolean initialized

siplets

public static final java.util.Map<java.lang.String,com.planet_ink.coffee_mud.WebMacros.SipletInterface.SipletSession> siplets
Constructor Detail

SipletInterface

public SipletInterface()
Method Detail

name

public java.lang.String name()
Description copied from interface: WebMacro
The public name of this macro

Specified by:
name in interface CMObject
Specified by:
name in interface WebMacro
Overrides:
name in class StdWebMacro
Returns:
The public name of this macro
See Also:
Environmental.Name()

isAWebPath

public boolean isAWebPath()
Description copied from interface: WebMacro
Whether this macro substitutes as an aspect of the web path instead of a standard web macro. If true is returned, URLs such as: http://mydomain.com/mymacroname?firstparm=value&secondparm=value might succeeed

Specified by:
isAWebPath in interface WebMacro
Overrides:
isAWebPath in class StdWebMacro
Returns:
whether this is a wierd URL macro

initialize

protected void initialize()

processRequest

public java.lang.String processRequest(com.planet_ink.coffee_web.interfaces.HTTPRequest httpReq,
                                       com.planet_ink.coffee_mud.WebMacros.SipletInterface.SipletProtocolHander handler)

runMacro

public java.lang.String runMacro(com.planet_ink.coffee_web.interfaces.HTTPRequest httpReq,
                                 java.lang.String parm,
                                 com.planet_ink.coffee_web.interfaces.HTTPResponse httpResp)
                          throws HTTPServerException
Description copied from interface: WebMacro
This method is executed only if this macro returns false for preferBinary(). It will execute the macro and return its results as a string, which is then substituted for the macro reference in the web page where the macro was found. The response object is used to set cookies and headers only. Any response body is in the return object. Since 99% of macros are only filling in an existing page, nothing will be done with that anyway, and is only important when isAWebPath return true.

Specified by:
runMacro in interface WebMacro
Overrides:
runMacro in class StdWebMacro
Parameters:
httpReq - the external requests object
parm - any parameter strings given to the macro
httpResp - the response, with headers
Returns:
the string result of running this macro
Throws:
HTTPServerException - a http error to pass to the user
See Also:
WebMacro.preferBinary(), HTTPRequest