microsoft.exchange.webservices.data
Class WSSecurityBasedCredentials

java.lang.Object
  extended by microsoft.exchange.webservices.data.ExchangeCredentials
      extended by microsoft.exchange.webservices.data.WSSecurityBasedCredentials
Direct Known Subclasses:
TokenCredentials, WindowsLiveCredentials

public abstract class WSSecurityBasedCredentials
extends ExchangeCredentials

WSSecurityBasedCredentials is the base class for all credential classes using WS-Security.


Field Summary
protected static java.lang.String wsAddressingHeadersFormat
          The Constant WsAddressingHeadersFormat.
protected static java.lang.String wsSecurityHeaderFormat
          The Constant WsSecurityHeaderFormat.
protected static java.lang.String wsSecurityPathSuffix
          The Constant WsSecurityPathSuffix.
protected static java.lang.String wsuTimeStampFormat
           
 
Constructor Summary
protected WSSecurityBasedCredentials()
          Initializes a new instance of the WSSecurityBasedCredentials class.
protected WSSecurityBasedCredentials(java.lang.String securityToken)
          Initializes a new instance of the WSSecurityBasedCredentials class.
protected WSSecurityBasedCredentials(java.lang.String securityToken, boolean addTimestamp)
          Initializes a new instance of the WSSecurityBasedCredentials class.
 
Method Summary
protected  java.net.URI adjustUrl(java.net.URI url)
          Adjusts the URL based on the credentials.
protected  void emitExtraSoapHeaderNamespaceAliases(javax.xml.stream.XMLStreamWriter writer)
          Emit the extra namespace aliases used for WS-Security and WS-Addressing.
protected  java.net.URI getEwsUrl()
          Gets the EWS URL.
protected  java.lang.String getSecurityToken()
          Gets the security token.
protected  void preAuthenticate()
          This method is called to pre-authenticate credentials before a service request is made.
protected  void serializeExtraSoapHeaders(javax.xml.stream.XMLStreamWriter writer, java.lang.String webMethodName)
          Serialize the WS-Security and WS-Addressing SOAP headers.
protected  void serializeWSSecurityHeaders(javax.xml.stream.XMLStreamWriter xmlWriter)
          Creates the WS-Security header necessary to send with an outgoing request.
protected  void setEwsUrl(java.net.URI value)
          Sets the EWS URL.
protected  void setSecurityToken(java.lang.String value)
          Sets the security token.
 
Methods inherited from class microsoft.exchange.webservices.data.ExchangeCredentials
getExchangeCredentialsFromNetworkCredential, getUriWithoutWSSecurity, isNeedSignature, prepareWebRequest, sign
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wsuTimeStampFormat

protected static final java.lang.String wsuTimeStampFormat
See Also:
Constant Field Values

wsAddressingHeadersFormat

protected static final java.lang.String wsAddressingHeadersFormat
The Constant WsAddressingHeadersFormat.

See Also:
Constant Field Values

wsSecurityHeaderFormat

protected static final java.lang.String wsSecurityHeaderFormat
The Constant WsSecurityHeaderFormat.

See Also:
Constant Field Values

wsSecurityPathSuffix

protected static final java.lang.String wsSecurityPathSuffix
The Constant WsSecurityPathSuffix.

See Also:
Constant Field Values
Constructor Detail

WSSecurityBasedCredentials

protected WSSecurityBasedCredentials()
Initializes a new instance of the WSSecurityBasedCredentials class.


WSSecurityBasedCredentials

protected WSSecurityBasedCredentials(java.lang.String securityToken)
Initializes a new instance of the WSSecurityBasedCredentials class.

Parameters:
securityToken - The security token.

WSSecurityBasedCredentials

protected WSSecurityBasedCredentials(java.lang.String securityToken,
                                     boolean addTimestamp)
Initializes a new instance of the WSSecurityBasedCredentials class.

Parameters:
securityToken - The security token.
addTimestamp - Timestamp should be added.
Method Detail

preAuthenticate

protected void preAuthenticate()
This method is called to pre-authenticate credentials before a service request is made.

Overrides:
preAuthenticate in class ExchangeCredentials

emitExtraSoapHeaderNamespaceAliases

protected void emitExtraSoapHeaderNamespaceAliases(javax.xml.stream.XMLStreamWriter writer)
                                            throws javax.xml.stream.XMLStreamException
Emit the extra namespace aliases used for WS-Security and WS-Addressing.

Overrides:
emitExtraSoapHeaderNamespaceAliases in class ExchangeCredentials
Parameters:
writer - The writer.
Throws:
javax.xml.stream.XMLStreamException - the xML stream exception

serializeExtraSoapHeaders

protected void serializeExtraSoapHeaders(javax.xml.stream.XMLStreamWriter writer,
                                         java.lang.String webMethodName)
                                  throws javax.xml.stream.XMLStreamException
Serialize the WS-Security and WS-Addressing SOAP headers.

Overrides:
serializeExtraSoapHeaders in class ExchangeCredentials
Parameters:
writer - The writer.
webMethodName - The Web method being called.
Throws:
javax.xml.stream.XMLStreamException - the xML stream exception

serializeWSSecurityHeaders

protected void serializeWSSecurityHeaders(javax.xml.stream.XMLStreamWriter xmlWriter)
                                   throws javax.xml.stream.XMLStreamException
Creates the WS-Security header necessary to send with an outgoing request.

Overrides:
serializeWSSecurityHeaders in class ExchangeCredentials
Parameters:
xmlWriter - The XML writer to serialize the headers to.
Throws:
javax.xml.stream.XMLStreamException - the xML stream exception

adjustUrl

protected java.net.URI adjustUrl(java.net.URI url)
                          throws java.net.URISyntaxException
Adjusts the URL based on the credentials.

Overrides:
adjustUrl in class ExchangeCredentials
Parameters:
url - The URL.
Returns:
Adjust URL.
Throws:
java.net.URISyntaxException - the uRI syntax exception

getSecurityToken

protected java.lang.String getSecurityToken()
Gets the security token.


setSecurityToken

protected void setSecurityToken(java.lang.String value)
Sets the security token.


getEwsUrl

protected java.net.URI getEwsUrl()
Gets the EWS URL.


setEwsUrl

protected void setEwsUrl(java.net.URI value)
Sets the EWS URL.