Package adams.flow.rest.dex.backend
Class FileBased.DataContainer
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.flow.rest.dex.backend.FileBased.DataContainer
-
- All Implemented Interfaces:
adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.SizeOfHandler
,Serializable
- Enclosing class:
- FileBased
public static class FileBased.DataContainer extends adams.core.logging.CustomLoggingLevelObject
Wraps the actual data item with the expiry timestamp.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DataContainer(byte[] data, File file, Date expiry)
Initializes the container.DataContainer(File file, Date expiry)
Initializes the container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getData()
Loads the data from disk.Date
getExpiry()
Returns the expiry timestamp.File
getFile()
Returns the file with the data.boolean
hasExpired()
Returns whether the data item has expired and need to be removed.-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Method Detail
-
getFile
public File getFile()
Returns the file with the data.- Returns:
- the file
-
getData
public byte[] getData()
Loads the data from disk.- Returns:
- the data, null if failed to load
-
getExpiry
public Date getExpiry()
Returns the expiry timestamp.- Returns:
- the expiry
-
hasExpired
public boolean hasExpired()
Returns whether the data item has expired and need to be removed.- Returns:
- true if expired
-
-