things.thinger.service.proxy
Class ProxyContext

java.lang.Object
  extended by things.thinger.service.proxy.ProxyContext
Direct Known Subclasses:
ProxyServiceContext

public class ProxyContext
extends java.lang.Object

Author:
erich

Field Summary
 java.net.Socket downlink
           
 java.io.InputStream downlinkIn
           
 java.io.OutputStream downlinkOut
           
 WhoAmI id
           
 Logger logger
           
 java.net.Socket uplink
           
 java.io.InputStream uplinkIn
           
 java.io.OutputStream uplinkOut
           
 
Constructor Summary
ProxyContext(WhoAmI id, ProxySession session, java.net.Socket uplink, java.net.Socket downlink, Logger logger)
          Constructor.
 
Method Summary
 void dispose()
          Dispose the context.
protected  void finalize()
          The finalizer.
 ProxyOutput GET_OUTPUT(java.lang.String name)
          Get an output reference.
 void POST(java.lang.String message)
          Post a messages.
 void POSTACTION(java.lang.String... tokens)
          Post action tokens.
 void POSTDONE()
          Done with the post.
 void POSTMULTI(java.lang.String token, java.lang.String... pairs)
          Post multiline of name/value pairs.
 void POSTSINGLE(java.lang.String token, java.lang.String name, java.lang.String value)
          Post header name/value pairs
 void POSTSTART(java.lang.String... tokens)
          Start a post.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

uplink

public java.net.Socket uplink

downlink

public java.net.Socket downlink

uplinkOut

public java.io.OutputStream uplinkOut

uplinkIn

public java.io.InputStream uplinkIn

downlinkOut

public java.io.OutputStream downlinkOut

downlinkIn

public java.io.InputStream downlinkIn

logger

public Logger logger

id

public WhoAmI id
Constructor Detail

ProxyContext

public ProxyContext(WhoAmI id,
                    ProxySession session,
                    java.net.Socket uplink,
                    java.net.Socket downlink,
                    Logger logger)
             throws java.lang.Throwable
Constructor.

Parameters:
id -
session -
uplink -
downlink -
logger -
Throws:
java.lang.Throwable
Method Detail

dispose

public void dispose()
Dispose the context. Everything will be flushed and closed.


GET_OUTPUT

public ProxyOutput GET_OUTPUT(java.lang.String name)
                       throws java.lang.Throwable
Get an output reference. This will include the final name of the file as well as a stream to it.

Parameters:
name -
Returns:
the reference as a ProxyOutput object.
Throws:
java.lang.Throwable

POST

public void POST(java.lang.String message)
          throws java.lang.Throwable
Post a messages.

This is a just a pass-through right now. Depending on how the processors go, I might put common formatting services here.

Parameters:
message -
Throws:
java.lang.Throwable

POSTSTART

public void POSTSTART(java.lang.String... tokens)
               throws java.lang.Throwable
Start a post. This will be a level 1 entry.

Parameters:
tokens - unrelated tokens
Throws:
java.lang.Throwable

POSTACTION

public void POSTACTION(java.lang.String... tokens)
                throws java.lang.Throwable
Post action tokens. This will be a level 2 entry.

Parameters:
tokens - unrelated tokens
Throws:
java.lang.Throwable - Definitely will be thrown if POSTSTART not yet called.

POSTMULTI

public void POSTMULTI(java.lang.String token,
                      java.lang.String... pairs)
               throws java.lang.Throwable
Post multiline of name/value pairs.

Parameters:
token - line token.
pairs - name/value pairs
Throws:
java.lang.Throwable - Definitely will be thrown if POSTSTART not yet called or the number of strings passed in pairs is an odd number.

POSTSINGLE

public void POSTSINGLE(java.lang.String token,
                       java.lang.String name,
                       java.lang.String value)
                throws java.lang.Throwable
Post header name/value pairs

Parameters:
token - line token.
name - name
value - value
Throws:
java.lang.Throwable - Definitely will be thrown if POSTSTART

POSTDONE

public void POSTDONE()
              throws java.lang.Throwable
Done with the post. Go ahead and send it.

Throws:
java.lang.Throwable

finalize

protected void finalize()
                 throws java.lang.Throwable
The finalizer. Make sure it was disposed.

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable


Things.