Top Fields Constructors Methods
org.freedesktop.secret

public Class Collection

extends Messaging
implements Collection
Class Inheritance
All Implemented Interfaces
org.freedesktop.secret.interfaces.Collection, org.freedesktop.dbus.interfaces.DBusInterface
Imports
org.freedesktop.dbus.DBusPath, .ObjectPath, org.freedesktop.dbus.messages.DBusSignal, org.freedesktop.dbus.types.UInt64, .Variant, org.freedesktop.secret.handlers.Messaging, java.util.*

Field Summary

Modifier and TypeField and Description
private String
public static final List<Class<? extends DBusSignal>>
Inherited from org.freedesktop.secret.handlers.Messaging:
connectioninterfaceNamemsgobjectPathserviceNamesh

Constructor Summary

AccessConstructor and Description
public
Collection(DBusPath path, Service service)

public
Collection(DBusPath path, Service service, List<Class<? extends DBusSignal>> signals)

public
Collection(String id, Service service)

Method Summary

Modifier and TypeMethod and Description
public UInt64
public Pair<ObjectPath, ObjectPath>
createItem(Map<String, Variant<T>>
The properties for the new item.

This allows setting the new item's properties upon its creation. All READWRITE properties are useable. Specify the property names in full interface.Property form.

Example 13.2. Example for properties of an item:
properties = {
  "org.freedesktop.Secret.Item.Label": "MyItem",
  "org.freedesktop.Secret.Item.Attributes": {
    "Attribute1": "Value1",
    "Attribute2": "Value2"
  }
}

Note

Please note that there is a distinction between the terms Property, which refers to D-Bus properties of an object, and Attribute, which refers to one of a secret item's string-valued attributes.

properties
,
Secret
The secret to store in the item, encoded with the included session.
secret
,
boolean
Whether to replace an item with the same attributes or not.
replace
)

Implements org.freedesktop.secret.interfaces.Collection.createItem.

Create an item with the given attributes, secret and label.

public static Map<String, Variant<T>>

Returns:

properties — The propterties for a collection.

{org.freedesktop.Secret.Collection.Label: label}

Note

Properties for a collection and properties for an item are not the same.


See Also:
Collection#createItem(Map properties, Secret secret, boolean replace)
Service#createCollection(Map properties)
Service#createCollection(Map properties, String alias)
Item#createProperties(String label, Map attributes)
createProperties
(String
The displayable label of this collection.

Note

The displayable label can differ from the actual name of a collection.

label
)

Create propterties for a new collection.

public ObjectPath
delete()

Implements org.freedesktop.secret.interfaces.Collection.delete.

References Deprecated ObjectPath is deprecated or references (maybe indirectly) at least one deprecated element.

Delete this collection.

public String
public List<ObjectPath>
getItems()

Implements org.freedesktop.secret.interfaces.Collection.getItems.

Items is a D-Bus Property.

public String
getLabel()

Implements org.freedesktop.secret.interfaces.Collection.getLabel.

Label is a D-Bus Property.

public String
public boolean
public boolean
isRemote()

Overrides default org.freedesktop.dbus.interfaces.DBusInterface.isRemote.

Returns true on remote objects.

public UInt64
public List<ObjectPath>
searchItems(Map<String, String>
Attributes to match.
attributes
)

Implements org.freedesktop.secret.interfaces.Collection.searchItems.

Search for items in this collection matching the lookup attributes.

public void
setLabel(String
The displayable label of this collection.

Note

The displayable label can differ from the actual name of a collection.

label
)

Implements org.freedesktop.secret.interfaces.Collection.setLabel.

Label is a D-Bus Property.

Inherited from org.freedesktop.secret.handlers.Messaging:
getAllPropertiesgetConnectiongetInterfaceNamegetMessageHandlergetPathgetPropertygetServiceNamegetSignalHandlersendsendsetProperty

Field Detail

idback to summary
private String id
signalsback to summary
public static final List<Class<? extends DBusSignal>> signals

Constructor Detail

Collectionback to summary
public Collection(DBusPath path, Service service)
Collectionback to summary
public Collection(DBusPath path, Service service, List<Class<? extends DBusSignal>> signals)
Collectionback to summary
public Collection(String id, Service service)

Method Detail

createdback to summary
public UInt64 created()

Implements org.freedesktop.secret.interfaces.Collection.created.

Returns:UInt64

Doc from org.freedesktop.secret.interfaces.Collection.created.

The unix time when the collection was created.

Annotations
@Override
createItemback to summary
public Pair<ObjectPath, ObjectPath> createItem(Map<String, Variant<T>> properties, Secret secret, boolean replace)

Implements org.freedesktop.secret.interfaces.Collection.createItem.

Doc from org.freedesktop.secret.interfaces.Collection.createItem.

Create an item with the given attributes, secret and label. If replace is set, then it replaces an item already present with the same values for the attributes.

Parameters
properties:Map<String, Variant<T>>

The properties for the new item.

This allows setting the new item's properties upon its creation. All READWRITE properties are useable. Specify the property names in full interface.Property form.

Example 13.2. Example for properties of an item:
properties = {
  "org.freedesktop.Secret.Item.Label": "MyItem",
  "org.freedesktop.Secret.Item.Attributes": {
    "Attribute1": "Value1",
    "Attribute2": "Value2"
  }
}

Note

Please note that there is a distinction between the terms Property, which refers to D-Bus properties of an object, and Attribute, which refers to one of a secret item's string-valued attributes.

secret:Secret

The secret to store in the item, encoded with the included session.

replace:boolean

Whether to replace an item with the same attributes or not.

Returns:Pair<ObjectPath, ObjectPath>

Pair<item, prompt>

item — The item created, or the special value '/' if a prompt is necessary.

prompt — A prompt object, or the special value '/' if no prompt is necessary.

See Also:
org.freedesktop.secret.Collection#createProperties(String label)
org.freedesktop.secret.Item#createProperties(String label, Map attributes)

Annotations
@Override
createPropertiesback to summary
public static Map<String, Variant<T>> createProperties(String label)

Create propterties for a new collection.

Parameters
label:String

The displayable label of this collection.

Note

The displayable label can differ from the actual name of a collection.

Returns:Map<String, Variant<T>>

properties — The propterties for a collection.

{org.freedesktop.Secret.Collection.Label: label}

Note

Properties for a collection and properties for an item are not the same.


See Also:
Collection#createItem(Map properties, Secret secret, boolean replace)
Service#createCollection(Map properties)
Service#createCollection(Map properties, String alias)
Item#createProperties(String label, Map attributes)
deleteback to summary
public ObjectPath delete()

Implements org.freedesktop.secret.interfaces.Collection.delete.

Doc from org.freedesktop.secret.interfaces.Collection.delete.

References Deprecated

ObjectPath is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Delete this collection.

Returns:ObjectPath

prompt — A prompt to delete the collection, or the special value '/' when no prompt is necessary.

Annotations
@Override
getIdback to summary
public String getId()
getItemsback to summary
public List<ObjectPath> getItems()

Implements org.freedesktop.secret.interfaces.Collection.getItems.

Doc from org.freedesktop.secret.interfaces.Collection.getItems.

Items is a D-Bus Property.

It is managed by using the org.freedesktop.DBus.Properties interface.

Returns:List<ObjectPath>

Items in this collection.

Annotations
@Override
getLabelback to summary
public String getLabel()

Implements org.freedesktop.secret.interfaces.Collection.getLabel.

Doc from org.freedesktop.secret.interfaces.Collection.getLabel.

Label is a D-Bus Property.

It is managed by using the org.freedesktop.DBus.Properties interface.

Returns:String

The displayable label of this collection.

Note

The displayable label can differ from the actual name of a collection.

Annotations
@Override
getObjectPathback to summary
public String getObjectPath()

Overrides org.freedesktop.secret.handlers.Messaging.getObjectPath.

Implements org.freedesktop.dbus.interfaces.DBusInterface.getObjectPath.

Doc from org.freedesktop.dbus.interfaces.DBusInterface.getObjectPath.

Returns the path of this object.

Returns:String

string

Annotations
@Override
isLockedback to summary
public boolean isLocked()

Implements org.freedesktop.secret.interfaces.Collection.isLocked.

Returns:boolean

Doc from org.freedesktop.secret.interfaces.Collection.isLocked.

Whether the collection is locked and must be authenticated by the client application.

Annotations
@Override
isRemoteback to summary
public boolean isRemote()

Overrides default org.freedesktop.dbus.interfaces.DBusInterface.isRemote.

Doc from org.freedesktop.dbus.interfaces.DBusInterface.isRemote.

Returns true on remote objects. Local objects implementing this interface MUST return false.

Returns:boolean

boolean

Annotations
@Override
modifiedback to summary
public UInt64 modified()

Implements org.freedesktop.secret.interfaces.Collection.modified.

Returns:UInt64

Doc from org.freedesktop.secret.interfaces.Collection.modified.

The unix time when the collection was last modified.

Annotations
@Override
searchItemsback to summary
public List<ObjectPath> searchItems(Map<String, String> attributes)

Implements org.freedesktop.secret.interfaces.Collection.searchItems.

Doc from org.freedesktop.secret.interfaces.Collection.searchItems.

Search for items in this collection matching the lookup attributes.

Parameters
attributes:Map<String, String>

Attributes to match.

Returns:List<ObjectPath>

results — Items that matched the attributes.

Annotations
@Override
setLabelback to summary
public void setLabel(String label)

Implements org.freedesktop.secret.interfaces.Collection.setLabel.

Doc from org.freedesktop.secret.interfaces.Collection.setLabel.

Label is a D-Bus Property.

It is managed by using the org.freedesktop.DBus.Properties interface.

Parameters
label:String

The displayable label of this collection.

Note

The displayable label can differ from the actual name of a collection.

Annotations
@Override