|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Objects implementing PearlConnection provide a reasonably low-level interface to the Pearl protocol, with no caching. The next layer up should handle caching, logic, and exception and protocol error handling. Basically, if you treat the Pearl protocol as an RPC mechanism, this is the local proxy interface. Details this interface hides include: - The two steps of the authentication process. - Locking/unlocking
| Method Summary | |
void |
authenticate(java.lang.String password)
Attempts to authenticate using a given password. |
void |
close()
Closes a connection. |
void |
deleteFile(int fid)
Removes a file from the device. |
void |
getAllFileInfo(FileInfoListener target)
Retrieves all file information from the device using a callback mechanism. |
DeviceInfo |
getDeviceInfo()
Returns an object encapsulating basic device information -- number of storage devices, system software name, and firmware version. |
DeviceSettings |
getDeviceSettings()
Retrieves the Pearl device's settings as a DeviceSettings object. |
FileInfo |
getFileInfo(int fid)
Retrieves information on a single file, by FID. |
StorageInfo |
getStorageInfo(int index)
Retrieves information about a storage device in the Pearl device. |
int[] |
getVersion()
Returns the version of the protocol being used as an array of two integers: the major and minor versions, respectively. |
boolean |
isAuthenticated()
Checks to see if the underlying session has been successfully authenticated. |
long |
readFileChunk(int fid,
long offset,
long size,
byte[] buffer)
Retrieves a chunk of a file into a supplied buffer. |
void |
setFileInfo(int fid,
FileInfo newInfo)
Updates information for a file identified by FID. |
void |
writeFileChunk(int fid,
int storageID,
long offset,
long size,
byte[] buffer)
Writes a chunk of a file from a supplied buffer. |
| Method Detail |
public int[] getVersion()
throws PearlException
PearlExceptionpublic boolean isAuthenticated()
public void authenticate(java.lang.String password)
throws PearlException
PearlException
public DeviceInfo getDeviceInfo()
throws PearlException
PearlException
public StorageInfo getStorageInfo(int index)
throws PearlException
PearlException
public DeviceSettings getDeviceSettings()
throws PearlException
PearlException
public void getAllFileInfo(FileInfoListener target)
throws PearlException
PearlException
public FileInfo getFileInfo(int fid)
throws PearlException
PearlException
public void setFileInfo(int fid,
FileInfo newInfo)
throws PearlException
PearlException
public void writeFileChunk(int fid,
int storageID,
long offset,
long size,
byte[] buffer)
throws PearlException
fid - The FID of the file to write.storageID - The index of the storage device to write to.offset - The offset within the file to begin writing.size - The number of bytes to be written.buffer - The buffer from which bytes are sent.
PearlException
public long readFileChunk(int fid,
long offset,
long size,
byte[] buffer)
throws PearlException
fid - The FID of the file to read.offset - The offset within the file to begin reading.size - The number of bytes desired. If the end of the file is
encountered, this will be fewer than were requested.buffer - The buffer into which bytes are copied.
PearlException
public void deleteFile(int fid)
throws PearlException
PearlExceptionpublic void close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||