Home > Cloud Cruiser 3 > Batch XML Reference > Universal collectors > JSON > JsonFeedConfig

JsonFeedConfig

Table of contents
No headers

Data feed configuration for the SmartJsonCollector.

Class

<bean class="com.cloudcruiser.batch.collect.JsonFeedConfig">

Properties

<property name="variables">

Sets a list of element to variable mappings. The output variables may then be specified as input for subsequent output mappings. To specify a variable as input, set the input to ' @ ' followed by the variable name. For example, setting an input of @serviceId would populate the output from an output variable named ' serviceId '.

<property name="JasonPathOutputs" />

Sets a list of child node mappings for recursive processing.

<property name="encoding" value=" encodingDefault " />

Defines the default character set for reading input. The default encoding is significant when auto-detection determines multiple possible encoding schemes. Otherwise, the detected encoding will take precedent. The default value is UTF-8 .

For more information, see the Java SE Documentation on encoding.

<property name="lineEnd" value=" lineEndType " />

Defines what the collector considers a line end character. Possible values are ANY , CR , CRLF , DOS , LF , LINUX , LOCAL , MAC , and WINDOWS .

When an explicit line ending is set, any alternate combination of EOL characters encountered will be ignored. The default is ANY .

<property name="inputs">

Sets the list of input fields to collect data from. These are only applicable to mixed mode collection where JSON encoded objects appear in flat file records.

Spring Batch Examples

<bean class="com.cloudcruiser.batch.collect.JsonFeedConfig">
  <property name="outputs">
    <list>
      <bean class="com.cloudcruiser.batch.collect.OutputField">
        <property name="cctype" value="IDENTIFIER" />
        <property name="input" value="customer.name" />
        <property name="label" value="customer" />
      </bean>
      <bean class="com.cloudcruiser.batch.collect.OutputField">
        <property name="cctype" value="IDENTIFIER" />
        <property name="input" value="service.vmName" />
        <property name="label" value="vmName" />
      </bean>
    </list>
  </property>
  <property name="jsonPathOutputs">
    <list>
      <bean class="com.cloudcruiser.batch.collect.JsonPathOutputMapping">
        <property name="jsonPathExpression" value="$.service.compute" />
        <property name="outputs">
          <list>
            <bean class="com.cloudcruiser.batch.collect.OutputField">
              <property name="cctype" value="IDENTIFIER" />
              <property name="input" value="osType" />
            </bean>
            <bean class="com.cloudcruiser.batch.collect.OutputField">
              <property name="cctype" value="RESOURCE" />
              <property name="input" value="ramGB" />
            </bean>
            <bean class="com.cloudcruiser.batch.collect.OutputField">
              <property name="cctype" value="RESOURCE" />
              <property name="input" value="cpuCount" />
            </bean>
          </list>
        </property>
      </bean>
      <bean class="com.cloudcruiser.batch.collect.JsonPathOutputMapping">
        <property name="jsonPathExpression" value="$.service.disks" />
        <property name="outputs">
          <list>
            <bean class="com.cloudcruiser.batch.collect.OutputField">
              <property name="cctype" value="IDENTIFIER" />
              <property name="input" value="name" />
              <property name="label" value="diskName" />
            </bean>
            <bean class="com.cloudcruiser.batch.collect.OutputField">
              <property name="cctype" value="RESOURCE" />
              <property name="input" value="sizeGB" />
              <property name="label" value="diskGB" />
            </bean>
          </list>
        </property>
      </bean>
    </list>
  </property>
</bean>
 
<bean id="feedConfig" class="com.cloudcruiser.batch.collect.JsonFeedConfig">
  <property name="encoding" value="UTF-9"/>
  <property name="lineEnd" value="ANY"/>
  <property name="dateTimePattern" value="yyyy-MM-dd'T'HH:mm:ssZ" />
  <property name="inputs">
    <list>
      <bean class="com.cloudcruiser.batch.collect.InputField">
        <property name="regularExpression" value="^[0-9,-]*T[0-9,:]*[+,-][0-9,:]*" />
        <property name="name" value="logTimestamp" />
      </bean>
    </list>
  </property>
  <property name="outputs">
    <list>
      <bean class="com.cloudcruiser.batch.collect.OutputField">
        <property name="cctype" value="USAGE_END" />
        <property name="input" value="logTimestamp" />
      </bean>
      <bean class="com.cloudcruiser.batch.collect.OutputField">
        <property name="cctype" value="IDENTIFIER" />
        <property name="input" value="usage.account" />
        <property name="label" value="account" />
      </bean>
      <bean class="com.cloudcruiser.batch.collect.OutputField">
        <property name="cctype" value="IDENTIFIER" />
        <property name="input" value="usage.node" />
        <property name="label" value="nodeName" />
      </bean>
      <bean class="com.cloudcruiser.batch.collect.OutputField">
        <property name="cctype" value="RESOURCE" />
        <property name="input" value="usage.cpu_alloc" />
        <property name="label" value="cpuCount" />
      </bean>
      <bean class="com.cloudcruiser.batch.collect.OutputField">
        <property name="cctype" value="RESOURCE" />
        <property name="input" value="usage.ram_alloc" />
        <property name="label" value="memoryMB" />
      </bean>
    </list>
  </property>
</bean>
Last modified

Tags

This page has no custom tags.

Classifications

This page has no classifications.
© Copyright 2018 Hewlett Packard Enterprise Development LP