org.mule.modules

mule-module-security-crc32

config

Namespacehttp://www.mulesoft.org/schema/mule/crc32
Schema Locationhttp://www.mulesoft.org/schema/mule/crc32/current/mule-crc32.xsd  (View Schema)
Schema Version1.0
Minimum Mule Version3.2

Module Overview

A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data. CRCs are specifically designed to protect against common types of errors on communication channels, where they can provide quick and reasonable assurance of the integrity of messages delivered.

Summary

Configuration
<crc32:config>
Configure an instance of this module
Message Processors
<crc32:calculate>
Calculates the CRC32 checksum for the given input and stores that value in the targetExpression defined in this#targetExpression To calculate the checksum on the input, it's going to transform it to a byte array by invoking the toByteArray on the object, if one exists, or by serializing it.
<crc32:filter>
Filters objects with a different checksum than the expected one.

Configuration

To use the this module within a flow the namespace to the module must be included. The resulting flow will look similar to the following:

<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:crc32="http://www.mulesoft.org/schema/mule/crc32"
      xsi:schemaLocation="
               http://www.mulesoft.org/schema/mule/core
               http://www.mulesoft.org/schema/mule/core/current/mule.xsd
               http://www.mulesoft.org/schema/mule/crc32
               http://www.mulesoft.org/schema/mule/crc32/current/mule-crc32.xsd">

      <!-- here goes your flows and configuration elements -->

</mule>

This module is configured using the config element. This element must be placed outside of your flows and at the root of your Mule application. You can create as many configurations as you deem necessary as long as each carries its own name.

Each message processor, message source or transformer carries a config-ref attribute that allows the invoker to specify which configuration to use.

Attributes
TypeNameDefault ValueDescriptionJava TypeMIME TypeEncoding
xs:string name Optional. Give a name to this configuration so it can be later referenced.
xs:string targetExpression #[variable:crc32] Optional. The expression where to store the result of the calculated CRC32 produced by this#calculate(Object, MuleEvent)

Example

INCLUDE_ERROR

Example

INCLUDE_ERROR

Message Processors

<crc32:calculate>

Calculates the CRC32 checksum for the given input and stores that value in the targetExpression defined in this#targetExpression To calculate the checksum on the input, it's going to transform it to a byte array by invoking the toByteArray on the object, if one exists, or by serializing it.

XML Sample
INCLUDE_ERROR
XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
input #[payload] Optional. The object on which to calculate the checksum Object */*
muleEvent The muleEvent to process MuleEvent */*
Exception Payloads
Payload ClassDescription
IOException if an error occurs while calculating the checksum

<crc32:filter>

Filters objects with a different checksum than the expected one. To calculate the checksum on the input, it's going to transform it to a byte array by invoking the toByteArray on the object, if one exists, or by serializing it.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
expectedChecksum The expected checksum value for the given input long */*
input #[payload] Optional. Input to be validated Object */*
afterChain MP chain SourceCallback */*
Returns
Return Type Description
Object returns null if the validation fails
Exception Payloads
Payload ClassDescription
Exception in case of error calculating the input checksum

Message Sources

Transformers