ch.epfl.lsr.apex
Class APEXOption

java.lang.Object
  extended bych.epfl.lsr.apex.APEXOption

public class APEXOption
extends Object

An APEXOption defines an APEX option element as it is specified in the Application Exchange (APEX) Protocol RFC3340 DTD.

Author:
Marc Stöcklin

Field Summary
static int EMPTY
          content of the option: empty
static int EXTERNAL
          identifier type: external
static int INTERNAL
          identifier type: internal
static int STRINGCONTENT
          content of the option: string content (on instantiation)
static int XMLCONTENT
          content of the option: xml content
 
Constructor Summary
APEXOption()
           Instantiates an empty APEXOption.
APEXOption(int type, String identifier)
           Instantiates an APEXOption with the specified attribute.
APEXOption(int type, String identifier, String targetHop, int transID)
           Instantiates an APEXOption with the specified attributes.
APEXOption(int type, String identifier, String targetHop, String mustUnderstand)
           Instantiates an APEXOption with the specified attributes.
APEXOption(int type, String identifier, String targetHop, String mustUnderstand, int transID)
           Instantiates an APEXOption with the specified attributes.
APEXOption(int type, String identifier, String targetHop, String mustUnderstand, int transID, String content)
           Instantiates an APEXOption with the specified attributes and the textual XML content.
APEXOption(int type, String identifier, String targetHop, String mustUnderstand, int transID, String localize, String content)
           Instantiates an APEXOption with the specified attributes and the textual XML content.
APEXOption(int type, String identifier, String targetHop, String mustUnderstand, String content)
           Instantiates an APEXOption with the specified attributes and the textual XML content.
 
Method Summary
 void addApplicableEndpoint(APEXEndpointAddress applicableEndpoint)
          Adds an applicable endpoints defined in processing of this option.
 boolean equals(Object o)
           
 HashSet getApplicableEndpoints()
          Returns a set of applicable endpoints defined in processing of this option.
 String getIdentifier()
          Returns the identifier ("name") attribute's value for this option.
 String getMustUnderstand()
          Returns the mustUnderstand attribute's value for this option.
 Node getOptionNode()
          Returns the whole option as a Node.
 String getTargetHop()
          Returns the targetHop attribute's value for this option.
 int getTransID()
          Returns the transaction identifier of this option.
 NodeList getXMLContent()
          Returns the XML Content of the option.
 String getXMLOption()
          Returns the option as a String.
 String getXMLOption(String indent)
          Returns a String containing the fully created XML option.
 int hashCode()
           
 void setApplicableEndpoints(HashSet applicableEndpointSet)
          Adds a set of applicable endpoints defined in processing of this option.
 void setContent(String content)
          Sets the textual content for this option.
 void setIdentifier(String identifier)
          Sets the identifier ("name") for this option.
 void setLocalize(String localize)
          Sets the localize attribute's value for this option.
 void setMustUnderstand(String mustUnderstand)
          Sets the mustUnderstand attribute's value for this option.
 void setOptionNode(Node n)
          Sets the content (option node) internally for this option.
 void setTargetHop(String targetHop)
          Sets the targetHop attribute's value for this option.
 void setTransID(int transID)
          Sets the transaction identifier for this option.
 void setType(int type)
          Sets the type of this option.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

INTERNAL

public static final int INTERNAL
identifier type: internal

See Also:
Constant Field Values

EXTERNAL

public static final int EXTERNAL
identifier type: external

See Also:
Constant Field Values

EMPTY

public static final int EMPTY
content of the option: empty

See Also:
Constant Field Values

STRINGCONTENT

public static final int STRINGCONTENT
content of the option: string content (on instantiation)

See Also:
Constant Field Values

XMLCONTENT

public static final int XMLCONTENT
content of the option: xml content

See Also:
Constant Field Values
Constructor Detail

APEXOption

public APEXOption(int type,
                  String identifier,
                  String targetHop,
                  String mustUnderstand,
                  int transID,
                  String localize,
                  String content)

Instantiates an APEXOption with the specified attributes and the textual XML content.

Parameters:
type - The type (APEX.INTERNAL or APEX.EXTERNAL)
identifier - An identifier ("name") of the option
targetHop - The targetHop attribute's value (APEX.THIS, APEX.FINAL, or APEX.ALL)
mustUnderstand - The mustUnderstand attribute (APEX.TRUE or APEX.FALSE)
transID - A transaction identifier for the option
localize - The localize attribute (e.g. APEX.LOCALIZE_IDEFAULT)
content - The content of the option
See Also:
APEX.INTERNAL, APEX.EXTERNAL, APEX.THIS, APEX.FINAL, APEX.ALL, APEX.TRUE, APEX.FALSE, APEX.LOCALIZE_IDEFAULT

APEXOption

public APEXOption(int type,
                  String identifier,
                  String targetHop,
                  String mustUnderstand,
                  int transID,
                  String content)

Instantiates an APEXOption with the specified attributes and the textual XML content.

Parameters:
type - The type (APEX.INTERNAL or APEX.EXTERNAL)
identifier - An identifier ("name") of the option
targetHop - The targetHop attribute's value (APEX.THIS,APEX.FINAL, or APEX.ALL)
mustUnderstand - The mustUnderstand attribute (APEX.TRUE or APEX.FALSE)
transID - A transaction identifier for the option
content - The content of the option
See Also:
APEX.INTERNAL, APEX.EXTERNAL, APEX.THIS, APEX.FINAL, APEX.ALL, APEX.TRUE, APEX.FALSE

APEXOption

public APEXOption(int type,
                  String identifier,
                  String targetHop,
                  String mustUnderstand,
                  int transID)

Instantiates an APEXOption with the specified attributes.

Parameters:
type - The type (APEX.INTERNAL or APEX.EXTERNAL)
identifier - An identifier ("name") of the option
targetHop - The targetHop attribute's value (APEX.THIS,APEX.FINAL, or APEX.ALL)
mustUnderstand - The mustUnderstand attribute's value (APEX.TRUE or APEX.FALSE)
transID - A transaction identifier for the option
See Also:
APEX.INTERNAL, APEX.EXTERNAL, APEX.THIS, APEX.FINAL, APEX.ALL, APEX.TRUE, APEX.FALSE

APEXOption

public APEXOption(int type,
                  String identifier,
                  String targetHop,
                  String mustUnderstand)

Instantiates an APEXOption with the specified attributes.

Note: the transID must be set later!

Parameters:
type - The type (APEX.INTERNAL or APEX.EXTERNAL)
identifier - An identifier ("name") of the option
targetHop - The targetHop attribute's value (APEX.THIS,APEX.FINAL, or APEX.ALL)
mustUnderstand - The mustUnderstand attribute's value (APEX.TRUE or APEX.FALSE)
See Also:
APEX.INTERNAL, APEX.EXTERNAL, APEX.THIS, APEX.FINAL, APEX.ALL, APEX.TRUE, APEX.FALSE, APEX.LOCALIZE_IDEFAULT

APEXOption

public APEXOption(int type,
                  String identifier,
                  String targetHop,
                  String mustUnderstand,
                  String content)

Instantiates an APEXOption with the specified attributes and the textual XML content.

Note: the transID must be set later!

Parameters:
type - The type (APEX.INTERNAL or APEX.EXTERNAL)
identifier - An identifier ("name") of the option
targetHop - The targetHop attribute's value (APEX.THIS,APEX.FINAL, or APEX.ALL)
mustUnderstand - The mustUnderstand attribute's value (APEX.TRUE or APEX.FALSE)
content - The content of the option
See Also:
APEX.INTERNAL, APEX.EXTERNAL, APEX.THIS, APEX.FINAL, APEX.ALL, APEX.TRUE, APEX.FALSE

APEXOption

public APEXOption(int type,
                  String identifier,
                  String targetHop,
                  int transID)

Instantiates an APEXOption with the specified attributes.

Parameters:
type - The type (APEX.INTERNAL or APEX.EXTERNAL)
identifier - An identifier ("name") of the option
targetHop - The targetHop attribute's value (APEX.THIS,APEX.FINAL, or APEX.ALL)
transID - A transaction identifier for the option
See Also:
APEX.INTERNAL, APEX.EXTERNAL, APEX.THIS, APEX.FINAL, APEX.ALL

APEXOption

public APEXOption(int type,
                  String identifier)

Instantiates an APEXOption with the specified attribute.

Parameters:
type - The type (APEX.INTERNAL or APEX.EXTERNAL)
identifier - An identifier ("name") of the option
See Also:
APEX.INTERNAL, APEX.EXTERNAL

APEXOption

public APEXOption()

Instantiates an empty APEXOption.

Method Detail

setContent

public void setContent(String content)
Sets the textual content for this option.

Parameters:
content - The content

setTransID

public void setTransID(int transID)
Sets the transaction identifier for this option.

Parameters:
transID - The transID

setType

public void setType(int type)
Sets the type of this option.

Parameters:
type - The type
See Also:
APEX.INTERNAL, APEX.EXTERNAL

setIdentifier

public void setIdentifier(String identifier)
Sets the identifier ("name") for this option.

Parameters:
identifier - The identifier

setTargetHop

public void setTargetHop(String targetHop)
Sets the targetHop attribute's value for this option.

Parameters:
targetHop - The targetHop attribute's value

setMustUnderstand

public void setMustUnderstand(String mustUnderstand)
Sets the mustUnderstand attribute's value for this option.

Parameters:
mustUnderstand - The mustUnderstand attribute's value

setLocalize

public void setLocalize(String localize)
Sets the localize attribute's value for this option.

Parameters:
localize - The localize attribute's value

getXMLOption

public String getXMLOption()
Returns the option as a String.

Returns:
The XML String

getTransID

public int getTransID()
Returns the transaction identifier of this option.

Returns:
The transID

getMustUnderstand

public String getMustUnderstand()
Returns the mustUnderstand attribute's value for this option.

Returns:
The mustUnderstand attribute's value

getIdentifier

public String getIdentifier()
Returns the identifier ("name") attribute's value for this option.

Returns:
The identifier attribute's value

getTargetHop

public String getTargetHop()
Returns the targetHop attribute's value for this option.

Returns:
The targetHop attribute's value

getApplicableEndpoints

public HashSet getApplicableEndpoints()
Returns a set of applicable endpoints defined in processing of this option. This value must be set in every processing relay.

Returns:
A set of applicable endpoints addresses

addApplicableEndpoint

public void addApplicableEndpoint(APEXEndpointAddress applicableEndpoint)
Adds an applicable endpoints defined in processing of this option. This value must be set in every processing relay.

Parameters:
applicableEndpoint - An applicable endpoint address

setApplicableEndpoints

public void setApplicableEndpoints(HashSet applicableEndpointSet)
Adds a set of applicable endpoints defined in processing of this option. This value must be set in every processing relay.

Parameters:
applicableEndpointSet - A set of applicable endpoint address

getXMLOption

public String getXMLOption(String indent)
Returns a String containing the fully created XML option.

Parameters:
indent - An indent (e.g. " ")
Returns:
The XML String

toString

public String toString()

setOptionNode

public void setOptionNode(Node n)
Sets the content (option node) internally for this option.

Parameters:
n - The node

getXMLContent

public NodeList getXMLContent()
Returns the XML Content of the option.

Returns:
The nested elements as a NodeList
See Also:
NodeList

getOptionNode

public Node getOptionNode()
Returns the whole option as a Node.

Returns:
The node

equals

public boolean equals(Object o)

hashCode

public int hashCode()