Coverage Report - org.mule.session.SimpleSessionHandler
 
Classes in this File Line Coverage Branch Coverage Complexity
SimpleSessionHandler
0%
0/8
N/A
1
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.session;
 8  
 
 9  
 import org.mule.api.MuleException;
 10  
 import org.mule.api.MuleMessage;
 11  
 import org.mule.api.MuleSession;
 12  
 import org.mule.api.config.MuleProperties;
 13  
 import org.mule.api.transport.SessionHandler;
 14  
 
 15  
 import org.apache.commons.logging.Log;
 16  
 import org.apache.commons.logging.LogFactory;
 17  
 
 18  
 /**
 19  
  * A session handler used to store and retrieve session information on an
 20  
  * event. The MuleSession information is stored as a header on the message (does not
 21  
  * support Tcp, Udp, etc. unless the MuleMessage object is serialised across the
 22  
  * wire). The session is stored in the "MULE_SESSION" property.
 23  
  */
 24  0
 public class SimpleSessionHandler implements SessionHandler
 25  
 {
 26  0
     protected transient Log logger = LogFactory.getLog(getClass());
 27  
 
 28  
     public MuleSession retrieveSessionInfoFromMessage(MuleMessage message) throws MuleException
 29  
     {
 30  0
         return message.getInboundProperty(MuleProperties.MULE_SESSION_PROPERTY);
 31  
     }
 32  
 
 33  
     /**
 34  
      * @deprecated Use retrieveSessionInfoFromMessage(MuleMessage message) instead
 35  
      */
 36  
     public void retrieveSessionInfoFromMessage(MuleMessage message, MuleSession session) throws MuleException
 37  
     {
 38  0
         session = retrieveSessionInfoFromMessage(message);
 39  0
     }
 40  
 
 41  
     public void storeSessionInfoToMessage(MuleSession session, MuleMessage message) throws MuleException
 42  
     {
 43  0
         message.setOutboundProperty(MuleProperties.MULE_SESSION_PROPERTY, session);
 44  0
     }
 45  
     
 46  
     /**
 47  
      * @deprecated This method is no longer needed and will be removed in the next major release
 48  
      */
 49  
     public String getSessionIDKey()
 50  
     {
 51  0
         return "ID";
 52  
     }
 53  
 }