Class UsernameToken
java.lang.Object
com.sun.xml.ws.security.secext10.UsernameTokenType
com.sun.xml.ws.security.opt.impl.tokens.UsernameToken
- All Implemented Interfaces:
SecurityElement,SecurityElementWriter,SecurityHeaderElement,UsernameToken
public class UsernameToken
extends UsernameTokenType
implements UsernameToken, SecurityHeaderElement, SecurityElementWriter
Representation of UsernameToken SecurityHeaderElement
- Author:
- Ashutosh.Shahi@sun.com
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(String nsUri, String localName) getAttribute(QName name) Returns the created which may be null meaning no time of creation.Gets the local name of this header element.booleanisBSP()voidisBSP(boolean flag) Reads the header as aXMLStreamReader.booleanvoidsetCreationTime(String time) set the creation time.voidvoidset the nonce value.If nonce value is null then it will create one.voidsetPasswordValue(String passwd) Sets the password.voidsetUsernameValue(String username) sets the username value for this tokenvoidwriteTo(OutputStream os) voidwriteTo(XMLStreamWriter streamWriter) Writes out the header.voidwriteTo(XMLStreamWriter streamWriter, HashMap props) Methods inherited from class com.sun.xml.ws.security.secext10.UsernameTokenType
getAny, getCreated, getId, getIteration, getNonce, getOtherAttributes, getPassword, getSalt, getUsername, setCreated, setId, setIteration, setNonce, setPassword, setSalt, setUsernameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.sun.xml.ws.security.opt.api.SecurityElement
getId, setId
-
Field Details
-
MAX_NONCE_AGE
public static final long MAX_NONCE_AGE- See Also:
-
-
Constructor Details
-
UsernameToken
Creates a new instance of UsernameToken
-
-
Method Details
-
getUsernameValue
- Specified by:
getUsernameValuein interfaceUsernameToken- Returns:
- Returns the username.
-
setUsernameValue
Description copied from interface:UsernameTokensets the username value for this token- Specified by:
setUsernameValuein interfaceUsernameToken- Parameters:
username- username value
-
getPasswordValue
- Specified by:
getPasswordValuein interfaceUsernameToken- Returns:
- Returns the password which may be null meaning no password.
-
setPasswordValue
Sets the password.- Specified by:
setPasswordValuein interfaceUsernameToken- Parameters:
passwd-
-
getPasswordType
- Returns:
- Returns the passwordType.
-
getNonceEncodingType
- Returns:
- Returns the Nonce Encoding type.
-
getNonceValue
- Returns:
- Returns the encoded nonce. Null indicates no nonce was set.
- Throws:
SecurityTokenException
-
getCreatedValue
Returns the created which may be null meaning no time of creation. -
getPasswordDigestValue
-
setNonce
set the nonce value.If nonce value is null then it will create one.- Parameters:
nonceValue-
-
setCreationTime
set the creation time.- Parameters:
time- If null or empty then this method would create one.- Throws:
XWSSecurityException
-
setDigestOn
- Throws:
SecurityTokenException
-
isBSP
public void isBSP(boolean flag) -
isBSP
public boolean isBSP() -
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceSecurityElement- Returns:
- namespace uri of the security header element.
-
getLocalPart
Description copied from interface:SecurityElementGets the local name of this header element.- Specified by:
getLocalPartin interfaceSecurityElement- Returns:
- this string must be interned.
-
getAttribute
-
getAttribute
-
readHeader
Description copied from interface:SecurityElementReads the header as aXMLStreamReader.The returned parser points at the start element of this header. (IOW,
XMLStreamReader.getEventType()would returnXMLStreamConstants.START_ELEMENT.Performance Expectation
For some Header implementations, this operation is a non-trivial operation. Therefore, use of this method is discouraged unless the caller is interested in reading the whole header.
Similarly, if the caller wants to use this method only to do the API conversion (such as simply firing SAX events from
XMLStreamReader), then the JAX-WS team requests that you talk to us.Messages that come from tranport usually provides a reasonably efficient implementation of this method.
- Specified by:
readHeaderin interfaceSecurityElement- Returns:
- must not null.
- Throws:
XMLStreamException
-
writeTo
- Specified by:
writeToin interfaceSecurityElementWriter
-
writeTo
Description copied from interface:SecurityElementWriterWrites out the header.- Specified by:
writeToin interfaceSecurityElementWriter- Throws:
XMLStreamException- if the operation fails for some reason. This leaves the writer to an undefined state.
-
refersToSecHdrWithId
- Specified by:
refersToSecHdrWithIdin interfaceSecurityHeaderElement- Parameters:
id-- Returns:
-
writeTo
- Specified by:
writeToin interfaceSecurityElementWriter- Throws:
XMLStreamException
-