org.opensaml.ws.message.decoder
Class BaseMessageDecoder

java.lang.Object
  extended by org.opensaml.ws.message.decoder.BaseMessageDecoder
All Implemented Interfaces:
MessageDecoder
Direct Known Subclasses:
BaseHandlerChainAwareMessageDecoder

public abstract class BaseMessageDecoder
extends Object
implements MessageDecoder

Base class for message decoders.


Field Summary
private  org.slf4j.Logger log
          Class logger.
private  ParserPool parserPool
          Parser pool used to deserialize the message.
private  org.slf4j.Logger protocolMessageLog
          Used to log protocol messages.
 
Constructor Summary
BaseMessageDecoder()
          Constructor.
BaseMessageDecoder(ParserPool pool)
          Constructor.
 
Method Summary
 void decode(MessageContext messageContext)
          Decodes a message in a binding specific manner.
protected abstract  void doDecode(MessageContext messageContext)
          Decodes a message, updating the message context.
protected  ParserPool getParserPool()
          Gets the parser pool used to deserialize incomming messages.
protected  void logDecodedMessage(MessageContext messageContext)
          Log the decoded message to the protocol message logger.
protected  void processSecurityPolicy(MessageContext messageContext)
          Process any SecurityPolicys which can be resolved for the message context.
protected  void setParserPool(ParserPool pool)
          Sets the parser pool used to deserialize incomming messages.
protected  XMLObject unmarshallMessage(InputStream messageStream)
          Helper method that deserializes and unmarshalls the message from the given stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

protocolMessageLog

private org.slf4j.Logger protocolMessageLog
Used to log protocol messages.


log

private final org.slf4j.Logger log
Class logger.


parserPool

private ParserPool parserPool
Parser pool used to deserialize the message.

Constructor Detail

BaseMessageDecoder

public BaseMessageDecoder()
Constructor.


BaseMessageDecoder

public BaseMessageDecoder(ParserPool pool)
Constructor.

Parameters:
pool - parser pool used to deserialize messages
Method Detail

decode

public void decode(MessageContext messageContext)
            throws MessageDecodingException,
                   SecurityException
Decodes a message in a binding specific manner.

Specified by:
decode in interface MessageDecoder
Parameters:
messageContext - current message context
Throws:
MessageDecodingException - thrown if the message can not be decoded
SecurityException - thrown if the decoded message does not meet the required security constraints

logDecodedMessage

protected void logDecodedMessage(MessageContext messageContext)
Log the decoded message to the protocol message logger.

Parameters:
messageContext - the message context to process

processSecurityPolicy

protected void processSecurityPolicy(MessageContext messageContext)
                              throws SecurityException
Process any SecurityPolicys which can be resolved for the message context.

Parameters:
messageContext - the message context to process
Throws:
SecurityException - thrown if the decoded message does not meet the required security constraints

doDecode

protected abstract void doDecode(MessageContext messageContext)
                          throws MessageDecodingException
Decodes a message, updating the message context. Security policy evaluation is handled outside this method.

Parameters:
messageContext - current message context
Throws:
MessageDecodingException - thrown if there is a problem decoding the message

getParserPool

protected ParserPool getParserPool()
Gets the parser pool used to deserialize incomming messages.

Returns:
parser pool used to deserialize incomming messages

setParserPool

protected void setParserPool(ParserPool pool)
Sets the parser pool used to deserialize incomming messages.

Parameters:
pool - parser pool used to deserialize incomming messages

unmarshallMessage

protected XMLObject unmarshallMessage(InputStream messageStream)
                               throws MessageDecodingException
Helper method that deserializes and unmarshalls the message from the given stream.

Parameters:
messageStream - input stream containing the message
Returns:
the inbound message
Throws:
MessageDecodingException - thrown if there is a problem deserializing and unmarshalling the message


Copyright © 1999-2013. All Rights Reserved.