public class RbdImage
extends java.lang.Object
| Constructor and Description |
|---|
RbdImage(com.sun.jna.Pointer image,
java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getName()
Returns the name of the image
|
com.sun.jna.Pointer |
getPointer()
Return the pointer to the RBD image
This method is used internally and by the RBD class
to close a RBD image
|
boolean |
isOldFormat()
Find out if the format of the RBD image is the old format
or not
|
long |
read(long offset,
byte[] buffer,
long length)
Read from an RBD image
|
void |
snapCreate(java.lang.String snapName)
Create a RBD snapshot
|
boolean |
snapIsProtected(java.lang.String snapName)
Tells if a snapshot is protected or not
|
java.util.List<RbdSnapInfo> |
snapList()
List all snapshots
|
void |
snapProtect(java.lang.String snapName)
Protect a snapshot
|
void |
snapRemove(java.lang.String snapName)
Remove a RBD snapshot
|
void |
snapUnprotect(java.lang.String snapName)
Unprotect a RBD snapshot
|
RbdImageInfo |
stat()
Get information about a RBD image
|
void |
write(byte[] data)
Write data to an RBD image
|
void |
write(byte[] data,
long offset)
Write data to an RBD image
|
void |
write(byte[] data,
long offset,
int length)
Write data to an RBD image
|
public java.lang.String getName()
public com.sun.jna.Pointer getPointer()
public RbdImageInfo stat() throws RbdException
RbdExceptionpublic boolean isOldFormat()
throws RbdException
RbdExceptionpublic void snapCreate(java.lang.String snapName)
throws RbdException
snapName - The name for the snapshotRbdExceptionpublic void snapRemove(java.lang.String snapName)
throws RbdException
snapName - The name of the snapshotRbdExceptionpublic void snapProtect(java.lang.String snapName)
throws RbdException
snapName - The name of the snapshotRbdExceptionpublic void snapUnprotect(java.lang.String snapName)
throws RbdException
snapName - The name of the snapshotRbdExceptionpublic boolean snapIsProtected(java.lang.String snapName)
throws RbdException
snapname - The name of the snapshotRbdExceptionpublic java.util.List<RbdSnapInfo> snapList() throws RbdException
RbdExceptionpublic void write(byte[] data,
long offset,
int length)
throws RbdException
data - The to be written dataoffset - Where to start writinglength - The number of bytes to writeRbdExceptionpublic void write(byte[] data,
long offset)
throws RbdException
data - The to be written dataoffset - Where to start writingRbdExceptionpublic void write(byte[] data)
throws RbdException
data - The to be written dataRbdExceptionpublic long read(long offset,
byte[] buffer,
long length)
offset - Where to start readingbuffer - The buffer to store the resultlength - The amount of bytes to read