@Suspendable(invoked=INTERACTIVE) public class ClamScan extends AbstractCurationTask
| Modifier and Type | Field and Description |
|---|---|
protected BitstreamService |
bitstreamService |
protected String |
CLEAN_MESSAGE |
protected String |
CONNECT_FAIL_MESSAGE |
protected DataOutputStream |
dataOutputStream |
protected int |
DEFAULT_CHUNK_SIZE |
protected byte[] |
END |
protected boolean |
failfast |
protected String |
host |
protected byte[] |
IDSESSION |
protected String |
INFECTED_MESSAGE |
protected byte[] |
INSTREAM |
protected String |
NEW_ITEM_HANDLE |
protected byte[] |
PING |
protected String |
PLUGIN_PREFIX |
protected int |
port |
protected List<String> |
results |
protected String |
SCAN_FAIL_MESSAGE |
protected Socket |
socket |
protected byte[] |
STATS |
protected int |
status |
protected int |
timeout |
communityService, configurationService, curator, handleService, itemService, taskId| Constructor and Description |
|---|
ClamScan() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeSession()
closeSession
Close the IDSESSION in CLAMD
|
protected void |
formatResults(Item item) |
protected String |
getItemHandle(Item item) |
void |
init(Curator curator,
String taskId)
Initialize task - parameters inform the task of it's invoking curator.
|
protected void |
logDebugMessage(String message) |
protected void |
openSession()
openSession
This method opens a session.
|
int |
perform(DSpaceObject dso)
Perform the curation task upon passed DSO
|
protected int |
scan(Bitstream bitstream,
InputStream inputstream,
String itemHandle)
Issue the INSTREAM command and return the response to
and from the clamav daemon.
|
dereference, distribute, perform, performItem, performObject, report, setResult, taskArrayProperty, taskBooleanProperty, taskIntProperty, taskLongProperty, taskPropertyprotected final int DEFAULT_CHUNK_SIZE
protected final byte[] INSTREAM
protected final byte[] PING
protected final byte[] STATS
protected final byte[] IDSESSION
protected final byte[] END
protected final String PLUGIN_PREFIX
protected final String INFECTED_MESSAGE
protected final String CLEAN_MESSAGE
protected final String CONNECT_FAIL_MESSAGE
protected final String SCAN_FAIL_MESSAGE
protected final String NEW_ITEM_HANDLE
protected String host
protected int port
protected int timeout
protected boolean failfast
protected int status
protected Socket socket
protected DataOutputStream dataOutputStream
protected BitstreamService bitstreamService
public void init(Curator curator, String taskId) throws IOException
CurationTaskinit in interface CurationTaskinit in class AbstractCurationTaskcurator - the Curator controlling this tasktaskId - identifier task should use in invoking servicesIOException - if errorpublic int perform(DSpaceObject dso) throws IOException
CurationTaskperform in interface CurationTaskperform in class AbstractCurationTaskdso - the DSpace objectIOException - if errorprotected void openSession()
throws IOException
IOExceptionprotected void closeSession()
protected int scan(Bitstream bitstream, InputStream inputstream, String itemHandle)
bitstream - the bitstream for reporting resultsinputstream - the InputStream to readitemHandle - the item handle for reporting resultsprotected void formatResults(Item item) throws IOException
IOExceptionprotected void logDebugMessage(String message)
Copyright © 2017 DuraSpace. All rights reserved.