|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.iids.aos.kernel.ac.SegmentInfo
public class SegmentInfo
A SegmentInfo (a) contains the in-memory representation of a TOC entry and (b) mediates access to the entry's segment. The special TOC entries / segments are also represented by a TOCEntry. Most attributes of a TOCEntry are documented in the XDR specification of TOC entries. TOCEntry is thread-unsafe.
| Field Summary | |
|---|---|
java.io.File |
contentFileName
The file that stores this segment's content. |
protected TOCEntry |
entry
The in-memory representation |
| Constructor Summary | |
|---|---|
SegmentInfo(int segmentID,
java.io.File agentContainerDir,
TOCSerialiser tocSerialiser)
Constructs a special TOCEntry. |
|
SegmentInfo(int segmentID,
int segmentType,
byte[] subtype,
byte[] description,
java.io.File agentContainerDir)
Constructs a SegmentInfo with the given fields. |
|
| Method Summary | |
|---|---|
TOC_ENTRY |
createTOC_ENTRY()
Creates a TOC_ENTRY based on this TOCEntry. |
void |
deleteSegment()
Deletes this TOC entry's segment content as part of an API.deleteSegment(). |
void |
deleteSpecialSegment()
Deletes this special TOC entry's segment content. |
void |
finalizeNonSpecial(java.util.zip.ZipOutputStream zip,
TOCSerialiser tocSerialiser)
Performs this TOC entry's part in the finalization of the containing agent container. |
void |
finalizeSpecial(java.util.zip.ZipOutputStream zip,
byte[] content,
int length)
Performs this TOC entry's part in the finalization of the containing agent container. |
byte[] |
getDigest()
Returns a copy of the last computed digest, or null if never computed. |
TOCEntry |
getTOCEntry()
|
boolean |
makePersistent()
Marks the segment of this entry as persistent. |
byte[] |
readSegment(int offset,
int length)
The semantics follow AOSapi.readSegment(). |
int |
writeSegment(int offset,
byte[] buf,
int buflen,
boolean sync)
The semantics follow APIv4.writeSegment(). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected TOCEntry entry
public final java.io.File contentFileName
| Constructor Detail |
|---|
public SegmentInfo(int segmentID,
int segmentType,
byte[] subtype,
byte[] description,
java.io.File agentContainerDir)
agentContainerDir - the directory that stores the agent container's
state.
public SegmentInfo(int segmentID,
java.io.File agentContainerDir,
TOCSerialiser tocSerialiser)
segmentID - one of the special segment IDsagentContainerDir - the directory that stores the agent container's
state.| Method Detail |
|---|
public TOCEntry getTOCEntry()
public void deleteSegment()
throws PersistentSegmentException,
InputOutputException,
AccessDeniedException
PersistentSegmentException
InputOutputException
AccessDeniedException
public void deleteSpecialSegment()
throws InputOutputException
InputOutputException
public byte[] readSegment(int offset,
int length)
throws KernelException
KernelException
public int writeSegment(int offset,
byte[] buf,
int buflen,
boolean sync)
throws KernelException
KernelException
public boolean makePersistent()
throws AccessDeniedException
AccessDeniedException
public void finalizeNonSpecial(java.util.zip.ZipOutputStream zip,
TOCSerialiser tocSerialiser)
throws KernelException
zip - zipfile to write the segment content totocSerialiser - where to serialise this TOC entry to
KernelExceptionAgentContainer.finalizeAgentContainer(boolean, java.security.PrivateKey, byte[])
public void finalizeSpecial(java.util.zip.ZipOutputStream zip,
byte[] content,
int length)
throws KernelException
zip - zipfile to write this entry's segment tocontent - buffer holding the new content of this entry's
segment. The content starts at offset 0.length - the number of bytes of content held by
contentBuffer or -1 for the entire contentBuffer
KernelExceptionAgentContainer.finalizeAgentContainer(boolean, java.security.PrivateKey, byte[])public TOC_ENTRY createTOC_ENTRY()
public byte[] getDigest()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||