org.mule.session
Class DefaultMuleSession

java.lang.Object
  extended by org.mule.session.DefaultMuleSession
All Implemented Interfaces:
Serializable, MuleSession

public final class DefaultMuleSession
extends Object
implements MuleSession

DefaultMuleSession manages the interaction and distribution of events for Mule Services.

See Also:
Serialized Form

Constructor Summary
DefaultMuleSession()
           
DefaultMuleSession(FlowConstruct flowConstruct, MuleContext muleContext)
          Deprecated. 
DefaultMuleSession(MuleContext muleContext)
          Deprecated. 
DefaultMuleSession(MuleSession session)
           
DefaultMuleSession(MuleSession source, FlowConstruct flowConstruct)
          Deprecated. 
DefaultMuleSession(MuleSession source, MuleContext muleContext)
          Deprecated. 
 
Method Summary
 void clearProperties()
           
 FlowConstruct getFlowConstruct()
          WANRING: This method will always return null unless you created the DefaultMuleSession with a flowConstruct or set one using the setter.
 String getId()
          Returns the unique id for this session
 Map<String,Object> getProperties()
           
<T> T
getProperty(Object key)
          Will retrieve a session level property.
<T> T
getProperty(String key)
          Will retrieve a session scope property.
 Iterator<String> getPropertyNames()
          Deprecated. Use getPropertyNamesAsSet() instead
 Set<String> getPropertyNamesAsSet()
           
 SecurityContext getSecurityContext()
          The security context for this session.
 boolean isValid()
          Determines if this session is valid.
 void merge(MuleSession updatedSession)
          Merge current session with an updated version Result session will contain all the properties from updatedSession plus those properties in the current session that couldn't be serialized In case updatedSession is null, then no change will be applied.
 Object removeProperty(Object key)
          Will retrieve a session level property and remove it from the session
 Object removeProperty(String key)
          Will retrieve a session scope property and remove it from the session
 void setFlowConstruct(FlowConstruct flowConstruct)
          WANRING: This method should not be used, and is only here for bacwards compatability
 void setProperty(String key, Object value)
          Will set a session level property.
 void setProperty(String key, Serializable value)
          Will set a session scope property.
 void setSecurityContext(SecurityContext context)
          The security context for this session.
 void setValid(boolean value)
          Determines if this session is valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMuleSession

public DefaultMuleSession()

DefaultMuleSession

public DefaultMuleSession(MuleSession session)

DefaultMuleSession

@Deprecated
public DefaultMuleSession(MuleContext muleContext)
Deprecated. 


DefaultMuleSession

@Deprecated
public DefaultMuleSession(FlowConstruct flowConstruct,
                                     MuleContext muleContext)
Deprecated. 


DefaultMuleSession

@Deprecated
public DefaultMuleSession(MuleSession source,
                                     MuleContext muleContext)
Deprecated. 


DefaultMuleSession

@Deprecated
public DefaultMuleSession(MuleSession source,
                                     FlowConstruct flowConstruct)
Deprecated. 

Method Detail

getId

public String getId()
Description copied from interface: MuleSession
Returns the unique id for this session

Specified by:
getId in interface MuleSession
Returns:
the unique id for this session

isValid

public boolean isValid()
Description copied from interface: MuleSession
Determines if this session is valid. A session becomes invalid if an exception occurs while processing

Specified by:
isValid in interface MuleSession
Returns:
true if the session is valid, false otherwise

setValid

public void setValid(boolean value)
Description copied from interface: MuleSession
Determines if this session is valid. A session becomes invalid if an exception occurs while processing

Specified by:
setValid in interface MuleSession
Parameters:
value - true if the session is valid, false otherwise

setSecurityContext

public void setSecurityContext(SecurityContext context)
The security context for this session. If not null outbound, inbound and/or method invocations will be authenticated using this context

Specified by:
setSecurityContext in interface MuleSession
Parameters:
context - the context for this session or null if the request is not secure.

getSecurityContext

public SecurityContext getSecurityContext()
The security context for this session. If not null outbound, inbound and/or method invocations will be authenticated using this context

Specified by:
getSecurityContext in interface MuleSession
Returns:
the context for this session or null if the request is not secure.

setProperty

public void setProperty(String key,
                        Object value)
Will set a session level property. These will either be stored and retrieved using the underlying transport mechanism of stored using a default mechanism

Specified by:
setProperty in interface MuleSession
Parameters:
key - the key for the object data being stored on the session
value - the value of the session data

getProperty

public <T> T getProperty(Object key)
Will retrieve a session level property.

Specified by:
getProperty in interface MuleSession
Parameters:
key - the key for the object data being stored on the session
Returns:
the value of the session data or null if the property does not exist

removeProperty

public Object removeProperty(Object key)
Will retrieve a session level property and remove it from the session

Specified by:
removeProperty in interface MuleSession
Parameters:
key - the key for the object data being stored on the session
Returns:
the value of the session data or null if the property does not exist

getPropertyNames

@Deprecated
public Iterator<String> getPropertyNames()
Deprecated. Use getPropertyNamesAsSet() instead

Returns an iterater of property keys for the session properties on this session

Specified by:
getPropertyNames in interface MuleSession
Returns:
an iterater of property keys for the session properties on this session

getPropertyNamesAsSet

public Set<String> getPropertyNamesAsSet()
Specified by:
getPropertyNamesAsSet in interface MuleSession
Returns:
property keys for all session properties

merge

public void merge(MuleSession updatedSession)
Description copied from interface: MuleSession
Merge current session with an updated version Result session will contain all the properties from updatedSession plus those properties in the current session that couldn't be serialized In case updatedSession is null, then no change will be applied.

Specified by:
merge in interface MuleSession
Parameters:
updatedSession - mule session with updated properties

getProperties

public Map<String,Object> getProperties()

setProperty

public void setProperty(String key,
                        Serializable value)
Description copied from interface: MuleSession
Will set a session scope property.

Specified by:
setProperty in interface MuleSession
Parameters:
key - the key for the object data being stored on the session
value - the value of the session data

getProperty

public <T> T getProperty(String key)
Description copied from interface: MuleSession
Will retrieve a session scope property.

Specified by:
getProperty in interface MuleSession
Parameters:
key - the key for the object data being stored on the session
Returns:
the value of the session data or null if the property does not exist

removeProperty

public Object removeProperty(String key)
Description copied from interface: MuleSession
Will retrieve a session scope property and remove it from the session

Specified by:
removeProperty in interface MuleSession
Parameters:
key - the key for the object data being stored on the session
Returns:
the value of the session data or null if the property does not exist

clearProperties

public void clearProperties()
Specified by:
clearProperties in interface MuleSession

getFlowConstruct

public FlowConstruct getFlowConstruct()
Description copied from interface: MuleSession
WANRING: This method will always return null unless you created the DefaultMuleSession with a flowConstruct or set one using the setter. This method should not be used, and is only here for bacwards compatability

Specified by:
getFlowConstruct in interface MuleSession

setFlowConstruct

public void setFlowConstruct(FlowConstruct flowConstruct)
Description copied from interface: MuleSession
WANRING: This method should not be used, and is only here for bacwards compatability

Specified by:
setFlowConstruct in interface MuleSession


Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.