Class Collection
- All Implemented Interfaces:
AsyncInitable,DBusInterface,Initable,Proxy
SecretCollection represents a collection of secret items stored in the
Secret Service.
A collection can be in a locked or unlocked state. Use
SecretService#lock or SecretService#unlock to lock or
unlock the collection.
Use the SecretCollection:items property or
SecretCollection#getItems to lookup the items in the collection.
There may not be any items exposed when the collection is locked.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCollection.Builder<B extends Collection.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classThe class forSecretCollection.Nested classes/interfaces inherited from class org.gnome.gio.DBusProxy
DBusProxy.DBusProxyClass, DBusProxy.GPropertiesChangedCallback, DBusProxy.GSignalCallbackNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface org.gnome.gio.AsyncInitable
AsyncInitable.AsyncInitable$Impl, AsyncInitable.AsyncInitableIfaceNested classes/interfaces inherited from interface org.gnome.gio.DBusInterface
DBusInterface.DBusInterface$Impl, DBusInterface.DBusInterfaceIfaceNested classes/interfaces inherited from interface org.gnome.gio.Initable
Initable.Initable$Impl, Initable.InitableIface -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new Collection.Collection(MemorySegment address) Create a Collection proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected CollectionasParent()Returns this instance as if it were its parent type.static Collection.Builder<? extends Collection.Builder> builder()ACollection.Builderobject constructs aCollectionwith the specified properties.static voidcreate(@Nullable Service service, String label, @Nullable String alias, Set<CollectionCreateFlags> flags, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Create a new collection in the secret service.static voidcreate(@Nullable Service service, String label, @Nullable String alias, CollectionCreateFlags flags, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Create a new collection in the secret service.static CollectioncreateFinish(AsyncResult result) Finish operation to create a new collection in the secret service.static CollectioncreateSync(@Nullable Service service, String label, @Nullable String alias, Set<CollectionCreateFlags> flags, @Nullable Cancellable cancellable) Create a new collection in the secret service.static CollectioncreateSync(@Nullable Service service, String label, @Nullable String alias, CollectionCreateFlags flags, @Nullable Cancellable cancellable) Create a new collection in the secret service.voiddelete(@Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Delete this collection.booleandeleteFinish(AsyncResult result) Complete operation to delete this collection.booleandeleteSync(@Nullable Cancellable cancellable) Delete this collection.static voidforAlias(@Nullable Service service, String alias, Set<CollectionFlags> flags, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Lookup which collection is assigned to this alias.static voidforAlias(@Nullable Service service, String alias, CollectionFlags flags, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Lookup which collection is assigned to this alias.static @Nullable CollectionforAliasFinish(AsyncResult result) Finish an asynchronous operation to lookup which collection is assigned to an alias.static @Nullable CollectionforAliasSync(@Nullable Service service, String alias, Set<CollectionFlags> flags, @Nullable Cancellable cancellable) Lookup which collection is assigned to this alias.static @Nullable CollectionforAliasSync(@Nullable Service service, String alias, CollectionFlags flags, @Nullable Cancellable cancellable) Lookup which collection is assigned to this alias.static CollectionforDbusPathFinish(AsyncResult result) Finish asynchronous operation to get a new collection proxy for a collection in the secret service.static CollectionforDbusPathSync(@Nullable Service service, String collectionPath, Set<CollectionFlags> flags, @Nullable Cancellable cancellable) Get a new collection proxy for a collection in the secret service.static CollectionforDbusPathSync(@Nullable Service service, String collectionPath, CollectionFlags flags, @Nullable Cancellable cancellable) Get a new collection proxy for a collection in the secret service.Get the flags representing what features of theSecretCollectionproxy have been initialized.longGet the created date and time of the collection.getItems()Get the list of items in this collection.getLabel()Get the label of this collection.booleanGet whether the collection is locked or not.static MemoryLayoutThe memory layout of the native struct.longGet the modified date and time of the collection.Get the Secret Service object that this collection was created with.static @Nullable TypegetType()Get the GType of the Collection classvoidloadItems(@Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Ensure that theSecretCollectionproxy has loaded all the items present in the Secret Service.booleanloadItemsFinish(AsyncResult result) Complete an asynchronous operation to ensure that theSecretCollectionproxy has loaded all the items present in the Secret Service.booleanloadItemsSync(@Nullable Cancellable cancellable) Ensure that theSecretCollectionproxy has loaded all the items present in the Secret Service.static voidnewForDbusPath(@Nullable Service service, String collectionPath, Set<CollectionFlags> flags, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Get a new collection proxy for a collection in the secret service.static voidnewForDbusPath(@Nullable Service service, String collectionPath, CollectionFlags flags, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Get a new collection proxy for a collection in the secret service.voidrefresh()Refresh the properties on this collection.voidsearch(@Nullable Schema schema, HashTable<String, String> attributes, Set<SearchFlags> flags, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Search for items matching theattributesin thecollection.Theattributesshould be a table of string keys and string values.voidsearch(@Nullable Schema schema, HashTable<String, String> attributes, SearchFlags flags, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Search for items matching theattributesin thecollection.Theattributesshould be a table of string keys and string values.searchFinish(AsyncResult result) Complete asynchronous operation to search for items in a collection.voidsearchForDbusPaths(@Nullable Schema schema, HashTable<String, String> attributes, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Search for items in this Collection matching theattributes,and return their DBus object paths.String[]searchForDbusPathsFinish(AsyncResult result) Complete asynchronous operation to search for items in a collection.String[]searchForDbusPathsSync(@Nullable Schema schema, HashTable<String, String> attributes, @Nullable Cancellable cancellable) Search for items matching theattributesincollection,and return their DBus object paths.searchSync(@Nullable Schema schema, HashTable<String, String> attributes, Set<SearchFlags> flags, @Nullable Cancellable cancellable) Search for items matching theattributesin thecollection.Theattributesshould be a table of string keys and string values.searchSync(@Nullable Schema schema, HashTable<String, String> attributes, SearchFlags flags, @Nullable Cancellable cancellable) Search for items matching theattributesin thecollection.Theattributesshould be a table of string keys and string values.voidsetLabel(String label, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Set the label of this collection.booleansetLabelFinish(AsyncResult result) Complete asynchronous operation to set the label of this collection.booleansetLabelSync(String label, @Nullable Cancellable cancellable) Set the label of this collection.Methods inherited from class org.gnome.gio.DBusProxy
call, call, callFinish, callSync, callSync, callWithUnixFdList, callWithUnixFdList, callWithUnixFdListFinish, callWithUnixFdListSync, callWithUnixFdListSync, emitGPropertiesChanged, emitGSignal, finish, forBusFinish, forBusSync, forBusSync, getCachedProperty, getCachedPropertyNames, getConnection, getDefaultTimeout, getFlags, getInterfaceInfo, getInterfaceName, getName, getNameOwner, getObjectPath, gPropertiesChanged, gSignal, new_, new_, newForBus, newForBus, onGPropertiesChanged, onGSignal, setCachedProperty, setDefaultTimeout, setInterfaceInfo, sync, syncMethods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gnome.gio.AsyncInitable
initAsync, initFinishMethods inherited from interface org.gnome.gio.DBusInterface
getInfo, getObject, setObject
-
Constructor Details
-
Collection
Create a Collection proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
Collection
public Collection()Creates a new Collection.
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuperkeyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName(). This will call the native function pointer of this virtual method in the typeclass of the parent type. -
forDbusPathFinish
Finish asynchronous operation to get a new collection proxy for a collection in the secret service.- Parameters:
result- the asynchronous result passed to the callback- Returns:
- the new collection, which should be unreferenced
with
GObject.unref() - Throws:
GErrorException- seeGError
-
forDbusPathSync
public static Collection forDbusPathSync(@Nullable Service service, String collectionPath, Set<CollectionFlags> flags, @Nullable Cancellable cancellable) throws GErrorException Get a new collection proxy for a collection in the secret service.If
serviceisnull, thenService.getSync(java.util.Set<org.gnome.secret.ServiceFlags>, org.gnome.gio.Cancellable)will be called to get the defaultServiceproxy.This method may block indefinitely and should not be used in user interface threads.
- Parameters:
service- a secret service objectcollectionPath- the D-Bus path of the collectionflags- options for the collection initializationcancellable- optional cancellation object- Returns:
- the new collection, which should be unreferenced
with
GObject.unref() - Throws:
GErrorException- seeGError
-
forDbusPathSync
public static Collection forDbusPathSync(@Nullable Service service, String collectionPath, CollectionFlags flags, @Nullable Cancellable cancellable) throws GErrorException Get a new collection proxy for a collection in the secret service.If
serviceisnull, thenService.getSync(java.util.Set<org.gnome.secret.ServiceFlags>, org.gnome.gio.Cancellable)will be called to get the defaultServiceproxy.This method may block indefinitely and should not be used in user interface threads.
- Parameters:
service- a secret service objectcollectionPath- the D-Bus path of the collectionflags- options for the collection initializationcancellable- optional cancellation object- Returns:
- the new collection, which should be unreferenced
with
GObject.unref() - Throws:
GErrorException- seeGError
-
create
public static void create(@Nullable Service service, String label, @Nullable String alias, Set<CollectionCreateFlags> flags, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Create a new collection in the secret service.This method returns immediately and completes asynchronously. The secret service may prompt the user.
Service.prompt(org.gnome.secret.Prompt, org.gnome.glib.VariantType, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)will be used to handle any prompts that are required.An
aliasis a well-known tag for a collection, such as 'default' (ie: the default collection to store items in). This allows other applications to easily identify and share a collection. If you specify analias,and a collection with that alias already exists, then a new collection will not be created. The previous one will be returned instead.If
serviceisnull, thenService.get(java.util.Set<org.gnome.secret.ServiceFlags>, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)will be called to get the defaultServiceproxy.- Parameters:
service- a secret service objectlabel- label for the new collectionalias- alias to assign to the collectionflags- currently unusedcancellable- optional cancellation objectcallback- called when the operation completes
-
create
public static void create(@Nullable Service service, String label, @Nullable String alias, CollectionCreateFlags flags, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Create a new collection in the secret service.This method returns immediately and completes asynchronously. The secret service may prompt the user.
Service.prompt(org.gnome.secret.Prompt, org.gnome.glib.VariantType, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)will be used to handle any prompts that are required.An
aliasis a well-known tag for a collection, such as 'default' (ie: the default collection to store items in). This allows other applications to easily identify and share a collection. If you specify analias,and a collection with that alias already exists, then a new collection will not be created. The previous one will be returned instead.If
serviceisnull, thenService.get(java.util.Set<org.gnome.secret.ServiceFlags>, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)will be called to get the defaultServiceproxy.- Parameters:
service- a secret service objectlabel- label for the new collectionalias- alias to assign to the collectionflags- currently unusedcancellable- optional cancellation objectcallback- called when the operation completes
-
createFinish
Finish operation to create a new collection in the secret service.- Parameters:
result- the asynchronous result passed to the callback- Returns:
- the new collection, which should be unreferenced
with
GObject.unref() - Throws:
GErrorException- seeGError
-
createSync
public static Collection createSync(@Nullable Service service, String label, @Nullable String alias, Set<CollectionCreateFlags> flags, @Nullable Cancellable cancellable) throws GErrorException Create a new collection in the secret service.This method may block indefinitely and should not be used in user interface threads. The secret service may prompt the user.
Service.prompt(org.gnome.secret.Prompt, org.gnome.glib.VariantType, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)will be used to handle any prompts that are required.An
aliasis a well-known tag for a collection, such asdefault(ie: the default collection to store items in). This allows other applications to easily identify and share a collection. If you specify analias,and a collection with that alias already exists, then a new collection will not be created. The previous one will be returned instead.If
serviceisnull, thenService.getSync(java.util.Set<org.gnome.secret.ServiceFlags>, org.gnome.gio.Cancellable)will be called to get the defaultServiceproxy.- Parameters:
service- a secret service objectlabel- label for the new collectionalias- alias to assign to the collectionflags- currently unusedcancellable- optional cancellation object- Returns:
- the new collection, which should be unreferenced
with
GObject.unref() - Throws:
GErrorException- seeGError
-
createSync
public static Collection createSync(@Nullable Service service, String label, @Nullable String alias, CollectionCreateFlags flags, @Nullable Cancellable cancellable) throws GErrorException Create a new collection in the secret service.This method may block indefinitely and should not be used in user interface threads. The secret service may prompt the user.
Service.prompt(org.gnome.secret.Prompt, org.gnome.glib.VariantType, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)will be used to handle any prompts that are required.An
aliasis a well-known tag for a collection, such asdefault(ie: the default collection to store items in). This allows other applications to easily identify and share a collection. If you specify analias,and a collection with that alias already exists, then a new collection will not be created. The previous one will be returned instead.If
serviceisnull, thenService.getSync(java.util.Set<org.gnome.secret.ServiceFlags>, org.gnome.gio.Cancellable)will be called to get the defaultServiceproxy.- Parameters:
service- a secret service objectlabel- label for the new collectionalias- alias to assign to the collectionflags- currently unusedcancellable- optional cancellation object- Returns:
- the new collection, which should be unreferenced
with
GObject.unref() - Throws:
GErrorException- seeGError
-
forAlias
public static void forAlias(@Nullable Service service, String alias, Set<CollectionFlags> flags, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Lookup which collection is assigned to this alias. Aliases help determine well known collections, such as 'default'.If
serviceisnull, thenService.get(java.util.Set<org.gnome.secret.ServiceFlags>, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)will be called to get the defaultServiceproxy.This method will return immediately and complete asynchronously.
- Parameters:
service- a secret service objectalias- the alias to lookupflags- options for the collection initializationcancellable- optional cancellation objectcallback- called when the operation completes
-
forAlias
public static void forAlias(@Nullable Service service, String alias, CollectionFlags flags, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Lookup which collection is assigned to this alias. Aliases help determine well known collections, such as 'default'.If
serviceisnull, thenService.get(java.util.Set<org.gnome.secret.ServiceFlags>, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)will be called to get the defaultServiceproxy.This method will return immediately and complete asynchronously.
- Parameters:
service- a secret service objectalias- the alias to lookupflags- options for the collection initializationcancellable- optional cancellation objectcallback- called when the operation completes
-
forAliasFinish
Finish an asynchronous operation to lookup which collection is assigned to an alias.- Parameters:
result- asynchronous result passed to callback- Returns:
- the collection, or
nullif none assigned to the alias - Throws:
GErrorException- seeGError
-
forAliasSync
public static @Nullable Collection forAliasSync(@Nullable Service service, String alias, Set<CollectionFlags> flags, @Nullable Cancellable cancellable) throws GErrorException Lookup which collection is assigned to this alias. Aliases help determine well known collections, such asdefault.If
serviceisnull, thenService.getSync(java.util.Set<org.gnome.secret.ServiceFlags>, org.gnome.gio.Cancellable)will be called to get the defaultServiceproxy.This method may block and should not be used in user interface threads.
- Parameters:
service- a secret service objectalias- the alias to lookupflags- options for the collection initializationcancellable- optional cancellation object- Returns:
- the collection, or
nullif none assigned to the alias - Throws:
GErrorException- seeGError
-
forAliasSync
public static @Nullable Collection forAliasSync(@Nullable Service service, String alias, CollectionFlags flags, @Nullable Cancellable cancellable) throws GErrorException Lookup which collection is assigned to this alias. Aliases help determine well known collections, such asdefault.If
serviceisnull, thenService.getSync(java.util.Set<org.gnome.secret.ServiceFlags>, org.gnome.gio.Cancellable)will be called to get the defaultServiceproxy.This method may block and should not be used in user interface threads.
- Parameters:
service- a secret service objectalias- the alias to lookupflags- options for the collection initializationcancellable- optional cancellation object- Returns:
- the collection, or
nullif none assigned to the alias - Throws:
GErrorException- seeGError
-
newForDbusPath
public static void newForDbusPath(@Nullable Service service, String collectionPath, Set<CollectionFlags> flags, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Get a new collection proxy for a collection in the secret service.If
serviceisnull, thenService.get(java.util.Set<org.gnome.secret.ServiceFlags>, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)will be called to get the defaultServiceproxy.This method will return immediately and complete asynchronously.
- Parameters:
service- a secret service objectcollectionPath- the D-Bus path of the collectionflags- options for the collection initializationcancellable- optional cancellation objectcallback- called when the operation completes
-
newForDbusPath
public static void newForDbusPath(@Nullable Service service, String collectionPath, CollectionFlags flags, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Get a new collection proxy for a collection in the secret service.If
serviceisnull, thenService.get(java.util.Set<org.gnome.secret.ServiceFlags>, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)will be called to get the defaultServiceproxy.This method will return immediately and complete asynchronously.
- Parameters:
service- a secret service objectcollectionPath- the D-Bus path of the collectionflags- options for the collection initializationcancellable- optional cancellation objectcallback- called when the operation completes
-
delete
Delete this collection.This method returns immediately and completes asynchronously. The secret service may prompt the user.
Service.prompt(org.gnome.secret.Prompt, org.gnome.glib.VariantType, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)will be used to handle any prompts that show up.- Parameters:
cancellable- optional cancellation objectcallback- called when the operation completes
-
deleteFinish
Complete operation to delete this collection.- Parameters:
result- asynchronous result passed to the callback- Returns:
- whether the collection was successfully deleted or not
- Throws:
GErrorException- seeGError
-
deleteSync
Delete this collection.This method may block indefinitely and should not be used in user interface threads. The secret service may prompt the user.
Service.prompt(org.gnome.secret.Prompt, org.gnome.glib.VariantType, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)will be used to handle any prompts that show up.- Parameters:
cancellable- optional cancellation object- Returns:
- whether the collection was successfully deleted or not
- Throws:
GErrorException- seeGError
-
getCreated
public long getCreated()Get the created date and time of the collection.The return value is the number of seconds since the unix epoch, January 1st 1970.
- Returns:
- the created date and time
-
getCollectionFlags
Get the flags representing what features of theSecretCollectionproxy have been initialized.Use
loadItems(org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)to initialize further features and change the flags.- Returns:
- the flags for features initialized
-
getItems
Get the list of items in this collection.- Returns:
- a list of items, when
done, the list should be freed with
List.free, and each item should be released withGObject.unref()
-
getLabel
Get the label of this collection.- Returns:
- the label, which should be freed with
GLib.free(java.lang.foreign.MemorySegment)
-
getLocked
public boolean getLocked()Get whether the collection is locked or not.Use
Service.lock(org.gnome.glib.List<org.gnome.gio.DBusProxy>, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)orService.unlock(org.gnome.glib.List<org.gnome.gio.DBusProxy>, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)to lock or unlock the collection.- Returns:
- whether the collection is locked or not
-
getModified
public long getModified()Get the modified date and time of the collection.The return value is the number of seconds since the unix epoch, January 1st 1970.
- Returns:
- the modified date and time
-
getService
Get the Secret Service object that this collection was created with.- Returns:
- the Secret Service object
-
loadItems
Ensure that theSecretCollectionproxy has loaded all the items present in the Secret Service.This affects the result of
getItems().For collections returned from
Service.getCollections()the items will have already been loaded.This method will return immediately and complete asynchronously.
- Parameters:
cancellable- optional cancellation objectcallback- called when the operation completes
-
loadItemsFinish
Complete an asynchronous operation to ensure that theSecretCollectionproxy has loaded all the items present in the Secret Service.- Parameters:
result- the asynchronous result passed to the callback- Returns:
- whether the load was successful or not
- Throws:
GErrorException- seeGError
-
loadItemsSync
Ensure that theSecretCollectionproxy has loaded all the items present in the Secret Service. This affects the result ofgetItems().For collections returned from
Service.getCollections()the items will have already been loaded.This method may block indefinitely and should not be used in user interface threads.
- Parameters:
cancellable- optional cancellation object- Returns:
- whether the load was successful or not
- Throws:
GErrorException- seeGError
-
refresh
public void refresh()Refresh the properties on this collection. This fires off a request to refresh, and the properties will be updated later.Calling this method is not normally necessary, as the secret service will notify the client when properties change.
-
search
public void search(@Nullable Schema schema, HashTable<String, String> attributes, Set<SearchFlags> flags, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Search for items matching theattributesin thecollection.Theattributesshould be a table of string keys and string values.If
SearchFlags.ALLis set inflags,then all the items matching the search will be returned. Otherwise only the first item will be returned. This is almost always the unlocked item that was most recently stored.If
SearchFlags.UNLOCKis set inflags,then items will be unlocked if necessary. In either case, locked and unlocked items will match the search and be returned. If the unlock fails, the search does not fail.If
SearchFlags.LOAD_SECRETSis set inflags,then the items will have their secret values loaded and available viaItem.getSecret().This function returns immediately and completes asynchronously.
- Parameters:
schema- the schema for the attributesattributes- search for items matching these attributesflags- search option flagscancellable- optional cancellation objectcallback- called when the operation completes
-
search
public void search(@Nullable Schema schema, HashTable<String, String> attributes, SearchFlags flags, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Search for items matching theattributesin thecollection.Theattributesshould be a table of string keys and string values.If
SearchFlags.ALLis set inflags,then all the items matching the search will be returned. Otherwise only the first item will be returned. This is almost always the unlocked item that was most recently stored.If
SearchFlags.UNLOCKis set inflags,then items will be unlocked if necessary. In either case, locked and unlocked items will match the search and be returned. If the unlock fails, the search does not fail.If
SearchFlags.LOAD_SECRETSis set inflags,then the items will have their secret values loaded and available viaItem.getSecret().This function returns immediately and completes asynchronously.
- Parameters:
schema- the schema for the attributesattributes- search for items matching these attributesflags- search option flagscancellable- optional cancellation objectcallback- called when the operation completes
-
searchFinish
Complete asynchronous operation to search for items in a collection.- Parameters:
result- asynchronous result passed to callback- Returns:
- a list of items that matched the search
- Throws:
GErrorException- seeGError
-
searchForDbusPaths
public void searchForDbusPaths(@Nullable Schema schema, HashTable<String, String> attributes, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Search for items in this Collection matching theattributes,and return their DBus object paths.Only the specified collection is searched. The
attributesshould be a table of string keys and string values.This function returns immediately and completes asynchronously.
When your callback is called use
searchForDbusPathsFinish(org.gnome.gio.AsyncResult)to get the results of this function. Only the DBus object paths of the items will be returned. If you would likeItemobjects to be returned instead, then use thesearch(org.gnome.secret.Schema, org.gnome.glib.HashTable<java.lang.String, java.lang.String>, java.util.Set<org.gnome.secret.SearchFlags>, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)function.- Parameters:
schema- the schema for the attributesattributes- search for items matching these attributescancellable- optional cancellation objectcallback- called when the operation completes
-
searchForDbusPathsFinish
Complete asynchronous operation to search for items in a collection.DBus object paths of the items will be returned. If you would to have
Itemobjects to be returned instead, then use thesearch(org.gnome.secret.Schema, org.gnome.glib.HashTable<java.lang.String, java.lang.String>, java.util.Set<org.gnome.secret.SearchFlags>, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback)andsearchFinish(org.gnome.gio.AsyncResult)functions.- Parameters:
result- asynchronous result passed to callback- Returns:
- an array of DBus object paths for matching items.
- Throws:
GErrorException- seeGError
-
searchForDbusPathsSync
public String[] searchForDbusPathsSync(@Nullable Schema schema, HashTable<String, String> attributes, @Nullable Cancellable cancellable) throws GErrorExceptionSearch for items matching theattributesincollection,and return their DBus object paths.The
attributesshould be a table of string keys and string values.This function may block indefinitely. Use the asynchronous version in user interface threads.
DBus object paths of the items will be returned. If you would to have
Itemobjects to be returned instead, then use thesearchSync(org.gnome.secret.Schema, org.gnome.glib.HashTable<java.lang.String, java.lang.String>, java.util.Set<org.gnome.secret.SearchFlags>, org.gnome.gio.Cancellable)function.- Parameters:
schema- the schema for the attributesattributes- search for items matching these attributescancellable- optional cancellation object- Returns:
- an array of DBus object paths for matching items.
- Throws:
GErrorException- seeGError
-
searchSync
public List<Item> searchSync(@Nullable Schema schema, HashTable<String, String> attributes, Set<SearchFlags> flags, @Nullable Cancellable cancellable) throws GErrorExceptionSearch for items matching theattributesin thecollection.Theattributesshould be a table of string keys and string values.If
SearchFlags.ALLis set inflags,then all the items matching the search will be returned. Otherwise only the first item will be returned. This is almost always the unlocked item that was most recently stored.If
SearchFlags.UNLOCKis set inflags,then items will be unlocked if necessary. In either case, locked and unlocked items will match the search and be returned. If the unlock fails, the search does not fail.If
SearchFlags.LOAD_SECRETSis set inflags,then the items will have their secret values loaded and available viaItem.getSecret().This function may block indefinitely. Use the asynchronous version in user interface threads.
- Parameters:
schema- the schema for the attributesattributes- search for items matching these attributesflags- search option flagscancellable- optional cancellation object- Returns:
- a list of items that matched the search
- Throws:
GErrorException- seeGError
-
searchSync
public List<Item> searchSync(@Nullable Schema schema, HashTable<String, String> attributes, SearchFlags flags, @Nullable Cancellable cancellable) throws GErrorExceptionSearch for items matching theattributesin thecollection.Theattributesshould be a table of string keys and string values.If
SearchFlags.ALLis set inflags,then all the items matching the search will be returned. Otherwise only the first item will be returned. This is almost always the unlocked item that was most recently stored.If
SearchFlags.UNLOCKis set inflags,then items will be unlocked if necessary. In either case, locked and unlocked items will match the search and be returned. If the unlock fails, the search does not fail.If
SearchFlags.LOAD_SECRETSis set inflags,then the items will have their secret values loaded and available viaItem.getSecret().This function may block indefinitely. Use the asynchronous version in user interface threads.
- Parameters:
schema- the schema for the attributesattributes- search for items matching these attributesflags- search option flagscancellable- optional cancellation object- Returns:
- a list of items that matched the search
- Throws:
GErrorException- seeGError
-
setLabel
public void setLabel(String label, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Set the label of this collection.This function returns immediately and completes asynchronously.
- Parameters:
label- a new labelcancellable- optional cancellation objectcallback- called when the operation completes
-
setLabelFinish
Complete asynchronous operation to set the label of this collection.- Parameters:
result- asynchronous result passed to callback- Returns:
- whether the change was successful or not
- Throws:
GErrorException- seeGError
-
setLabelSync
Set the label of this collection.This function may block indefinitely. Use the asynchronous version in user interface threads.
- Parameters:
label- a new labelcancellable- optional cancellation object- Returns:
- whether the change was successful or not
- Throws:
GErrorException- seeGError
-
builder
ACollection.Builderobject constructs aCollectionwith the specified properties. Use the variousset...()methods to set properties, and finish construction withCollection.Builder.build().- Returns:
- the builder object
-