Top Fields Constructors Methods
org.freedesktop.secret

public Class Item

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

Field Summary

Modifier and TypeField and Description
private String
Inherited from org.freedesktop.secret.handlers.Messaging:
connectioninterfaceNamemsgobjectPathserviceNamesh

Constructor Summary

AccessConstructor and Description
public
Item(String collectionID, String itemID, Service service)

public
Item(ObjectPath item, Service service)
References Deprecated ObjectPath is deprecated or references (maybe indirectly) at least one deprecated element.

Method Summary

Modifier and TypeMethod and Description
public UInt64
public static Map<String, Variant<T>>

Returns:

properties — The properties for an item.

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

Note

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


See Also:
org.freedesktop.secret.interfaces.Item#getAttributes()
org.freedesktop.secret.interfaces.Item#setAttributes(Map attributes)
org.freedesktop.secret.interfaces.Collection#createItem(Map properties, Secret secret, boolean replace)
org.freedesktop.secret.Collection#createProperties(String label)
org.freedesktop.secret.interfaces.Service#createCollection(Map properties)
org.freedesktop.secret.interfaces.Service#createCollection(Map properties, String alias)
createProperties
(String
The displayable label of the item.
label
,
Map<String, String>
String-valued attributes of the item.

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.

attributes
)

Create properties for a new item.

public ObjectPath
delete()

Implements org.freedesktop.secret.interfaces.Item.delete.

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

Delete this item.

public Map<String, String>
getAttributes()

Implements org.freedesktop.secret.interfaces.Item.getAttributes.

The lookup attributes for this item.

public String
public String
getLabel()

Implements org.freedesktop.secret.interfaces.Item.getLabel.

Label is a D-Bus Property.

public String
public Secret
getSecret(ObjectPath
The session to use to encode the secret.
session
)

Implements org.freedesktop.secret.interfaces.Item.getSecret.

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

Retrieve the secret for this item.

public String
public boolean
public boolean
isRemote()

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

Returns true on remote objects.

public UInt64
public void
setAttributes(Map<String, String>
The attributes of the item.
attributes
)

Implements org.freedesktop.secret.interfaces.Item.setAttributes.

The lookup attributes for this item.

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.Item.setLabel.

Label is a D-Bus Property.

public void
setSecret(Secret
The secret to set, encoded for the included session.
secret
)

Implements org.freedesktop.secret.interfaces.Item.setSecret.

Set the secret for this item.

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

Field Detail

idback to summary
private String id

Constructor Detail

Itemback to summary
public Item(String collectionID, String itemID, Service service)
Itemback to summary
public Item(ObjectPath item, Service service)

References Deprecated

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

See corresponding docs for further information.

Method Detail

createdback to summary
public UInt64 created()

Implements org.freedesktop.secret.interfaces.Item.created.

Returns:UInt64

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

The unix time when the item was created.

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

Create properties for a new item.

Parameters
label:String

The displayable label of the item.

attributes:Map<String, String>

String-valued attributes of the item.

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.

Returns:Map<String, Variant<T>>

properties — The properties for an item.

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

Note

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


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

Implements org.freedesktop.secret.interfaces.Item.delete.

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

References Deprecated

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

See corresponding docs for further information.

Delete this item.

Returns:ObjectPath

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

Annotations
@Override
getAttributesback to summary
public Map<String, String> getAttributes()

Implements org.freedesktop.secret.interfaces.Item.getAttributes.

Doc from org.freedesktop.secret.interfaces.Item.getAttributes.

The lookup attributes for this item. Attributes is a D-Bus Property.

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

Returns:Map<String, String>

The attributes of the item.

Annotations
@Override
getIdback to summary
public String getId()
getLabelback to summary
public String getLabel()

Implements org.freedesktop.secret.interfaces.Item.getLabel.

Doc from org.freedesktop.secret.interfaces.Item.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
getSecretback to summary
public Secret getSecret(ObjectPath session)

Implements org.freedesktop.secret.interfaces.Item.getSecret.

Doc from org.freedesktop.secret.interfaces.Item.getSecret.

References Deprecated

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

See corresponding docs for further information.

Retrieve the secret for this item.

Parameters
session:ObjectPath

The session to use to encode the secret.

Returns:Secret

secret — The secret retrieved.

Annotations
@Override
getTypeback to summary
public String getType()

Implements org.freedesktop.secret.interfaces.Item.getType.

Returns:String

Doc from org.freedesktop.secret.interfaces.Item.getType.

The "xdg:schema" of the item attributes.

Annotations
@Override
isLockedback to summary
public boolean isLocked()

Implements org.freedesktop.secret.interfaces.Item.isLocked.

Returns:boolean

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

Whether the item is locked and requires authentication, or not.

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.Item.modified.

Returns:UInt64

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

The unix time when the item was last modified.

Annotations
@Override
setAttributesback to summary
public void setAttributes(Map<String, String> attributes)

Implements org.freedesktop.secret.interfaces.Item.setAttributes.

Doc from org.freedesktop.secret.interfaces.Item.setAttributes.

The lookup attributes for this item. Attributes is a D-Bus Property.

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

Parameters
attributes:Map<String, String>

The attributes of the item.

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

Implements org.freedesktop.secret.interfaces.Item.setLabel.

Doc from org.freedesktop.secret.interfaces.Item.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
setSecretback to summary
public void setSecret(Secret secret)

Implements org.freedesktop.secret.interfaces.Item.setSecret.

Doc from org.freedesktop.secret.interfaces.Item.setSecret.

Set the secret for this item.

Parameters
secret:Secret

The secret to set, encoded for the included session.

Annotations
@Override