public class RequestScope extends AbstractMapBasedScope implements IRequestScope
m_aRWLockm_aAttrs| Constructor and Description |
|---|
RequestScope(String sScopeID,
String sSessionID) |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getAttributeAsList(String sName)
Get a list of all attribute values with the same name.
|
List<String> |
getAttributeAsList(String sName,
List<String> aDefault)
Get a list of all attribute values with the same name.
|
protected List<String> |
getAttributeAsListCustom(String sName,
Object aValue,
List<String> aDefault)
|
String |
getSessionID()
Shortcut for
getSessionID(true) |
String |
getSessionID(boolean bCreateIfNotExisting) |
boolean |
hasAttributeValue(String sName,
String sDesiredValue)
Check if a attribute with the given name is present in the request and has
the specified value.
|
boolean |
hasAttributeValue(String sName,
String sDesiredValue,
boolean bDefault)
Check if a attribute with the given name is present in the request and has
the specified value.
|
void |
initScope()
Init the scope.
|
protected void |
postDestroy()
Override this method to perform further actions AFTER the scope was
destroyed.
|
protected void |
preDestroy()
Override this method to perform further actions BEFORE the scope is
destroyed.
|
String |
toString() |
destroyOwnedScopes, destroyScope, equals, getAllScopeRenewalAwareAttributes, getID, hashCode, isDestroyed, isInDestruction, isInPreDestruction, isValid, runAtomic, runAtomicgetAndSetAttributeFlag, getClone, setAttribute, setAttribute, setAttribute, setAttributeclear, onBeforeRemoveAllAttributes, onBeforeRemoveAttribute, onBeforeSetAttributeValue, removeAttribute, setAttribute, setAttributes, setAttributescontainsAttribute, containsNoAttribute, getAllAttributeNames, getAllAttributes, getAllAttributeValues, getAttributeCount, getAttributeObjectgetAsBigDecimal, getAsBigInteger, getAsBoolean, getAsDouble, getAsInt, getAsLong, getAsString, getAttributeAsBigDecimal, getAttributeAsBigDecimal, getAttributeAsBigInteger, getAttributeAsBigInteger, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDouble, getAttributeAsDouble, getAttributeAsInt, getAttributeAsInt, getAttributeAsLong, getAttributeAsLong, getAttributeAsString, getAttributeAsString, getCastedAttribute, getCastedAttribute, getTypedAttribute, getTypedAttributeclone, finalize, getClass, notify, notifyAll, wait, wait, waitdestroyScope, getAllScopeRenewalAwareAttributes, getID, isDestroyed, isInDestruction, isValid, runAtomic, runAtomicgetAndSetAttributeFlag, setAttribute, setAttribute, setAttribute, setAttributeremoveAttribute, setAttribute, setAttributes, setAttributescontainsAttribute, containsNoAttribute, getAllAttributeNames, getAllAttributes, getAllAttributeValues, getAttributeAsBigDecimal, getAttributeAsBigDecimal, getAttributeAsBigInteger, getAttributeAsBigInteger, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDouble, getAttributeAsDouble, getAttributeAsInt, getAttributeAsInt, getAttributeAsLong, getAttributeAsLong, getAttributeAsString, getAttributeAsString, getAttributeCount, getAttributeObject, getCastedAttribute, getCastedAttribute, getTypedAttribute, getTypedAttributeclear@Nonnull @Nonempty public final String getSessionID()
IRequestScopegetSessionID(true)getSessionID in interface IRequestScopenull if no session ID is present and no session should
be created.@Nonnull @Nonempty public final String getSessionID(boolean bCreateIfNotExisting)
getSessionID in interface IRequestScopebCreateIfNotExisting - if true a session ID is created if needednull if no session ID is present and no session should
be created.public void initScope()
IScopeprotected void preDestroy()
AbstractMapBasedScopepreDestroy in class AbstractMapBasedScopeprotected void postDestroy()
AbstractMapBasedScopepostDestroy in class AbstractMapBasedScope@Nullable public List<String> getAttributeAsList(@Nullable String sName)
IRequestScopegetAttributeAsList in interface IRequestScopesName - The name of the attribute to query.null if no such attribute value exists@Nullable @OverrideOnDemand protected List<String> getAttributeAsListCustom(@Nullable String sName, @Nonnull Object aValue, @Nullable List<String> aDefault)
List of String. This
method is only called, if the passed value is non-null, if it
is not an String array or a single String.sName - The name of the parameter to be queried. Just for informational
purposes.aValue - The retrieved non-null attribute value which is neither
a String nor a String array.aDefault - The default value to be returned, in case no type conversion could
be found.@Nullable public List<String> getAttributeAsList(@Nullable String sName, @Nullable List<String> aDefault)
IRequestScopegetAttributeAsList in interface IRequestScopesName - The name of the attribute to query.aDefault - The default value to be returned, if no such attribute is present.aDefault if no such attribute value existspublic boolean hasAttributeValue(@Nullable String sName, @Nullable String sDesiredValue)
IRequestScopehasAttributeValue in interface IRequestScopesName - The name of the attribute to checksDesiredValue - The value to be matchedtrue if an attribute with the given name is present
and has the desired valuepublic boolean hasAttributeValue(@Nullable String sName, @Nullable String sDesiredValue, boolean bDefault)
IRequestScopehasAttributeValue in interface IRequestScopesName - The name of the attribute to checksDesiredValue - The value to be matchedbDefault - the default value to be returned, if the specified attribute is not
presenttrue if an attribute with the given name is present
and has the desired value, false if the attribute is
present but has a different value. If the attribute is not present,
the default value is returned.public String toString()
toString in class AbstractMapBasedScopeCopyright © 2014–2015 Philip Helger. All rights reserved.