Package org.libvirt
Class Secret
- java.lang.Object
-
- org.libvirt.Secret
-
public class Secret extends java.lang.Object
A secret defined by libvirt
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
finalize()
int
free()
Release the secret handle.byte[]
getByteValue()
Fetches the value of the secret as a byte arrayjava.lang.String
getUsageID()
Get the unique identifier of the object with which this secret is to be used.SecretUsageType
getUsageType()
int[]
getUUID()
Get the UUID for this secret.java.lang.String
getUUIDString()
Gets the UUID for this secret as string.java.lang.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 compatibilityjava.lang.String
getXMLDesc()
Fetches an XML document describing attributes of the secret.int
setValue(byte[] value)
Sets the value of the secretint
setValue(java.lang.String value)
Sets the value of the secretint
undefine()
Undefines, but does not free, the Secret.
-
-
-
Method Detail
-
finalize
protected void finalize() throws LibvirtException
- Overrides:
finalize
in classjava.lang.Object
- Throws:
LibvirtException
-
free
public int free() throws LibvirtException
Release the secret handle. The underlying secret continues to exist.- Returns:
- ignore (always 0)
- Throws:
LibvirtException
-
getUsageID
public java.lang.String getUsageID() throws LibvirtException
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
-
getUsageType
public SecretUsageType getUsageType() throws LibvirtException
- Throws:
LibvirtException
-
getUUID
public int[] getUUID() throws LibvirtException
Get the UUID for this secret.- Returns:
- the UUID as an unpacked int array
- Throws:
LibvirtException
- See Also:
- rfc4122
-
getUUIDString
public java.lang.String getUUIDString() throws LibvirtException
Gets the UUID for this secret as string.- Returns:
- the UUID in canonical String format
- Throws:
LibvirtException
- See Also:
- rfc4122
-
getValue
public java.lang.String getValue() throws LibvirtException
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
public byte[] getByteValue() throws LibvirtException
Fetches the value of the secret as a byte array- Returns:
- the value of the secret, or null on failure.
- Throws:
LibvirtException
-
getXMLDesc
public java.lang.String getXMLDesc() throws LibvirtException
Fetches an XML document describing attributes of the secret.- Returns:
- the XML document
- Throws:
LibvirtException
-
setValue
public int setValue(java.lang.String value) throws LibvirtException
Sets the value of the secret- Parameters:
value
-- Returns:
- ignore (always 0)
- Throws:
LibvirtException
-
setValue
public int setValue(byte[] value) throws LibvirtException
Sets the value of the secret- Parameters:
value
-- Returns:
- ignore (always 0)
- Throws:
LibvirtException
-
undefine
public int undefine() throws LibvirtException
Undefines, but does not free, the Secret.- Returns:
- ignore (always 0)
- Throws:
LibvirtException
-
-