Class 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 getSourceDirectory() 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=
   
 
Be aware that nosplit=1 is always added, as well as the "/*".

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.

  • Constructor Details

    • SprayDirectoryToThor

      public SprayDirectoryToThor()
  • Method Details

    • doProduce

      protected void doProduce(AdaptrisMessage msg, String endpoint) throws ProduceException
      Specified by:
      doProduce in class DfuPlusWrapper
      Throws:
      ProduceException
    • prepare

      public void prepare() throws CoreException
      Specified by:
      prepare in interface ComponentLifecycleExtension
      Overrides:
      prepare in class SprayToThorImpl
      Throws:
      CoreException
    • getPrefix

      public String getPrefix()
      Optional prefix.
    • setPrefix

      public void setPrefix(String prefix)
      Optional prefix.
    • getSourceDirectory

      public String getSourceDirectory()
      The source directory to spray into Thor.
    • setSourceDirectory

      public void setSourceDirectory(String sourceDirectory)
      The source directory to spray into Thor.
    • getDeleteSourceDirectory

      public 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(Boolean deleteSourceDirectory)
      Specify true to delete the source directory after successfully spray into HPCC.

      The default is false if not explicitly specified