Package com.adaptris.hpcc
Class SprayDirectoryToThor
- java.lang.Object
-
- com.adaptris.core.AdaptrisMessageWorkerImp
-
- com.adaptris.core.AdaptrisMessageProducerImp
-
- com.adaptris.hpcc.DfuPlusWrapper
-
- com.adaptris.hpcc.SprayToThorImpl
-
- com.adaptris.hpcc.SprayDirectoryToThor
-
- All Implemented Interfaces:
AdaptrisComponent
,AdaptrisMessageProducer
,AdaptrisMessageSender
,AdaptrisMessageWorker
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
@ComponentProfile(summary="Spray a directory into HPCC via dfuplus", tag="producer,hpcc,dfuplus", recommended=DfuplusConnection.class) public class SprayDirectoryToThor extends SprayToThorImpl
Spray the contents of a directory to Thor.Note that this producer ignores the current message contents and just sprays the contents of the directory specified by
#getSourceDirectoryKey()
using the configured dfuplus command.Effectively, the program executed is going to similar to
dfuplus action=spray srcfile=/path/to/dir/* dstcluster=mythor dstname=~zzlc:json:data overwrite=1 PREFIX=FILENAME,FILESIZE server= nosplit=1 username= password=
The adapter also needs a running
dfuplus action=dafilesrv
instance on the machine where the adapter is hosted. Thor will connect to this instance for file delivery.In the adapter configuration file this class is aliased as spray-directory-to-thor which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Field Summary
-
Fields inherited from class com.adaptris.hpcc.DfuPlusWrapper
executor
-
Fields inherited from class com.adaptris.core.AdaptrisMessageWorkerImp
log
-
-
Constructor Summary
Constructors Constructor Description SprayDirectoryToThor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doProduce(AdaptrisMessage msg, java.lang.String endpoint)
java.lang.Boolean
getDeleteSourceDirectory()
Specify true to delete the source directory after successfully spray into HPCC.java.lang.String
getPrefix()
Optional prefix.java.lang.String
getSourceDirectory()
The source directory to spray into Thor.void
prepare()
void
setDeleteSourceDirectory(java.lang.Boolean deleteSourceDirectory)
Specify true to delete the source directory after successfully spray into HPCC.void
setPrefix(java.lang.String prefix)
Optional prefix.void
setSourceDirectory(java.lang.String sourceDirectory)
The source directory to spray into Thor.-
Methods inherited from class com.adaptris.hpcc.SprayToThorImpl
createSprayCommand, doRequest, endpoint, getCluster, getLogicalFilename, getOverwrite, overwrite, setCluster, setLogicalFilename, setOverwrite
-
Methods inherited from class com.adaptris.hpcc.DfuPlusWrapper
calculateWait, close, execute, executeInternal, generateExceptionMessage, getMaxWait, getMonitorInterval, init, maxWaitMs, monitorIntervalMs, produce, request, request, setMaxWait, setMonitorInterval, start, stop
-
Methods inherited from class com.adaptris.core.AdaptrisMessageProducerImp
createName
-
Methods inherited from class com.adaptris.core.AdaptrisMessageWorkerImp
createQualifier, decode, encode, getEncoder, getIsTrackingEndpoint, getMessageFactory, getUniqueId, handleConnectionException, isTrackingEndpoint, registerConnection, registerEncoderMessageFactory, retrieveConnection, setEncoder, setIsTrackingEndpoint, setMessageFactory, setUniqueId, withMessageFactory, withUniqueID
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.AdaptrisComponent
getUniqueId
-
Methods inherited from interface com.adaptris.core.AdaptrisMessageWorker
decode, encode, getEncoder, getMessageFactory, handleConnectionException, registerConnection, retrieveConnection, setEncoder, setMessageFactory
-
Methods inherited from interface com.adaptris.core.MessageEventGenerator
createQualifier, isTrackingEndpoint
-
-
-
-
Method Detail
-
doProduce
protected void doProduce(AdaptrisMessage msg, java.lang.String endpoint) throws ProduceException
- Specified by:
doProduce
in classDfuPlusWrapper
- Throws:
ProduceException
-
prepare
public void prepare() throws CoreException
- Specified by:
prepare
in interfaceComponentLifecycleExtension
- Overrides:
prepare
in classSprayToThorImpl
- Throws:
CoreException
-
getPrefix
public java.lang.String getPrefix()
Optional prefix.
-
setPrefix
public void setPrefix(java.lang.String prefix)
Optional prefix.
-
getSourceDirectory
public java.lang.String getSourceDirectory()
The source directory to spray into Thor.
-
setSourceDirectory
public void setSourceDirectory(java.lang.String sourceDirectory)
The source directory to spray into Thor.
-
getDeleteSourceDirectory
public java.lang.Boolean getDeleteSourceDirectory()
Specify true to delete the source directory after successfully spray into HPCC.The default is false if not explicitly specified
-
setDeleteSourceDirectory
public void setDeleteSourceDirectory(java.lang.Boolean deleteSourceDirectory)
Specify true to delete the source directory after successfully spray into HPCC.The default is false if not explicitly specified
-
-