com.ibm.cics.server
Class WSAContext

java.lang.Object
  extended by com.ibm.cics.server.WSAContext

public class WSAContext
extends java.lang.Object

WS-Addressing context inteface. This class implements a number of methods to set and get data from the addressing contexts attached to the current requester or provider application. Namespace http://www.w3.org/2005/08/addressing.


Field Summary
static int FAULTTOEPR
          EPRTYPE cvda value FAULTTOEPR
static int FROMEPR
          EPRTYPE cvda value FROMEPR
static int REPLYTOEPR
          EPRTYPE cvda value REPLYTOEPR
static int REQCONTEXT
          Request Context cvda value
static int RESPCONTEXT
          Response Context cvda value
static java.lang.String SCCSID
          The SCCSID constant
static int TOEPR
          EPRTYPE cvda value TOEPR
 
Constructor Summary
WSAContext()
           
 
Method Summary
 void delete()
          Deletes WS-Addressing request and response contexts.
static void delete(java.lang.String channel)
          Deletes WS-Addressing request and response contexts.
 java.lang.String getAction(int contextType)
          Gets the action MAP from the specified addressing context.
 java.lang.String getChannel()
          Gets the name of the channel which contains the addressing contexts.
 java.lang.String getEpr(int contextType, int eprType)
          Gets the complete EPR from the specified addressing context for the specified EPR type.
 java.lang.String getEprAddress(int contextType, int eprType)
          Gets the EPR address from the specified addressing context for the specified EPR.
 java.lang.String getEprMetadata(int contextType, int eprType)
          Gets the EPR metadata from the specified addressing context for the specified EPR.
 java.lang.String getEprRefParms(int contextType, int eprType)
          Gets the EPR Reference parameters from the specified addressing context for the specified EPR.
 java.lang.String getMessageId(int contextType)
          Gets the messageId MAP from the specified addressing context.
 java.lang.String getNationalLang()
          Gets the national language if previously set.
 java.util.Map<java.lang.String,java.lang.String> getRelatesTo(int contextType)
          Gets a Map of relatesTo MAPs from the specified addressing context.
 void setAction(java.lang.String action)
          Sets the action MAP in the request addressing context.
 void setChannel(java.lang.String channel)
          Sets the name of the channel which contains the addressing contexts.
 void setEpr(int eprType, java.lang.String epr)
          Sets the complete EPR in the request addressing context for the specified EPR type.
 void setEprAddress(int eprType, java.lang.String address)
          Sets the EPR address in the request addressing context for the specified EPR.
 void setEprMetadata(int eprType, java.lang.String metadata)
          Sets the EPR metadata in the request addressing context for the specified EPR.
 void setEprRefParms(int eprType, java.lang.String refparms)
          Sets the EPR reference parameters in the request addressing context for the specified EPR.
 void setMessageId(java.lang.String messageId)
          Sets the messageId MAP in the request addressing context.
 void setNationalLang(java.lang.String natlang)
          Sets the national language to use when building the addressing context.
 void setRelatesTo(java.lang.String relatesURI)
          Sets a relatesTo MAP in the request addressing context consisting of a URI.
 void setRelatesTo(java.lang.String relatesURI, java.lang.String relatesType)
          Sets a relatesTo MAP in the request addressing context consisting of a URI and type URI.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCCSID

public static final java.lang.String SCCSID
The SCCSID constant

See Also:
Constant Field Values

FROMEPR

public static final int FROMEPR
EPRTYPE cvda value FROMEPR

See Also:
Constant Field Values

TOEPR

public static final int TOEPR
EPRTYPE cvda value TOEPR

See Also:
Constant Field Values

REPLYTOEPR

public static final int REPLYTOEPR
EPRTYPE cvda value REPLYTOEPR

See Also:
Constant Field Values

FAULTTOEPR

public static final int FAULTTOEPR
EPRTYPE cvda value FAULTTOEPR

See Also:
Constant Field Values

REQCONTEXT

public static final int REQCONTEXT
Request Context cvda value

See Also:
Constant Field Values

RESPCONTEXT

public static final int RESPCONTEXT
Response Context cvda value

See Also:
Constant Field Values
Constructor Detail

WSAContext

public WSAContext()
Method Detail

delete

public static void delete(java.lang.String channel)
                   throws InvalidRequestException,
                          ChannelErrorException,
                          RecordNotFoundException
Deletes WS-Addressing request and response contexts.

Parameters:
channel - The name of channel with the WS-Addressing context containers.
Throws:
ChannelErrorException - A problem locating the channel occured.
InvalidRequestException - The delete method can only be used in a requester.
RecordNotFoundException - The addressing context could not be located.

delete

public void delete()
            throws java.lang.IllegalStateException,
                   InvalidRequestException,
                   ChannelErrorException,
                   RecordNotFoundException
Deletes WS-Addressing request and response contexts.

Throws:
java.lang.IllegalStateException - A Channel name has not been set.
ChannelErrorException - A problem locating the channel occured.
InvalidRequestException - The delete method can only be used in a requester.
RecordNotFoundException - The addressing context could not be located.

getChannel

public java.lang.String getChannel()
Gets the name of the channel which contains the addressing contexts. This method is local and returns value previously set by setChannel, it does not return the default channel name set by the pipeline.

Returns:
String The local channel name used to locate the addressing contexts.

setChannel

public void setChannel(java.lang.String channel)
Sets the name of the channel which contains the addressing contexts. This is used to locate the addressing contexts on all other method calls. If not supplied the default channel is used if available.

Parameters:
channel - The channel name to use to locate the addressing contecxt.

getNationalLang

public java.lang.String getNationalLang()
Gets the national language if previously set.

Returns:
String The national language used to build the addressing contexts.

setNationalLang

public void setNationalLang(java.lang.String natlang)
Sets the national language to use when building the addressing context. This must be set before MAP set methods are invoked.

Parameters:
natlang - The national language to use to build the addressing contects.

getAction

public java.lang.String getAction(int contextType)
                           throws java.lang.IllegalArgumentException,
                                  InvalidRequestException,
                                  CCSIDErrorException,
                                  RecordNotFoundException,
                                  ChannelErrorException
Gets the action MAP from the specified addressing context.

Parameters:
contextType - The cvda context type. e.g. WSAContext.REQCONTEXT.
Returns:
String The action MAP.
Throws:
java.lang.IllegalArgumentException - The contextType is not valid.
ChannelErrorException - A problem locating the channel occured.
CCSIDErrorException - An exception occurred translating character sets.
InvalidRequestException - A problem exists with the request data.
RecordNotFoundException - The addressing context could not be located.

setAction

public void setAction(java.lang.String action)
               throws InvalidRequestException,
                      CCSIDErrorException,
                      ChannelErrorException
Sets the action MAP in the request addressing context.

Parameters:
action - The action MAP to set.
Throws:
ChannelErrorException - A problem locating the channel occured.
CCSIDErrorException - An exception occurred translating character sets.
InvalidRequestException - A problem exists with the request data.

getMessageId

public java.lang.String getMessageId(int contextType)
                              throws java.lang.IllegalArgumentException,
                                     InvalidRequestException,
                                     CCSIDErrorException,
                                     RecordNotFoundException,
                                     ChannelErrorException
Gets the messageId MAP from the specified addressing context.

Parameters:
contextType - The cvda context type. e.g. WSAContext.REQCONTEXT.
Returns:
String The messageId MAP.
Throws:
java.lang.IllegalArgumentException - The contextType is not valid.
ChannelErrorException - A problem locating the channel occured.
CCSIDErrorException - An exception occurred translating character sets.
InvalidRequestException - A problem exists with the request data.
RecordNotFoundException - The addressing context could not be located.

setMessageId

public void setMessageId(java.lang.String messageId)
                  throws InvalidRequestException,
                         CCSIDErrorException,
                         ChannelErrorException
Sets the messageId MAP in the request addressing context.

Parameters:
messageId - The messageId MAP to set.
Throws:
ChannelErrorException - A problem locating the channel occured.
CCSIDErrorException - An exception occurred translating character sets.
InvalidRequestException - A problem exists with the request data.

getRelatesTo

public java.util.Map<java.lang.String,java.lang.String> getRelatesTo(int contextType)
                                                              throws java.lang.IllegalArgumentException,
                                                                     InvalidRequestException,
                                                                     CCSIDErrorException,
                                                                     RecordNotFoundException,
                                                                     ChannelErrorException
Gets a Map of relatesTo MAPs from the specified addressing context. A maximum of 1024 relatesTo MAPs are returned.

Parameters:
contextType - The cvda context type. e.g. WSAContext.REQCONTEXT.
Returns:
Map A MAP of Keys and entities. Where the key is the relatesTo messageId URI and the value the relatesTo type URI of the related message.
Throws:
java.lang.IllegalArgumentException - The contextType is not valid.
ChannelErrorException - A problem locating the channel occured.
CCSIDErrorException - An exception occurred translating character sets.
InvalidRequestException - A problem exists with the request data.
RecordNotFoundException - The addressing context could not be located.

setRelatesTo

public void setRelatesTo(java.lang.String relatesURI,
                         java.lang.String relatesType)
                  throws InvalidRequestException,
                         CCSIDErrorException,
                         ChannelErrorException
Sets a relatesTo MAP in the request addressing context consisting of a URI and type URI.

Parameters:
relatesURI - The messageId URI of the related message to set.
relatesType - The type of relationship with the related message.
Throws:
ChannelErrorException - A problem locating the channel occured.
CCSIDErrorException - An exception occurred translating character sets.
InvalidRequestException - A problem exists with the request data.

setRelatesTo

public void setRelatesTo(java.lang.String relatesURI)
                  throws InvalidRequestException,
                         CCSIDErrorException,
                         ChannelErrorException
Sets a relatesTo MAP in the request addressing context consisting of a URI.

Parameters:
relatesURI - The messageId URI of the related message to set.
Throws:
ChannelErrorException - A problem locating the channel occured.
CCSIDErrorException - An exception occurred translating character sets.
InvalidRequestException - A problem exists with the request data.

getEprAddress

public java.lang.String getEprAddress(int contextType,
                                      int eprType)
                               throws java.lang.IllegalArgumentException,
                                      InvalidRequestException,
                                      CCSIDErrorException,
                                      RecordNotFoundException,
                                      ChannelErrorException
Gets the EPR address from the specified addressing context for the specified EPR.

Parameters:
contextType - The cvda context type. e.g. WSAContext.REQCONTEXT.
eprType - The cvda EPR type of the EPR to set in the context. e.g. WSAContext.TOEPR.
Returns:
String The address of the specified EPR.
Throws:
java.lang.IllegalArgumentException - The contextType or eprType is not valid.
ChannelErrorException - A problem locating the channel occured.
CCSIDErrorException - An exception occurred translating character sets.
InvalidRequestException - A problem exists with the request data.
RecordNotFoundException - The addressing context could not be located.

setEprAddress

public void setEprAddress(int eprType,
                          java.lang.String address)
                   throws java.lang.IllegalArgumentException,
                          InvalidRequestException,
                          CCSIDErrorException,
                          ChannelErrorException
Sets the EPR address in the request addressing context for the specified EPR.

Parameters:
eprType - The cvda EPR type of the EPR to set in the context. e.g. WSAContext.TOEPR.
address - The address URI to set in the specified EPR.
Throws:
java.lang.IllegalArgumentException - The eprType is not valid.
ChannelErrorException - A problem locating the channel occured.
CCSIDErrorException - An exception occurred translating character sets.
InvalidRequestException - A problem exists with the request data.

getEprRefParms

public java.lang.String getEprRefParms(int contextType,
                                       int eprType)
                                throws java.lang.IllegalArgumentException,
                                       InvalidRequestException,
                                       CCSIDErrorException,
                                       RecordNotFoundException,
                                       ChannelErrorException
Gets the EPR Reference parameters from the specified addressing context for the specified EPR.

Parameters:
contextType - The cvda context type. e.g. WSAContext.REQCONTEXT.
eprType - The cvda EPR type of the EPR to set in the context. e.g. WSAContext.TOEPR.
Returns:
String Any reference parameters xml of the specified EPR.
Throws:
java.lang.IllegalArgumentException - The contextType or eprType is not valid.
ChannelErrorException - A problem locating the channel occured.
CCSIDErrorException - An exception occurred translating character sets.
InvalidRequestException - A problem exists with the request data.
RecordNotFoundException - The addressing context could not be located.

setEprRefParms

public void setEprRefParms(int eprType,
                           java.lang.String refparms)
                    throws java.lang.IllegalArgumentException,
                           InvalidRequestException,
                           CCSIDErrorException,
                           ChannelErrorException
Sets the EPR reference parameters in the request addressing context for the specified EPR. The reference parameters must be in fully qualified XML.

Parameters:
eprType - The cvda EPR type of the EPR to set in the context. e.g. WSAContext.TOEPR.
refparms - The reference parameter xml to set in the specified EPR.
Throws:
java.lang.IllegalArgumentException - The eprType is not valid.
ChannelErrorException - A problem locating the channel occured.
CCSIDErrorException - An exception occurred translating character sets.
InvalidRequestException - A problem exists with the request data.

getEprMetadata

public java.lang.String getEprMetadata(int contextType,
                                       int eprType)
                                throws java.lang.IllegalArgumentException,
                                       InvalidRequestException,
                                       CCSIDErrorException,
                                       RecordNotFoundException,
                                       ChannelErrorException
Gets the EPR metadata from the specified addressing context for the specified EPR.

Parameters:
contextType - The cvda context type. e.g. WSAContext.REQCONTEXT.
eprType - The cvda EPR type of the EPR to set in the context. e.g. WSAContext.TOEPR.
Returns:
String Any metadata xml of the specified EPR.
Throws:
java.lang.IllegalArgumentException - The contextType or eprType is not valid.
ChannelErrorException - A problem locating the channel occured.
CCSIDErrorException - An exception occurred translating character sets.
InvalidRequestException - A problem exists with the request data.
RecordNotFoundException - The addressing context could not be located.

setEprMetadata

public void setEprMetadata(int eprType,
                           java.lang.String metadata)
                    throws java.lang.IllegalArgumentException,
                           InvalidRequestException,
                           CCSIDErrorException,
                           ChannelErrorException
Sets the EPR metadata in the request addressing context for the specified EPR. The reference parameters must be in fully qualified XML.

Parameters:
eprType - The cvda EPR type of the EPR to set in the context. e.g. WSAContext.TOEPR.
metadata - The metadata xml to set in the specified EPR.
Throws:
java.lang.IllegalArgumentException - The eprType is not valid.
ChannelErrorException - A problem locating the channel occured.
CCSIDErrorException - An exception occurred translating character sets.
InvalidRequestException - A problem exists with the request data.

getEpr

public java.lang.String getEpr(int contextType,
                               int eprType)
                        throws java.lang.IllegalArgumentException,
                               InvalidRequestException,
                               CCSIDErrorException,
                               RecordNotFoundException,
                               ChannelErrorException
Gets the complete EPR from the specified addressing context for the specified EPR type.

Parameters:
contextType - The cvda context type. e.g. WSAContext.REQCONTEXT.
eprType - The cvda EPR type of the EPR to set in the context. e.g. WSAContext.TOEPR.
Returns:
String The complete EPR xml of the specified EPR.
Throws:
java.lang.IllegalArgumentException - The contextType or eprType is not valid.
ChannelErrorException - A problem locating the channel occured.
CCSIDErrorException - An exception occurred translating character sets.
InvalidRequestException - A problem exists with the request data.
RecordNotFoundException - The addressing context could not be located.

setEpr

public void setEpr(int eprType,
                   java.lang.String epr)
            throws java.lang.IllegalArgumentException,
                   InvalidRequestException,
                   CCSIDErrorException,
                   ChannelErrorException
Sets the complete EPR in the request addressing context for the specified EPR type. The EPR must be in fully qualified XML.

Parameters:
eprType - The cvda EPR type of the EPR to set in the context. e.g. WSAContext.TOEPR.
epr - The epr xml to set in the specified EPR.
Throws:
java.lang.IllegalArgumentException - The eprType is not valid.
ChannelErrorException - A problem locating the channel occured.
CCSIDErrorException - An exception occurred translating character sets.
InvalidRequestException - A problem exists with the request data.