Interface IntegrationItem
-
- All Known Implementing Classes:
DefaultIntegrationItem
public interface IntegrationItemRepresentation of a data item sent into the integration services or sent out of the integration services. Integration item must correspond to one of theIntegrationObjectItemModeldefinitions. IfIntegrationObjectItemModelrepresents a type of the data structures, then theIntegrationItemis a particular instance of that type carrying particular data values.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description java.lang.ObjectgetAttribute(TypeAttributeDescriptor attr)Retrieves value of an attribute.java.lang.ObjectgetAttribute(java.lang.String name)Retrieves value of an attribute.java.util.Collection<TypeAttributeDescriptor>getAttributes()Retrieves attributes present in this integration object.java.util.Optional<IntegrationItem>getContextItem(TypeDescriptor contextItemDescriptor)Retrieves a context item for the given TypeDescriptor if one exists.java.lang.StringgetIntegrationKey()Retrieves integration key value for this item.java.lang.StringgetIntegrationObjectCode()Retrieves code of theIntegrationObjectModelthis item belongs to.TypeDescriptorgetItemType()Retrieves type of this integration item.java.lang.ObjectgetLocalizedAttribute(java.lang.String attribute, java.lang.String lang)Reads value of a localized attribute.java.lang.ObjectgetLocalizedAttribute(java.lang.String attribute, java.util.Locale lang)Reads value of a localized attribute.IntegrationItemgetReferencedItem(TypeAttributeDescriptor attribute)Retrieves an integration item referenced by specified attribute.IntegrationItemgetReferencedItem(java.lang.String attribute)Deprecated, for removal: This API element is subject to removal in a future version.use {@link this.getReferencedItem(TypeAttributeDescriptor)}java.util.Collection<IntegrationItem>getReferencedItems(TypeAttributeDescriptor attribute)Retrieves multiple integration items referenced by specified attribute.java.util.Collection<IntegrationItem>getReferencedItems(java.lang.String attribute)Deprecated, for removal: This API element is subject to removal in a future version.use {@link this.getReferencedItems(TypeAttributeDescriptor)}booleansetAttribute(java.lang.String attribute, java.lang.Object value)Sets value of an attribute in this item.
-
-
-
Method Detail
-
getIntegrationObjectCode
java.lang.String getIntegrationObjectCode()
Retrieves code of theIntegrationObjectModelthis item belongs to.- Returns:
- value of the integration object code
-
getItemType
@Nonnull TypeDescriptor getItemType()
Retrieves type of this integration item.- Returns:
- descriptor of how integration object item is defined for this item.
-
getIntegrationKey
java.lang.String getIntegrationKey()
Retrieves integration key value for this item.- Returns:
- calculated integration key value for the item content.
-
getAttributes
java.util.Collection<TypeAttributeDescriptor> getAttributes()
Retrieves attributes present in this integration object.- Returns:
- a subset of all possible item attributes defined in
getItemType()item type, which were set in this integration item. Even if an attribute was set tonull, e.g.setAttribute("myAttribute", null), a type attribute descriptor will be returned for"myAttribute", if it's an attribute defined for the item type.
-
setAttribute
boolean setAttribute(java.lang.String attribute, java.lang.Object value)Sets value of an attribute in this item.- Parameters:
attribute- name of the attribute whose value needs to be set.value- a value for the attribute. In order to set a value for a localized attribute,LocalizedValueshould be passed as thevalue.- Returns:
true, if the value was successfully set, orfalse, if the specified attribute does not exist for this item.
-
getAttribute
java.lang.Object getAttribute(java.lang.String name)
Retrieves value of an attribute.- Parameters:
name- name of the attribute to read.- Returns:
- value for the specified attribute in this item or
null, if the attribute has not been set yet or does not exist. If attribute is localized, thenLocalizedValueis returned.
-
getAttribute
java.lang.Object getAttribute(TypeAttributeDescriptor attr)
Retrieves value of an attribute.- Parameters:
attr-TypeAttributeDescriptorthat contains the information to get the value- Returns:
- value for the specified attribute in this item or
null, if the attribute has not been set yet or does not exist. If attribute is localized, thenLocalizedValueis returned.
-
getLocalizedAttribute
java.lang.Object getLocalizedAttribute(java.lang.String attribute, java.util.Locale lang)Reads value of a localized attribute. This method should ensure the specified attribute is indeed localized. Otherwise, the implementations should not return a value or indicate the problem by throwing an exception.- Parameters:
attribute- name of the attribute to readlang- language, for which the attribute should be read- Returns:
- value of the specified attribute in the specified language or
null, if either the attribute or the language does not have a value set.
-
getLocalizedAttribute
java.lang.Object getLocalizedAttribute(java.lang.String attribute, java.lang.String lang)Reads value of a localized attribute.- Parameters:
attribute- name of the attribute to readlang- ISO code of the language, e.g. 'en' or 'es_CO', for which the attribute should be read. This is the value that can be read fromLocaleasLocale.toLanguageTag()- Returns:
- value of the specified attribute in the specified language or
null, if either the attribute or the language does not have a value set.
-
getReferencedItem
@Deprecated(since="1905.07-CEP", forRemoval=true) IntegrationItem getReferencedItem(java.lang.String attribute)Deprecated, for removal: This API element is subject to removal in a future version.use {@link this.getReferencedItem(TypeAttributeDescriptor)}Retrieves an integration item referenced by specified attribute. It does the same as calling
getAttribute(String)but there is no need to cast result of that call toIntegrationItem.- Parameters:
attribute- name of the attribute, whose value is a nestedIntegrationItem- Returns:
- the referenced item or
null, if this item does not contain the referenced item for the specified attribute name.
-
getReferencedItem
IntegrationItem getReferencedItem(TypeAttributeDescriptor attribute)
Retrieves an integration item referenced by specified attribute. It does the same as callinggetAttribute(String)but there is no need to cast result of that call toIntegrationItem.- Parameters:
attribute- attribute, whose value is a nestedIntegrationItem- Returns:
- the referenced item or
null, if this item does not contain the referenced item for the specified attribute name.
-
getReferencedItems
@Deprecated(since="1905.07-CEP", forRemoval=true) java.util.Collection<IntegrationItem> getReferencedItems(java.lang.String attribute)Deprecated, for removal: This API element is subject to removal in a future version.use {@link this.getReferencedItems(TypeAttributeDescriptor)}Retrieves multiple integration items referenced by specified attribute. It does the same as calling
getAttribute(String)but there is no need to cast result of that call toCollection<IntegrationItem>.- Parameters:
attribute- name of the attribute, whose value is a collection of nestedIntegrationItems- Returns:
- the referenced items. if this item does not contain referenced items for the specified attribute name, an empty
collection is returned. If the attribute references a single instance of an
IntegrationIteminstead of a collection, then a collection with that single item will be returned.
-
getReferencedItems
java.util.Collection<IntegrationItem> getReferencedItems(TypeAttributeDescriptor attribute)
Retrieves multiple integration items referenced by specified attribute. It does the same as callinggetAttribute(String)but there is no need to cast result of that call toCollection<IntegrationItem>.- Parameters:
attribute- attribute, whose value is a collection of nestedIntegrationItems- Returns:
- the referenced items. if this item does not contain referenced items for the specified attribute name, an empty
collection is returned. If the attribute references a single instance of an
IntegrationIteminstead of a collection, then a collection with that single item will be returned.
-
getContextItem
java.util.Optional<IntegrationItem> getContextItem(TypeDescriptor contextItemDescriptor)
Retrieves a context item for the given TypeDescriptor if one exists. This search is done recursively through the item's containers until a matching context item is found. If no context item exists,Optional.empty()is returned.- Parameters:
contextItemDescriptor- the type of the context item to find- Returns:
- the requested context item if one exists.
-
-