public interface MuleSession extends Serializable
MuleSession
is the context in which a request is processed by Mule. The scope of the
MuleSession context includes all Mule Flows and Services that the request is routed through on the same or
different Mule instances. A MuleSession instance has a unique id, session scope properties and an optional
security context.
In order for the session to be propagated from one Flow or Service to the next a transports that support
message properties needs to be used. A SessionHandler
is used to store the session in an outbound
message property and then retrieve it from an inbound property using a specific strategy.
SessionHandler
Modifier and Type | Method and Description |
---|---|
void |
clearProperties() |
FlowConstruct |
getFlowConstruct()
Deprecated.
|
String |
getId()
Returns the unique id for this session
|
<T> T |
getProperty(Object key)
Deprecated.
|
<T> T |
getProperty(String key)
Will retrieve a session scope property.
|
DataType<?> |
getPropertyDataType(String name)
Retrieves a session scope property data type
|
Iterator |
getPropertyNames()
Deprecated.
Use getPropertyNamesAsSet() instead (Will be removed in 4.0)
|
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)
Deprecated.
|
Object |
removeProperty(String key)
Will retrieve a session scope property and remove it from the session
|
void |
setFlowConstruct(FlowConstruct flowConstruct)
Deprecated.
|
void |
setProperty(String key,
Object value)
Deprecated.
|
void |
setProperty(String key,
Serializable value)
Will set a session scope property.
|
void |
setProperty(String key,
Serializable value,
DataType<?> dataType)
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.
|
boolean isValid()
void setValid(boolean value)
value
- true if the session is valid, false otherwiseString getId()
void setSecurityContext(SecurityContext context)
context
- the context for this session or null if the request is not secure.SecurityContext getSecurityContext()
void setProperty(String key, Serializable value)
key
- the key for the object data being stored on the sessionvalue
- the value of the session datavoid setProperty(String key, Serializable value, DataType<?> dataType)
key
- the key for the object data being stored on the sessionvalue
- the value of the session datadataType
- the data type for the property value@Deprecated void setProperty(String key, Object value)
<T> T getProperty(String key)
key
- the key for the object data being stored on the session@Deprecated <T> T getProperty(Object key)
Object removeProperty(String key)
key
- the key for the object data being stored on the session@Deprecated Object removeProperty(Object key)
Iterator getPropertyNames()
Set<String> getPropertyNamesAsSet()
void merge(MuleSession updatedSession)
updatedSession
- mule session with updated propertiesvoid clearProperties()
@Deprecated FlowConstruct getFlowConstruct()
@Deprecated void setFlowConstruct(FlowConstruct flowConstruct)
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.