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 String WSAddressing10Namespace
          The Constant WSAddressing10Namespace.
protected static String WSAddressing10NamespacePrefix
          The Constant WSAddressing10NamespacePrefix.
protected static String WsAddressingHeadersFormat
          The Constant WsAddressingHeadersFormat.
protected static String WsSecurityHeaderFormat
          The Constant WsSecurityHeaderFormat.
protected static String WsSecurityPathSuffix
          The Constant WsSecurityPathSuffix.
protected static String WSSecuritySecExt10Namespace
          The Constant WSSecuritySecExt10Namespace.
protected static String WSSecuritySecExt10NamespacePrefix
          The Constant WSSecuritySecExt10NamespacePrefix.
 
Constructor Summary
protected WSSecurityBasedCredentials()
          Initializes a new instance of the WSSecurityBasedCredentials class.
protected WSSecurityBasedCredentials(String securityToken)
          Initializes a new instance of the WSSecurityBasedCredentials class.
 
Method Summary
protected  URI adjustUrl(URI url)
          Adjusts the URL based on the credentials.
protected  void emitExtraSoapHeaderNamespaceAliases(XMLStreamWriter writer)
          Emit the extra namespace aliases used for WS-Security and WS-Addressing.
protected  URI getEwsUrl()
          Gets the EWS URL.
protected  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(XMLStreamWriter writer, String webMethodName)
          Serialize the WS-Security and WS-Addressing SOAP headers.
protected  void serializeWSSecurityHeaders(XMLStreamWriter xmlWriter)
          Creates the WS-Security header necessary to send with an outgoing request.
protected  void setEwsUrl(URI value)
          Sets the EWS URL.
protected  void setSecurityToken(String value)
          Sets the security token.
 
Methods inherited from class microsoft.exchange.webservices.data.ExchangeCredentials
getExchangeCredentialsFromNetworkCredential, prepareWebRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WSSecuritySecExt10NamespacePrefix

protected static final String WSSecuritySecExt10NamespacePrefix
The Constant WSSecuritySecExt10NamespacePrefix.

See Also:
Constant Field Values

WSSecuritySecExt10Namespace

protected static final String WSSecuritySecExt10Namespace
The Constant WSSecuritySecExt10Namespace.

See Also:
Constant Field Values

WSAddressing10NamespacePrefix

protected static final String WSAddressing10NamespacePrefix
The Constant WSAddressing10NamespacePrefix.

See Also:
Constant Field Values

WSAddressing10Namespace

protected static final String WSAddressing10Namespace
The Constant WSAddressing10Namespace.

See Also:
Constant Field Values

WsAddressingHeadersFormat

protected static final String WsAddressingHeadersFormat
The Constant WsAddressingHeadersFormat.

See Also:
Constant Field Values

WsSecurityHeaderFormat

protected static final String WsSecurityHeaderFormat
The Constant WsSecurityHeaderFormat.

See Also:
Constant Field Values

WsSecurityPathSuffix

protected static final 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(String securityToken)
Initializes a new instance of the WSSecurityBasedCredentials class.

Parameters:
securityToken - The security token.
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(XMLStreamWriter writer)
                                            throws XMLStreamException
Emit the extra namespace aliases used for WS-Security and WS-Addressing.

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

serializeExtraSoapHeaders

protected void serializeExtraSoapHeaders(XMLStreamWriter writer,
                                         String webMethodName)
                                  throws 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:
XMLStreamException - the xML stream exception

serializeWSSecurityHeaders

protected void serializeWSSecurityHeaders(XMLStreamWriter xmlWriter)
                                   throws 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:
XMLStreamException - the xML stream exception

adjustUrl

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

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

getSecurityToken

protected String getSecurityToken()
Gets the security token.


setSecurityToken

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


getEwsUrl

protected URI getEwsUrl()
Gets the EWS URL.


setEwsUrl

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



Copyright © 2012. All Rights Reserved.