Class SwiftMxDataFormat
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.dataformat.swift.mx.SwiftMxDataFormat
-
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.DataFormat,org.apache.camel.spi.DataFormatName,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
@Dataformat("swiftMx") @Metadata(firstVersion="3.20.0", title="SWIFT MX") public class SwiftMxDataFormat extends org.apache.camel.support.service.ServiceSupport implements org.apache.camel.spi.DataFormat, org.apache.camel.spi.DataFormatNameSwiftMxDataFormatis a specificDataFormatleveraging Prowide ISO 20022 to encode and decode SWIFT MX messages.
-
-
Constructor Summary
Constructors Constructor Description SwiftMxDataFormat()Constructs aSwiftMxDataFormatwith the default configuration.SwiftMxDataFormat(boolean writeInJson, com.prowidesoftware.swift.model.MxId readMessageId, com.prowidesoftware.swift.model.mx.MxReadConfiguration readConfig)Constructs aSwiftMxDataFormatwith the given parameters.SwiftMxDataFormat(com.prowidesoftware.swift.model.mx.MxWriteConfiguration writeConfig, com.prowidesoftware.swift.model.MxId readMessageId, com.prowidesoftware.swift.model.mx.MxReadConfiguration readConfig)Constructs aSwiftMxDataFormatwith the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDataFormatName()com.prowidesoftware.swift.model.mx.MxReadConfigurationgetReadConfig()com.prowidesoftware.swift.model.MxIdgetReadMessageId()com.prowidesoftware.swift.model.mx.MxWriteConfigurationgetWriteConfig()voidinit()booleanisWriteInJson()voidmarshal(org.apache.camel.Exchange exchange, Object object, OutputStream stream)voidsetReadConfig(Object readConfig)voidsetReadMessageId(com.prowidesoftware.swift.model.MxId readMessageId)voidsetWriteConfig(Object writeConfig)voidsetWriteInJson(boolean writeInJson)Objectunmarshal(org.apache.camel.Exchange exchange, InputStream stream)-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doStart, doStop, doSuspend, fail, getStatus, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
SwiftMxDataFormat
public SwiftMxDataFormat()
Constructs aSwiftMxDataFormatwith the default configuration.
-
SwiftMxDataFormat
public SwiftMxDataFormat(boolean writeInJson, com.prowidesoftware.swift.model.MxId readMessageId, com.prowidesoftware.swift.model.mx.MxReadConfiguration readConfig)Constructs aSwiftMxDataFormatwith the given parameters.- Parameters:
writeInJson- the flag indicating that messages must be marshalled in a JSON format.readMessageId- the type of MX message to produce when unmarshalling an input stream. If not set, it will be automatically detected from the namespace used.readConfig- the specific configuration to use when unmarshalling an input stream.
-
SwiftMxDataFormat
public SwiftMxDataFormat(com.prowidesoftware.swift.model.mx.MxWriteConfiguration writeConfig, com.prowidesoftware.swift.model.MxId readMessageId, com.prowidesoftware.swift.model.mx.MxReadConfiguration readConfig)Constructs aSwiftMxDataFormatwith the given parameters.- Parameters:
writeConfig- the specific configuration to use when marshalling a message.readMessageId- the type of MX message to produce when unmarshalling an input stream. If not set, it will be automatically detected from the namespace used.readConfig- the specific configuration to use when unmarshalling an input stream.
-
-
Method Detail
-
getDataFormatName
public String getDataFormatName()
- Specified by:
getDataFormatNamein interfaceorg.apache.camel.spi.DataFormatName
-
marshal
public void marshal(org.apache.camel.Exchange exchange, Object object, OutputStream stream) throws Exception- Specified by:
marshalin interfaceorg.apache.camel.spi.DataFormat- Throws:
Exception
-
unmarshal
public Object unmarshal(org.apache.camel.Exchange exchange, InputStream stream) throws Exception
- Specified by:
unmarshalin interfaceorg.apache.camel.spi.DataFormat- Throws:
Exception
-
init
public void init()
- Specified by:
initin interfaceorg.apache.camel.Service- Overrides:
initin classorg.apache.camel.support.service.BaseService
-
getWriteConfig
public com.prowidesoftware.swift.model.mx.MxWriteConfiguration getWriteConfig()
- Returns:
- the specific configuration to use when marshalling a message. Ignored if
writeInJsonis set totrue.
-
setWriteConfig
public void setWriteConfig(Object writeConfig)
-
getReadMessageId
public com.prowidesoftware.swift.model.MxId getReadMessageId()
- Returns:
- the type of MX message to produce when unmarshalling an input stream. If not set, it will be automatically detected from the namespace used.
-
setReadMessageId
public void setReadMessageId(com.prowidesoftware.swift.model.MxId readMessageId)
-
getReadConfig
public com.prowidesoftware.swift.model.mx.MxReadConfiguration getReadConfig()
- Returns:
- the specific configuration to use when unmarshalling an input stream.
-
setReadConfig
public void setReadConfig(Object readConfig)
-
isWriteInJson
public boolean isWriteInJson()
- Returns:
trueif messages must be marshalled in a JSON format,falseotherwise.
-
setWriteInJson
public void setWriteInJson(boolean writeInJson)
-
-