Class InstanceServiceParameters
java.lang.Object
com.aquima.interactions.framework.service.instance.InstanceServiceParameters
- Direct Known Subclasses:
InstanceCreateParameters
,InstanceUpdateParameters
Base class for parsing parameters for services which create or update entity instances. It provides logic for parsing
the service parameters from the service context and determining and validating the basic parameters.
- Since:
- 9.6
- Author:
- Radu Batori
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Helper class representing a Map entry of type String. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInstanceServiceParameters
(IServiceContext context) Constructs an instance based on the service context. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
getBoolean
(String parameterName, boolean defaultValue) protected String
getMandatoryParameterValue
(IServiceContext context, String parameterName) Gets a mandatory parameter as an XML attribute of a node.protected List<InstanceServiceParameters.ExpressionEntry>
getOptionalExpressionMapParameter
(IServiceContext context, String parameterName, String keyName, String valueName, boolean checkType) Maps an XML structure of the form:protected String
getOptionalParameterValue
(String parameterName) Gets an optional parameter as an XML attribute of a node.
-
Field Details
-
DATA
- See Also:
-
TAG_NAME
- See Also:
-
TAG_VALUE
- See Also:
-
ENTITY_NAME
- See Also:
-
TAG_ATTRIBUTES
- See Also:
-
TAG_ATTRIBUTE
- See Also:
-
TAG_RELATIONS
- See Also:
-
TAG_RELATION
- See Also:
-
TAG_ATTRIBUTE_RELATIONS
- See Also:
-
-
Constructor Details
-
InstanceServiceParameters
Constructs an instance based on the service context.- Parameters:
context
- The service context. Used to retrieve information about the service call.
-
-
Method Details
-
getEntityName
- Returns:
- The value of the "Entity" parameter.
-
getAttributes
- Returns:
- The attributes sent as parameter in form of a Map. The keys are the attribute names and the values the values of the evaluated expressions.
-
getRelations
- Returns:
- The relations sent as parameter in form of a Map. The keys are the attribute names of the relations and the values the values of the evaluated expressions.
-
getAttributeRelations
- Returns:
- The attributes and relations sent as parameter in form of a Map. The keys are the attribute/relation names, the values the values of the evaluated expressions and an ExpressionEntryType containing the type, if it is and Attribute or Relation.
-
getMandatoryParameterValue
Gets a mandatory parameter as an XML attribute of a node.- Throws:
IllegalArgumentException
- if the attribute is empty/not set.
-
getOptionalParameterValue
Gets an optional parameter as an XML attribute of a node.- Returns:
NULL
if parameter not set.
-
getBoolean
-
getOptionalExpressionMapParameter
protected List<InstanceServiceParameters.ExpressionEntry> getOptionalExpressionMapParameter(IServiceContext context, String parameterName, String keyName, String valueName, boolean checkType) Maps an XML structure of the form:<parameterName> <child keyName="[key]" valueName="[value]"/> ... </parameterName>
List<ExpressionEntry>
of [key] -> IExpression([value])Note that the value may be null if no expression is specified.
-