xmlBlaster 2.2.0 API

org.xmlBlaster.client.filepoller
Class Publisher

java.lang.Object
  extended by org.xmlBlaster.client.filepoller.Publisher
All Implemented Interfaces:
I_Timeout

public class Publisher
extends java.lang.Object
implements I_Timeout

Publisher

Author:
Michele Laghi

Field Summary
private  I_XmlBlasterAccess access
           
private  ConnectQos connectQos
           
private  boolean copyOnMove
           
private  long delaySinceLastFileChange
           
private  DirectoryManager directoryManager
           
private  java.lang.String directoryName
           
private  java.lang.String discarded
           
private  java.lang.String fileFilter
           
private  java.lang.String filterType
           
private  boolean forceShutdown
          used to break the loop in doPublish when shutting down
private  Global global
           
private  boolean isActive
           
private  boolean isShutdown
          used to identify if it has shut down (to get a new global)
private  java.lang.String lockExtention
           
private static java.util.logging.Logger log
           
private  long maximumFileSize
           
private  java.lang.String ME
           
private  java.lang.String name
          only used as a default login name and logging
private  long pollInterval
           
private  java.lang.String publishKey
           
private  java.lang.String publishQos
           
private  java.lang.String sent
           
private static Timeout timeout
           
private  Timestamp timeoutHandle
           
static java.lang.String USE_REGEX
           
 
Constructor Summary
Publisher(Global globOrig, java.lang.String name, I_PluginConfig pluginConfig)
           
 
Method Summary
 void activate()
           
private  void createDirectoryManager()
          Create the file checker instance with the current configuration.
 void deActivate()
           
private  FileInfo[] doPublish()
          Publish file to xmlBlaster.
 long getDelaySinceLastFileChange()
           
 java.lang.String getDirectoryName()
           
 java.lang.String getDiscarded()
           
 java.lang.String getFileFilter()
           
 java.lang.String getFilterType()
           
 java.lang.String getLockExtention()
           
 long getMaximumFileSize()
           
 long getPollInterval()
           
 java.lang.String getSent()
           
 void init()
          Connects to the xmlBlaster.
 boolean isActive()
           
 boolean isCopyOnMove()
           
 void publish()
          Fail-safe sending files.
private  void reCreateDirectoryManager()
          Useful for JMX invocations
 void setCopyOnMove(boolean copyOnMove)
           
 void setDelaySinceLastFileChange(long delaySinceLastFileChange)
           
 void setDirectoryName(java.lang.String directoryName)
           
 void setDiscarded(java.lang.String discarded)
           
 void setFileFilter(java.lang.String fileFilter)
           
 void setFilterType(java.lang.String filterType)
           
 void setLockExtention(java.lang.String lockExtention)
           
 void setMaximumFileSize(long maximumFileSize)
           
 void setPollInterval(long pollInterval)
           
 void setSent(java.lang.String sent)
           
 void shutdown()
          If an exception occurs it means it could not publish the entry
 void timeout(java.lang.Object userData)
          You will be notified about the timeout through this method.
 java.lang.String toString()
           
 java.lang.String toString(FileInfo[] infos, int max)
          Create a comma separated list of file names.
 java.lang.String triggerScan()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ME

private java.lang.String ME

global

private Global global

log

private static java.util.logging.Logger log

directoryManager

private DirectoryManager directoryManager

access

private I_XmlBlasterAccess access

publishKey

private java.lang.String publishKey

publishQos

private java.lang.String publishQos

connectQos

private ConnectQos connectQos

pollInterval

private long pollInterval

maximumFileSize

private long maximumFileSize

fileFilter

private java.lang.String fileFilter

filterType

private java.lang.String filterType

directoryName

private java.lang.String directoryName

copyOnMove

private boolean copyOnMove

sent

private java.lang.String sent

discarded

private java.lang.String discarded

lockExtention

private java.lang.String lockExtention

delaySinceLastFileChange

private long delaySinceLastFileChange

USE_REGEX

public static final java.lang.String USE_REGEX
See Also:
Constant Field Values

timeoutHandle

private Timestamp timeoutHandle

timeout

private static Timeout timeout

isShutdown

private boolean isShutdown
used to identify if it has shut down (to get a new global)


forceShutdown

private boolean forceShutdown
used to break the loop in doPublish when shutting down


name

private java.lang.String name
only used as a default login name and logging


isActive

private boolean isActive
Constructor Detail

Publisher

public Publisher(Global globOrig,
                 java.lang.String name,
                 I_PluginConfig pluginConfig)
          throws XmlBlasterException
Throws:
XmlBlasterException
Method Detail

createDirectoryManager

private void createDirectoryManager()
                             throws XmlBlasterException
Create the file checker instance with the current configuration.

Throws:
XmlBlasterException

reCreateDirectoryManager

private void reCreateDirectoryManager()
Useful for JMX invocations


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

init

public void init()
          throws XmlBlasterException
Connects to the xmlBlaster.

Throws:
XmlBlasterException

shutdown

public void shutdown()
              throws XmlBlasterException
If an exception occurs it means it could not publish the entry

Throws:
XmlBlasterException

publish

public void publish()
Fail-safe sending files.


toString

public java.lang.String toString(FileInfo[] infos,
                                 int max)
Create a comma separated list of file names.

Parameters:
infos -
max - Max file names to collect
Returns:

doPublish

private FileInfo[] doPublish()
                      throws XmlBlasterException
Publish file to xmlBlaster.

Returns:
An empty string if nothing was sent, is never null
Throws:
XmlBlasterException

timeout

public void timeout(java.lang.Object userData)
Description copied from interface: I_Timeout
You will be notified about the timeout through this method.

Specified by:
timeout in interface I_Timeout
Parameters:
userData - You get bounced back your userData which you passed with Timeout.addTimeoutListener()
See Also:
I_Timeout.timeout(java.lang.Object)

activate

public void activate()
              throws java.lang.Exception
Throws:
java.lang.Exception

deActivate

public void deActivate()

isActive

public boolean isActive()

triggerScan

public java.lang.String triggerScan()

getDirectoryName

public java.lang.String getDirectoryName()
Returns:
Returns the directoryName.

setDirectoryName

public void setDirectoryName(java.lang.String directoryName)
Parameters:
directoryName - The directoryName to set.

getFileFilter

public java.lang.String getFileFilter()
Returns:
Returns the fileFilter.

setFileFilter

public void setFileFilter(java.lang.String fileFilter)
Parameters:
fileFilter - The fileFilter to set.

getFilterType

public java.lang.String getFilterType()
Returns:
Returns the filterType.

setFilterType

public void setFilterType(java.lang.String filterType)
Parameters:
filterType - The filterType to set.

getMaximumFileSize

public long getMaximumFileSize()
Returns:
Returns the maximumFileSize.

setMaximumFileSize

public void setMaximumFileSize(long maximumFileSize)
Parameters:
maximumFileSize - The maximumFileSize to set.

getPollInterval

public long getPollInterval()
Returns:
Returns the pollInterval.

setPollInterval

public void setPollInterval(long pollInterval)
Parameters:
pollInterval - The pollInterval to set.

isCopyOnMove

public boolean isCopyOnMove()
Returns:
Returns the copyOnMove.

setCopyOnMove

public void setCopyOnMove(boolean copyOnMove)
Parameters:
copyOnMove - The copyOnMove to set.

getDelaySinceLastFileChange

public long getDelaySinceLastFileChange()
Returns:
Returns the delaySinceLastFileChange.

setDelaySinceLastFileChange

public void setDelaySinceLastFileChange(long delaySinceLastFileChange)
Parameters:
delaySinceLastFileChange - The delaySinceLastFileChange to set.

getDiscarded

public java.lang.String getDiscarded()
Returns:
Returns the discarded.

setDiscarded

public void setDiscarded(java.lang.String discarded)
Parameters:
discarded - The discarded to set.

getLockExtention

public java.lang.String getLockExtention()
Returns:
Returns the lockExtention.

setLockExtention

public void setLockExtention(java.lang.String lockExtention)
Parameters:
lockExtention - The lockExtention to set.

getSent

public java.lang.String getSent()
Returns:
Returns the sent.

setSent

public void setSent(java.lang.String sent)
Parameters:
sent - The sent to set.

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.