public final class TransmissionFileSystemOutput extends java.lang.Object implements TransmissionOutput
Transmission that needs
to be saved to the file system.
The class works on a pre-defined folder and should know the size of disk it can use.
With that data it knows how to store incoming Transmissions and store them into files that can be later
be read back into Transmissions.
Created by gupele on 12/18/2014.| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CAPACITY_MEGABYTES |
| Constructor and Description |
|---|
TransmissionFileSystemOutput() |
TransmissionFileSystemOutput(java.lang.String folderPath) |
TransmissionFileSystemOutput(java.lang.String folderPath,
java.lang.String maxTransmissionStorageCapacity) |
| Modifier and Type | Method and Description |
|---|---|
Transmission |
fetchOldestFile() |
boolean |
send(Transmission transmission) |
void |
setCapacity(int suggestedCapacity) |
void |
stop(long timeout,
java.util.concurrent.TimeUnit timeUnit) |
public static final int DEFAULT_CAPACITY_MEGABYTES
public TransmissionFileSystemOutput(java.lang.String folderPath,
java.lang.String maxTransmissionStorageCapacity)
public TransmissionFileSystemOutput()
public TransmissionFileSystemOutput(java.lang.String folderPath)
public boolean send(Transmission transmission)
send in interface TransmissionOutputpublic void stop(long timeout,
java.util.concurrent.TimeUnit timeUnit)
stop in interface TransmissionOutputpublic Transmission fetchOldestFile()
public void setCapacity(int suggestedCapacity)