Interface Retrievable

All Superinterfaces:
Proxy
All Known Implementing Classes:
Item, Retrievable.Retrievable$Impl

@Generated("org.javagi.JavaGI") public interface Retrievable extends Proxy

A read-only view of a secret item in the Secret Service.

SecretRetrievable provides a read-only view of a secret item stored in the Secret Service.

Each item has a value, represented by a Value, which can be retrieved by retrieveSecret(Cancellable, AsyncReadyCallback) and retrieveSecretFinish(AsyncResult).

Since:
0.19.0
  • Method Details

    • getType

      static @Nullable Type getType()
      Get the GType of the Retrievable class.
      Returns:
      the GType
    • getAttributes

      default HashTable<String,String> getAttributes()

      Get the attributes of this object.

      The attributes are a mapping of string keys to string values. Attributes are used to search for items. Attributes are not stored or transferred securely by the secret service.

      Do not modify the attribute returned by this method.

      Returns:
      a new reference to the attributes, which should not be modified, and released with HashTable#unref
      Since:
      0.19.0
    • getCreated

      default long getCreated()

      Get the created date and time of the object.

      The return value is the number of seconds since the unix epoch, January 1st 1970.

      Returns:
      the created date and time
      Since:
      0.19.0
    • getLabel

      default String getLabel()
      Get the label of this item.
      Returns:
      the label, which should be freed with GLib#free
      Since:
      0.19.0
    • getModified

      default long getModified()

      Get the modified date and time of the object.

      The return value is the number of seconds since the unix epoch, January 1st 1970.

      Returns:
      the modified date and time
      Since:
      0.19.0
    • retrieveSecret

      default void retrieveSecret(@Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback)

      Retrieve the secret value of this object.

      Each retrievable object has a single secret which might be a password or some other secret binary value.

      This function returns immediately and completes asynchronously.

      Parameters:
      cancellable - optional cancellation object
      callback - called when the operation completes
      Since:
      0.19.0
    • retrieveSecretFinish

      default @Nullable Value retrieveSecretFinish(AsyncResult result) throws GErrorException
      Complete asynchronous operation to retrieve the secret value of this object.
      Parameters:
      result - asynchronous result passed to callback
      Returns:
      the secret value which should be released with Value.unref(), or null
      Throws:
      GErrorException - see GError
      Since:
      0.19.0
    • retrieveSecretSync

      default @Nullable Value retrieveSecretSync(@Nullable Cancellable cancellable) throws GErrorException

      Retrieve the secret value of this object synchronously.

      Each retrievable object has a single secret which might be a password or some other secret binary value.

      This method may block indefinitely and should not be used in user interface threads.

      Parameters:
      cancellable - optional cancellation object
      Returns:
      the secret value which should be released with Value.unref(), or null
      Throws:
      GErrorException - see GError
      Since:
      0.19.0