Class URLAcquisition
- java.lang.Object
-
- com.scalagent.joram.mom.dest.collector.URLAcquisition
-
- All Implemented Interfaces:
AcquisitionHandler
public class URLAcquisition extends Object implements AcquisitionHandler
-
-
Constructor Summary
Constructors Constructor Description URLAcquisition()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this handler and releases any system resources associated to it.private static byte[]getResource(String spec, Properties prop)get the file.voidretrieve(ReliableTransmitter transmitter)Check the URL resource.voidsetProperties(Properties properties)Configures the handler with the given properties.
-
-
-
Field Detail
-
logger
private static final Logger logger
-
DEBUG
private static final boolean DEBUG
-
FILE
public static final String FILE
- See Also:
- Constant Field Values
-
PATH
public static final String PATH
- See Also:
- Constant Field Values
-
HOST
public static final String HOST
- See Also:
- Constant Field Values
-
URL
public static final String URL
- See Also:
- Constant Field Values
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
urlStr
private String urlStr
-
type
private int type
-
-
Method Detail
-
getResource
private static byte[] getResource(String spec, Properties prop) throws IOException
get the file.- Parameters:
spec- the String to parse as a URL.- Returns:
- the file in byte format.
- Throws:
IOException
-
retrieve
public void retrieve(ReliableTransmitter transmitter) throws Exception
Check the URL resource. Store file in Queue or send to topic (collector destination.- Specified by:
retrievein interfaceAcquisitionHandler- Parameters:
transmitter- a transmitter used to transmit retrieved messages to the MOM reliably.- Throws:
Exception- See Also:
com.scalagent.joram.mom.dest.collector.Collector#check()
-
setProperties
public void setProperties(Properties properties)
Description copied from interface:AcquisitionHandlerConfigures the handler with the given properties. This method is called one time before the first call to retrieve and then when the acquisition destination receives a configuration message.- Specified by:
setPropertiesin interfaceAcquisitionHandler- Parameters:
properties- The new set of properties.
-
close
public void close()
Description copied from interface:AcquisitionHandlerCloses this handler and releases any system resources associated to it. There will be no subsequent call to this handler after it has been closed.- Specified by:
closein interfaceAcquisitionHandler
-
-