Interface InputDataContainer
-
- All Superinterfaces:
AutoCloseable
,Closeable
,PluginDataContainer
,Serializable
,UserAttributeContainer
- All Known Subinterfaces:
DataContainer
,IndexedAccessDataContainer
,InstanceDataContainer
public interface InputDataContainer extends Serializable, UserAttributeContainer, PluginDataContainer, Closeable
This interface encapsulates the data context of an application for read-only accessing the values of input parameters of an application. The methods resemble the retrieval methods inProcessAwareAccess
but with less information. When using DataContainer only the name of the corresponding parameter and a session token is necessary since all other information (instance, data element, agent,...) is already provided when retrieving the container.
The data container may be lazy, which means, it retrieves the values of the data elements when they are accessed. It is also allowed to be eager and store all values internally and it may be in-between, for instance, store simple values internally and retrieve big values lazily.Implementations of this interface may not store an Instance internally since a process instance must be accessible by other components. Instead, all needed information has to be encapsulated in the container. The instance may be provided, for instance, in the constructor, but the reference to it has to be released afterwards.
-
-
Field Summary
Fields Modifier and Type Field Description static long
serialVersionUID
Generated ID for serialisation.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static Map<String,Serializable>
copyMapWrapUdts(Map<String,Serializable> map)
Creates a copy of the designated map, wraps allUDTValue
to prevent their closing and makes the copy unmodifiable.boolean
isNull(SessionToken session, String parameterName)
Returns whether the value of the designated input parameter is NULL which means the data element has not been written or has been consumed yet or has been explicitly set to NULL by a previous application.boolean
retrieveBoolean(SessionToken session, String parameterName)
Retrieves the boolean value of the designated input parameter of type BOOLEAN.Date
retrieveDate(SessionToken session, String parameterName)
Retrieves the date value of the designated input parameter of type DATE.double
retrieveFloat(SessionToken session, String parameterName)
Retrieves the double value of the designated input parameter of type FLOAT.long
retrieveInteger(SessionToken session, String parameterName)
Retrieves the long value of the designated input parameter of type INTEGER.String
retrieveString(SessionToken session, String parameterName)
Retrieves the string value of the designated input parameter of type STRING.UDTValue
retrieveUDT(SessionToken session, String parameterName)
Retrieves (the proxy of) the value of the designated input parameter of user-defined type (UDT).URI
retrieveURI(SessionToken session, String parameterName)
Retrieves the URI value of the designated input parameter of type URI.-
Methods inherited from interface de.aristaflow.adept2.model.common.PluginDataContainer
getPluginData, getPluginDatas, getSupportedPlugins
-
Methods inherited from interface de.aristaflow.adept2.model.common.UserAttributeContainer
getUserAttributes, getUserAttributeValue, removeUserAttributeValue, setUserAttributeValue
-
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
Generated ID for serialisation.- See Also:
- Constant Field Values
-
-
Method Detail
-
isNull
boolean isNull(SessionToken session, String parameterName) throws NoSuchParameterException
Returns whether the value of the designated input parameter is NULL which means the data element has not been written or has been consumed yet or has been explicitly set to NULL by a previous application. This method has to be called before retrieving a value.- Parameters:
session
- The session which is used to check for access rights on this method and to retrieve the accessing agent and the corresponding organisational position.parameterName
- The name of the input parameter to check for NULL.- Returns:
true
if the value of the designated input parameter is NULL and therefore has not been written or has been consumed yet.- Throws:
NoSuchParameterException
- If the input parameter of the designated name does not exist, aNoSuchParameterException
will be thrown.
-
retrieveInteger
long retrieveInteger(SessionToken session, String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Retrieves the long value of the designated input parameter of type INTEGER. Callers should first check whether the value is null by callingisNull(SessionToken, String)
. Otherwise in case of NULL anIllegalStateException
will be thrown.- Parameters:
session
- The session which is used to check for access rights on this method and to retrieve the accessing agent and the corresponding organisational position.parameterName
- The name of the input parameter to be read.- Returns:
- The value of the input parameter of ADEPT2-type INTEGER and of Java-type
long
. - Throws:
NoSuchParameterException
- If the input parameter of the designated name does not exist, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated input parameter is not of type INTEGER, anInvalidDataTypeException
will be raised.IllegalStateException
- If the value of the designated input parameter is NULL anIllegalStateException
will be thrown.- See Also:
ProcessConstants.AdeptDataType.INTEGER
-
retrieveFloat
double retrieveFloat(SessionToken session, String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Retrieves the double value of the designated input parameter of type FLOAT. Callers should first check whether the value is null by callingisNull(SessionToken, String)
. Otherwise in case of NULL anIllegalStateException
will be thrown.- Parameters:
session
- The session which is used to check for access rights on this method and to retrieve the accessing agent and the corresponding organisational position.parameterName
- The name of the input parameter to be read.- Returns:
- The value of the input parameter of ADEPT2-type FLOAT and of Java-type
double
. - Throws:
NoSuchParameterException
- If the input parameter of the designated name does not exist, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated input parameter is not of type FLOAT, anInvalidDataTypeException
will be raised.IllegalStateException
- If the value of the designated input parameter is NULL anIllegalStateException
will be thrown.- See Also:
ProcessConstants.AdeptDataType.FLOAT
-
retrieveBoolean
boolean retrieveBoolean(SessionToken session, String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Retrieves the boolean value of the designated input parameter of type BOOLEAN. Callers should first check whether the value is null by callingisNull(SessionToken, String)
. Otherwise in case of NULL anIllegalStateException
will be thrown.- Parameters:
session
- The session which is used to check for access rights on this method and to retrieve the accessing agent and the corresponding organisational position.parameterName
- The name of the input parameter to be read.- Returns:
- The value of the input parameter of ADEPT2-type BOOLEAN and of Java-type
boolean
. - Throws:
NoSuchParameterException
- If the input parameter of the designated name does not exist, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated input parameter is not of type BOOLEAN, anInvalidDataTypeException
will be raised.IllegalStateException
- If the value of the designated input parameter is NULL anIllegalStateException
will be thrown.- See Also:
ProcessConstants.AdeptDataType.BOOLEAN
-
retrieveString
String retrieveString(SessionToken session, String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Retrieves the string value of the designated input parameter of type STRING. Callers should first check whether the value is null by callingisNull(SessionToken, String)
. Otherwise in case of NULL anIllegalStateException
will be thrown.- Parameters:
session
- The session which is used to check for access rights on this method and to retrieve the accessing agent and the corresponding organisational position.parameterName
- The name of the input parameter to be read.- Returns:
- The value of the input parameter of ADEPT2-type STRING and of Java-type
String
. - Throws:
NoSuchParameterException
- If the input parameter of the designated name does not exist, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated input parameter is not of type STRING, anInvalidDataTypeException
will be raised.IllegalStateException
- If the value of the designated input parameter is NULL anIllegalStateException
will be thrown.- See Also:
ProcessConstants.AdeptDataType.STRING
-
retrieveDate
Date retrieveDate(SessionToken session, String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Retrieves the date value of the designated input parameter of type DATE. Callers should first check whether the value is null by callingisNull(SessionToken, String)
. Otherwise in case of NULL anIllegalStateException
will be thrown.- Parameters:
session
- The session which is used to check for access rights on this method and to retrieve the accessing agent and the corresponding organisational position.parameterName
- The name of the input parameter to be read.- Returns:
- The value of the input parameter of ADEPT2-type DATE and of Java-type
java.util.Date
. - Throws:
NoSuchParameterException
- If the input parameter of the designated name does not exist, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated input parameter is not of type DATE, anInvalidDataTypeException
will be raised.IllegalStateException
- If the value of the designated input parameter is NULL anIllegalStateException
will be thrown.- See Also:
ProcessConstants.AdeptDataType.DATE
-
retrieveURI
URI retrieveURI(SessionToken session, String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Retrieves the URI value of the designated input parameter of type URI. Callers should first check whether the value is null by callingisNull(SessionToken, String)
. Otherwise in case of NULL anIllegalStateException
will be thrown.- Parameters:
session
- The session which is used to check for access rights on this method and to retrieve the accessing agent and the corresponding organisational position.parameterName
- The name of the input parameter to be read.- Returns:
- The value of the input parameter of ADEPT2-type URI and of Java-type
java.net.URI
. - Throws:
NoSuchParameterException
- If the input parameter of the designated name does not exist, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated input parameter is not of type URI, anInvalidDataTypeException
will be raised.IllegalStateException
- If the value of the designated input parameter is NULL anIllegalStateException
will be thrown.- See Also:
ProcessConstants.AdeptDataType.URI
-
retrieveUDT
UDTValue retrieveUDT(SessionToken session, String parameterName) throws NoSuchParameterException, InvalidDataTypeException
Retrieves (the proxy of) the value of the designated input parameter of user-defined type (UDT). Callers should first check whether the value is null by callingisNull(SessionToken, String)
. Otherwise in case of NULL anIllegalStateException
will be thrown.- Parameters:
session
- The session which is used to check for access rights on this method and to retrieve the accessing agent and the corresponding organisational position.parameterName
- The name of the input parameter to be read.- Returns:
- The value of the input parameter of ADEPT2-type USERDEFINED and of Java-type
UDTValue
. The UDTValue will be coupled to thisInputDataContainer
, so do not close it; clone it if required longer than thisInputDataContainer
. - Throws:
NoSuchParameterException
- If the input parameter of the designated name does not exist, aNoSuchParameterException
will be thrown.InvalidDataTypeException
- If the designated input parameter is not of type USERDEFINED, anInvalidDataTypeException
will be raised.IllegalStateException
- If the value of the designated input parameter is NULL anIllegalStateException
will be thrown.- See Also:
ProcessConstants.AdeptDataType.USERDEFINED
-
copyMapWrapUdts
static Map<String,Serializable> copyMapWrapUdts(Map<String,Serializable> map)
Creates a copy of the designated map, wraps allUDTValue
to prevent their closing and makes the copy unmodifiable. If the designated map isnull
,null
will be returned.- Parameters:
map
- The map which to copy ornull
.- Returns:
- A copy of the designated map with all
UDTValue
values being wrapped to prevent their closing ornull
.
-
-