context.arch.interpreter
Class IIButton2GroupURL

java.lang.Object
  |
  +--context.arch.BaseObject
        |
        +--context.arch.interpreter.Interpreter
              |
              +--context.arch.interpreter.IIButton2GroupURL

public class IIButton2GroupURL
extends Interpreter

This class is an interpreter that converts iButton ids to groups. Another component (app/widget/interpreter) sends an interpret command to it with an ibutton id, and this class returns the corresponding group.

See Also:
Interpreter

Field Summary
static java.lang.String CLASSNAME
          Name of interpreter
static java.lang.String GROUP
          Tag for group
static java.lang.String IBUTTONID
          Tag for iButton id
static java.lang.String URL
          Tag for group url
 
Fields inherited from class context.arch.interpreter.Interpreter
DEFAULT_PORT, inAttributes, inAttributeTypes, INTERPRET, INTERPRET_REPLY, outAttributes, outAttributeTypes
 
Fields inherited from class context.arch.BaseObject
communications, EXIT_OK, handlers, ID, parser, PING, PING_REPLY, serviceHandlers
 
Constructor Summary
IIButton2GroupURL(int port, java.lang.String ibrghost, int ibrgport, java.lang.String rgurlhost, int rgurlport)
          Constructor that creates the interpreter at the given port.
IIButton2GroupURL(java.lang.String ibrghost, int ibrgport, java.lang.String rgurlhost, int rgurlport)
          Constructor that creates the interpreter at the default port.
 
Method Summary
protected  AttributeNameValues interpretData(AttributeNameValues data)
          This method performs the actual interpretation of this component.
static void main(java.lang.String[] argv)
          Main method to create this interpreter with port specified by command line arguments
protected  Attributes setInAttributes()
          Sets the incoming attributes for the interpreter.
protected  Attributes setOutAttributes()
          Sets the outgoing attributes for the interpreter.
 
Methods inherited from class context.arch.interpreter.Interpreter
getInAttributeType, getOutAttributeType, isInAttribute, isOutAttribute, runInterpreterMethod, runUserMethod, setInAttribute, setOutAttribute
 
Methods inherited from class context.arch.BaseObject
askInterpreter, decodeData, encodeData, executeAsynchronousWidgetService, executeSynchronousWidgetService, getHostAddress, getId, getVersion, getVersion, getWidgetAttributes, getWidgetCallbacks, getWidgetServices, pingComponent, pollWidget, putDataInWidget, queryVersion, quit, retrieveDataFrom, retrieveDataFrom, retrieveDataFrom, retrieveDataFrom, retrieveDataFrom, retrieveDataFrom, retrieveDataFrom, returnPing, runComponentMethod, runMethod, serviceResult, setId, setVersion, subscribeTo, subscribeTo, subscribeTo, subscribeTo, unsubscribeFrom, updateAndPollWidget, userCallback, userRequest, userRequest, userRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASSNAME

public static final java.lang.String CLASSNAME
Name of interpreter

IBUTTONID

public static final java.lang.String IBUTTONID
Tag for iButton id

GROUP

public static final java.lang.String GROUP
Tag for group

URL

public static final java.lang.String URL
Tag for group url
Constructor Detail

IIButton2GroupURL

public IIButton2GroupURL(java.lang.String ibrghost,
                         int ibrgport,
                         java.lang.String rgurlhost,
                         int rgurlport)
Constructor that creates the interpreter at the default port. It sets the id of the this interpreter to CLASSNAME.
Parameters:
ibrghost - Hostname of the machine IIButton2Group is running on
ibrgport - Port of the machine IIButton2Group is running on
rgurlhost - Hostname of the machine IGroup2URL is running on
rgurlport - Port of the machine IGroup2URL is running on

IIButton2GroupURL

public IIButton2GroupURL(int port,
                         java.lang.String ibrghost,
                         int ibrgport,
                         java.lang.String rgurlhost,
                         int rgurlport)
Constructor that creates the interpreter at the given port. It sets the id of the this interpreter to CLASSNAME.
Parameters:
port - Port this interpreter is running on
ibrghost - Hostname of the machine IIButton2Group is running on
ibrgport - Port of the machine IIButton2Group is running on
rgurlhost - Hostname of the machine IGroup2URL is running on
rgurlport - Port of the machine IGroup2URL is running on
Method Detail

interpretData

protected AttributeNameValues interpretData(AttributeNameValues data)
This method performs the actual interpretation of this component. It takes an iButton id and returns a user name.
Overrides:
interpretData in class Interpreter
Parameters:
data - AttributeNameValues containing data to be interpreted
Returns:
AttributeNameValues object containing the interpreted data

setInAttributes

protected Attributes setInAttributes()
Sets the incoming attributes for the interpreter. It has only one: IBUTTONID.
Overrides:
setInAttributes in class Interpreter
Returns:
the incoming attributes for this interpreter

setOutAttributes

protected Attributes setOutAttributes()
Sets the outgoing attributes for the interpreter. It has only one: GROUP
Overrides:
setOutAttributes in class Interpreter
Returns:
the outgoing attributes for this interpreter.

main

public static void main(java.lang.String[] argv)
Main method to create this interpreter with port specified by command line arguments