public class RecoveryInformation
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
PREV_REC_INFO_READ |
static int |
READ_MODE |
static int |
REC_INFO_FAILED |
static int |
REC_INFO_READ |
static int |
WRITE_MODE |
Constructor and Description |
---|
RecoveryInformation(java.io.File recoveryFile1)
Construct a new RecoveryInformation object
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the recovery file
|
void |
deleteFile()
Delete the recovery file
|
void |
desactivate()
Desactivate all readings and writings to/from the recovery file.
|
java.lang.String |
getDirpFileName()
Get the DIRP file name
|
int |
getLastRecordProcessed()
Get the number of the last record processed
|
int |
getMode()
Get the mode used
|
long |
getOffsetStartOfBlock()
Get the offset of the DIRP block being processed
|
int |
getReadStatus()
Get the read status of the last recovery information read
|
void |
readFromFile()
Reads the recovering information from a file
If the method is not able to read the last information (it can happen is the
node has crashed when writting these...), it tries to read the previous one.
|
void |
setMode(int mode1)
Set the recovery file mode : read or write mode.
|
void |
setProcessedFile(java.io.File dirpFileName1)
Set the file name of the AMA DIRP processed file.
|
void |
setRecoveryInformation(long offsetStartOfBlock1,
int lastRecordProcessed1)
set the recovery information
|
java.lang.String |
toString()
Get a String representation of the object
|
void |
writeToFile()
Write the recovering information to a file
|
public static final int READ_MODE
public static final int WRITE_MODE
public static final int REC_INFO_READ
public static final int PREV_REC_INFO_READ
public static final int REC_INFO_FAILED
public RecoveryInformation(java.io.File recoveryFile1)
recoveryFile1
- the file in which the object is gonna be storedpublic void setMode(int mode1) throws java.lang.Exception
mode1
- READ_MODE or WRITE_MODEjava.lang.Exception
- if unable to open the file (read mode) or to create it (write mode)public int getMode()
public int getReadStatus()
public void desactivate()
public void close() throws java.lang.Exception
java.lang.Exception
- unable if unable to close the filepublic void deleteFile() throws java.lang.Exception
java.lang.Exception
- if unable to delete the filepublic void setProcessedFile(java.io.File dirpFileName1) throws java.lang.Exception
dirpFileName1
- AMA DIRP file being processedjava.lang.Exception
- if the filename excess 30 characterspublic void setRecoveryInformation(long offsetStartOfBlock1, int lastRecordProcessed1)
offsetStartOfBlock1
- offset of the DIRP block being processedlastRecordProcessed1
- number of the last record processedpublic java.lang.String getDirpFileName()
public long getOffsetStartOfBlock()
public int getLastRecordProcessed()
public void readFromFile() throws java.lang.Exception
java.lang.Exception
- if unable to read the recovery filepublic void writeToFile() throws java.lang.Exception
java.lang.Exception
- if unable to write the filepublic java.lang.String toString()
toString
in class java.lang.Object