Package org.libvirt
Class Secret
java.lang.Object
org.libvirt.Secret
A secret defined by libvirt
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidfinalize()intfree()Release the secret handle.byte[]Fetches the value of the secret as a byte arrayGet the unique identifier of the object with which this secret is to be used.int[]getUUID()Get the UUID for this secret.Gets the UUID for this secret as string.getValue()Fetches the value of the secret as a string (note that this may not always work and getByteValue() is more reliable) This is just kept for backward compatibilityFetches an XML document describing attributes of the secret.protected voidError handling logic to throw errors.intsetValue(byte[] value) Sets the value of the secretintSets the value of the secretintundefine()Undefines, but does not free, the Secret.
-
Field Details
-
libvirt
The libvirt connection from the hypervisor
-
-
Method Details
-
finalize
- Overrides:
finalizein classObject- Throws:
LibvirtException
-
free
Release the secret handle. The underlying secret continues to exist.- Returns:
- 0 on success, or -1 on error.
- Throws:
LibvirtException
-
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
Get the UUID for this secret.- Returns:
- the UUID as an unpacked int array
- Throws:
LibvirtException- See Also:
-
getUUIDString
Gets the UUID for this secret as string.- Returns:
- the UUID in canonical String format
- Throws:
LibvirtException- See Also:
-
getValue
Fetches the value of the secret as a string (note that this may not always work and getByteValue() is more reliable) This is just kept for backward compatibility- Returns:
- the value of the secret, or null on failure.
- Throws:
LibvirtException
-
getByteValue
Fetches the value of the secret as a byte array- Returns:
- the value of the secret, or null on failure.
- Throws:
LibvirtException
-
getXMLDesc
Fetches an XML document describing attributes of the secret.- Returns:
- the XML document
- Throws:
LibvirtException
-
processError
Error handling logic to throw errors. Must be called after every libvirt call.- Throws:
LibvirtException
-
setValue
Sets the value of the secret- Returns:
- 0 on success, -1 on failure.
- Throws:
LibvirtException
-
setValue
Sets the value of the secret- Returns:
- 0 on success, -1 on failure.
- Throws:
LibvirtException
-
undefine
Undefines, but does not free, the Secret.- Returns:
- 0 on success, -1 on failure.
- Throws:
LibvirtException
-