public final class DefaultMuleSession extends Object implements MuleSession
DefaultMuleSession
manages the interaction and distribution of events for Mule Services.Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
clearProperties() |
Map<String,TypedValue> |
getExtendedProperties() |
FlowConstruct |
getFlowConstruct()
WARNING: 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.
|
DataType<?> |
getPropertyDataType(String name)
Retrieves a session scope property data type
|
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)
WARNING: This method should not be used, and is only here for backwards compatibility
|
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 |
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.
|
public DefaultMuleSession()
public DefaultMuleSession(MuleSession session)
@Deprecated public DefaultMuleSession(MuleContext muleContext)
@Deprecated public DefaultMuleSession(FlowConstruct flowConstruct, MuleContext muleContext)
@Deprecated public DefaultMuleSession(MuleSession source, MuleContext muleContext)
@Deprecated public DefaultMuleSession(MuleSession source, FlowConstruct flowConstruct)
public String getId()
MuleSession
getId
in interface MuleSession
public boolean isValid()
MuleSession
isValid
in interface MuleSession
public void setValid(boolean value)
MuleSession
setValid
in interface MuleSession
value
- true if the session is valid, false otherwisepublic void setSecurityContext(SecurityContext context)
setSecurityContext
in interface MuleSession
context
- the context for this session or null if the request is not secure.public SecurityContext getSecurityContext()
getSecurityContext
in interface MuleSession
public void setProperty(String key, Object value)
setProperty
in interface MuleSession
key
- the key for the object data being stored on the sessionvalue
- the value of the session datapublic <T> T getProperty(Object key)
getProperty
in interface MuleSession
key
- the key for the object data being stored on the sessionpublic Object removeProperty(Object key)
removeProperty
in interface MuleSession
key
- the key for the object data being stored on the session@Deprecated public Iterator<String> getPropertyNames()
getPropertyNames
in interface MuleSession
public Set<String> getPropertyNamesAsSet()
getPropertyNamesAsSet
in interface MuleSession
public void merge(MuleSession updatedSession)
MuleSession
merge
in interface MuleSession
updatedSession
- mule session with updated propertiespublic Map<String,TypedValue> getExtendedProperties()
public void setProperty(String key, Serializable value)
MuleSession
setProperty
in interface MuleSession
key
- the key for the object data being stored on the sessionvalue
- the value of the session datapublic void setProperty(String key, Serializable value, DataType<?> dataType)
MuleSession
setProperty
in interface MuleSession
key
- the key for the object data being stored on the sessionvalue
- the value of the session datadataType
- the data type for the property valuepublic <T> T getProperty(String key)
MuleSession
getProperty
in interface MuleSession
key
- the key for the object data being stored on the sessionpublic Object removeProperty(String key)
MuleSession
removeProperty
in interface MuleSession
key
- the key for the object data being stored on the sessionpublic void clearProperties()
clearProperties
in interface MuleSession
public FlowConstruct getFlowConstruct()
MuleSession
getFlowConstruct
in interface MuleSession
public void setFlowConstruct(FlowConstruct flowConstruct)
MuleSession
setFlowConstruct
in interface MuleSession
public DataType<?> getPropertyDataType(String name)
MuleSession
getPropertyDataType
in interface MuleSession
name
- the name for the session propertyCopyright © 2003–2016 MuleSoft, Inc.. All rights reserved.