org.libvirt

Class Secret

public class Secret extends Object

A secret defined by libvirt
Field Summary
protected Libvirtlibvirt
The libvirt connection from the hypervisor
Method Summary
intfree()
Release the secret handle.
StringgetUsageID()
Get the unique identifier of the object with which this secret is to be used.
int[]getUUID()
Get the UUID for this secret.
StringgetUUIDString()
Gets the UUID for this secret as string.
StringgetValue()
Fetches the value of the secret
StringgetXMLDesc()
Fetches an XML document describing attributes of the secret.
protected voidprocessError()
Error handling logic to throw errors.
intsetValue(String value)
Sets the value of the secret
intundefine()
Undefines, but does not free, the Secret.

Field Detail

libvirt

protected Libvirt libvirt
The libvirt connection from the hypervisor

Method Detail

free

public int free()
Release the secret handle. The underlying secret continues to exist.

Returns: 0 on success, or -1 on error.

Throws: LibvirtException

getUsageID

public String getUsageID()
Get the unique identifier of the object with which this secret is to be used.

Returns: a string identifying the object using the secret, or NULL upon error

Throws: LibvirtException

getUUID

public int[] getUUID()
Get the UUID for this secret.

Returns: the UUID as an unpacked int array

Throws: LibvirtException

See Also: rfc4122

getUUIDString

public String getUUIDString()
Gets the UUID for this secret as string.

Returns: the UUID in canonical String format

Throws: LibvirtException

See Also: rfc4122

getValue

public String getValue()
Fetches the value of the secret

Returns: the value of the secret, or null on failure.

getXMLDesc

public String getXMLDesc()
Fetches an XML document describing attributes of the secret.

Returns: the XML document

processError

protected void processError()
Error handling logic to throw errors. Must be called after every libvirt call.

setValue

public int setValue(String value)
Sets the value of the secret

Returns: 0 on success, -1 on failure.

undefine

public int undefine()
Undefines, but does not free, the Secret.

Returns: 0 on success, -1 on failure.