org.ws4d.java.message
Class Message

java.lang.Object
  extended by org.ws4d.java.types.UnknownDataContainer
      extended by org.ws4d.java.message.Message
All Implemented Interfaces:
DPWSMessageConstants
Direct Known Subclasses:
DiscoveryMessage, EventingResponseMessage, FaultMessage, GetMessage, GetMetadataMessage, GetMetadataResponseMessage, GetResponseMessage, GetStatusMessage, InvokeMessage, ProbeMatchesMessage, ProbeMessage, RenewMessage, ResolveMatchesMessage, ResolveMessage, SubscribeMessage, SubscriptionEndMessage, UnsubscribeMessage, UnsubscribeResponseMessage

public abstract class Message
extends UnknownDataContainer
implements DPWSMessageConstants

This class implements an abstract MessageObject.


Field Summary
static int MULTICAST_ROUTING_SCHEME
           
static int UNICAST_ROUTING_SCHEME
           
static int UNKNOWN_ROUTING_SCHEME
           
 
Fields inherited from interface org.ws4d.java.constants.DPWSMessageConstants
BYE_MESSAGE, FAULT_MESSAGE, GET_MESSAGE, GET_METADATA_MESSAGE, GET_METADATA_RESPONSE_MESSAGE, GET_RESPONSE_MESSAGE, GET_STATUS_MESSAGE, GET_STATUS_RESPONSE_MESSAGE, HELLO_MESSAGE, INVOKE_MESSAGE, MESSAGE_PROPERTY_DATA, PROBE_MATCHES_MESSAGE, PROBE_MESSAGE, RENEW_MESSAGE, RENEW_RESPONSE_MESSAGE, RESOLVE_MATCHES_MESSAGE, RESOLVE_MESSAGE, SUBSCRIBE_MESSAGE, SUBSCRIBE_RESPONSE_MESSAGE, SUBSCRIPTION_END_MESSAGE, UNKNOWN_MESSAGE, UNSUBSCRIBE_MESSAGE, UNSUBSCRIBE_RESPONSE_MESSAGE
 
Constructor Summary
Message(SOAPHeader header)
          Constructor.
 
Method Summary
 AttributedURI getAction()
           
 AppSequence getAppSequence()
           
 java.lang.Object getCertificate()
          This is the certificate against which the messages signature will be validated. * Only used within the security module.
 SOAPHeader getHeader()
           
 AttributedURI getMessageId()
           
 java.lang.Object getPrivateKey()
          This is the private key with which this message will be signed.
 ProtocolInfo getProtocolInfo()
           
 AttributedURI getRelatesTo()
           
 EndpointReference getReplyTo()
           
 int getRoutingScheme()
          Gets the outgoing routing scheme for this message.
 URI getTargetAddress()
           
 XAddressInfo getTargetXAddressInfo()
           
 AttributedURI getTo()
           
abstract  int getType()
          Type of message.
 boolean isInbound()
          Returns true if this message was received over a remote communication channel.
 boolean isSecure()
          Send using WS-Security techniques.
 void setCertificate(java.lang.Object certificate)
          This is the certificate against which the messages signature will be validated.
 void setInbound(boolean inbound)
           
 void setPrivateKey(java.lang.Object privKey)
          This is the private key with which this message will be signed.
 void setProtocolInfo(ProtocolInfo Version)
           
 void setResponseTo(Message request)
          Sets the [relationship], [to] and [parameters] properties of this message to the values of the [message ID] and [reply to] properties of the passed in message.
 void setResponseTo(SOAPHeader requestHeader)
          Sets the [relationship], [to] and [parameters] properties of this message to the values of the [message ID] and [reply to] properties of the passed in SOAP header.
 void setRoutingScheme(int routingScheme)
           
 void setSecure(boolean b)
          Sets wether or not the message should be sent secure.
 void setTargetXAddressInfo(XAddressInfo targetXAddressInfo)
           
 java.lang.String toString()
           
 
Methods inherited from class org.ws4d.java.types.UnknownDataContainer
addUnknownAttribute, addUnknownElement, getUnknownAttribute, getUnknownAttributes, getUnknownElement, getUnknownElements, getUnknownElements, setUnknownAttributes, setUnknownElements
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN_ROUTING_SCHEME

public static final int UNKNOWN_ROUTING_SCHEME
See Also:
Constant Field Values

UNICAST_ROUTING_SCHEME

public static final int UNICAST_ROUTING_SCHEME
See Also:
Constant Field Values

MULTICAST_ROUTING_SCHEME

public static final int MULTICAST_ROUTING_SCHEME
See Also:
Constant Field Values
Constructor Detail

Message

public Message(SOAPHeader header)
Constructor.

Parameters:
header -
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class UnknownDataContainer

setResponseTo

public void setResponseTo(Message request)
Sets the [relationship], [to] and [parameters] properties of this message to the values of the [message ID] and [reply to] properties of the passed in message.

Parameters:
request - the message from which to extract the source properties

setResponseTo

public void setResponseTo(SOAPHeader requestHeader)
Sets the [relationship], [to] and [parameters] properties of this message to the values of the [message ID] and [reply to] properties of the passed in SOAP header.

Parameters:
requestHeader - the SOAP header from which to extract the source properties

getType

public abstract int getType()
Type of message.

Returns:
type.

getHeader

public SOAPHeader getHeader()

getAction

public AttributedURI getAction()

isSecure

public boolean isSecure()
Send using WS-Security techniques.


setCertificate

public void setCertificate(java.lang.Object certificate)
This is the certificate against which the messages signature will be validated. Only used within the security module.

Parameters:
certificate - must be the java.security.cert.Certificate of the sender device/service

setPrivateKey

public void setPrivateKey(java.lang.Object privKey)
This is the private key with which this message will be signed. Only used within the security module.

Parameters:
privKey - must be the java.security.PrivateKey of the sender device/ service

getCertificate

public java.lang.Object getCertificate()
This is the certificate against which the messages signature will be validated. * Only used within the security module.

Returns:
java.security.cert.Certificate

getPrivateKey

public java.lang.Object getPrivateKey()
This is the private key with which this message will be signed. Only used within the security module.

Returns:
java.security.PrivateKey

setSecure

public void setSecure(boolean b)
Sets wether or not the message should be sent secure. Caution: don't set this flag when received the message.


getMessageId

public AttributedURI getMessageId()

getRelatesTo

public AttributedURI getRelatesTo()

getTo

public AttributedURI getTo()

getReplyTo

public EndpointReference getReplyTo()

getAppSequence

public AppSequence getAppSequence()

getTargetAddress

public URI getTargetAddress()
Returns:
the targetAddress

getTargetXAddressInfo

public XAddressInfo getTargetXAddressInfo()
Returns:
the targetAddress

setTargetXAddressInfo

public void setTargetXAddressInfo(XAddressInfo targetXAddressInfo)
Parameters:
targetXAddressInfo - the targetAddress to set

isInbound

public boolean isInbound()
Returns true if this message was received over a remote communication channel. Returns false if the message is being sent from this stack instance.

Returns:
whether this is an inbound or an outbound message

setInbound

public void setInbound(boolean inbound)
Parameters:
inbound - the inbound to set

setProtocolInfo

public void setProtocolInfo(ProtocolInfo Version)

getProtocolInfo

public ProtocolInfo getProtocolInfo()

getRoutingScheme

public int getRoutingScheme()
Gets the outgoing routing scheme for this message. It can be unknown (0x0), unicast (0x1), multicast (0x2). http://en.wikipedia.org/wiki/Routing

Returns:

setRoutingScheme

public void setRoutingScheme(int routingScheme)