Class Item
- java.lang.Object
-
- org.freedesktop.secret.handlers.Messaging
-
- org.freedesktop.secret.interfaces.Item
-
-
Field Summary
Fields Modifier and Type Field Description static StringATTRIBUTESThe key of the D-Bus properties for the attributes of an item.static StringLABELThe key of of the D-Bus properties for the label of an item.-
Fields inherited from class org.freedesktop.secret.handlers.Messaging
connection, interfaceName, msg, objectPath, serviceName, sh
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract org.freedesktop.dbus.types.UInt64created()static Map<String,org.freedesktop.dbus.types.Variant>createProperties(String label, Map<String,String> attributes)Create properties for a new item.abstract org.freedesktop.dbus.ObjectPathdelete()Delete this item.abstract Map<String,String>getAttributes()The lookup attributes for this item.abstract StringgetLabel()Label is a D-Bus Property.abstract SecretgetSecret(org.freedesktop.dbus.ObjectPath session)Retrieve the secret for this item.abstract StringgetType()abstract booleanisLocked()abstract org.freedesktop.dbus.types.UInt64modified()abstract voidsetAttributes(Map<String,String> attributes)The lookup attributes for this item.abstract voidsetLabel(String label)Label is a D-Bus Property.abstract voidsetSecret(Secret secret)Set the secret for this item.-
Methods inherited from class org.freedesktop.secret.handlers.Messaging
getAllProperties, getConnection, getInterfaceName, getMessageHandler, getObjectPath, getPath, getProperty, getServiceName, getSignalHandler, send, send, setProperty
-
-
-
-
Field Detail
-
LABEL
public static final String LABEL
The key of of the D-Bus properties for the label of an item.- See Also:
- Constant Field Values
-
ATTRIBUTES
public static final String ATTRIBUTES
The key of the D-Bus properties for the attributes of an item.- See Also:
- Constant Field Values
-
-
Method Detail
-
createProperties
public static Map<String,org.freedesktop.dbus.types.Variant> createProperties(String label, Map<String,String> attributes)
Create properties for a new item.- Parameters:
label- The displayable label of the item.attributes- 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:
- 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:
getAttributes()
setAttributes(Map attributes)
Collection.createItem(Map properties, Secret secret, boolean replace)
Collection.createProperties(String label)
Service.createCollection(Map properties)
Service.createCollection(Map properties, String alias)
-
delete
public abstract org.freedesktop.dbus.ObjectPath delete()
Delete this item.- Returns:
- Prompt — A prompt objectpath, or the special value '/' if no prompt is necessary.
-
getSecret
public abstract Secret getSecret(org.freedesktop.dbus.ObjectPath session)
Retrieve the secret for this item.- Parameters:
session- The session to use to encode the secret.- Returns:
- secret — The secret retrieved.
-
setSecret
public abstract void setSecret(Secret secret)
Set the secret for this item.- Parameters:
secret- The secret to set, encoded for the included session.
-
isLocked
public abstract boolean isLocked()
- Returns:
- Whether the item is locked and requires authentication, or not.
-
getAttributes
public abstract Map<String,String> getAttributes()
The lookup attributes for this item. Attributes is a D-Bus Property.It is managed by using the
org.freedesktop.DBus.Propertiesinterface.- Returns:
- The attributes of the item.
-
setAttributes
public abstract void setAttributes(Map<String,String> attributes)
The lookup attributes for this item. Attributes is a D-Bus Property.It is managed by using the
org.freedesktop.DBus.Propertiesinterface.- Parameters:
attributes- The attributes of the item.
-
getLabel
public abstract String getLabel()
Label is a D-Bus Property.It is managed by using the
org.freedesktop.DBus.Propertiesinterface.- Returns:
- The displayable label of this collection.
Note: The displayable
labelcan differ from the actualnameof a collection.
-
setLabel
public abstract void setLabel(String label)
Label is a D-Bus Property.It is managed by using the
org.freedesktop.DBus.Propertiesinterface.- Parameters:
label- The displayable label of this collection.Note: The displayable
labelcan differ from the actualnameof a collection.
-
getType
public abstract String getType()
- Returns:
- The "xdg:schema" of the item attributes.
-
created
public abstract org.freedesktop.dbus.types.UInt64 created()
- Returns:
- The unix time when the item was created.
-
modified
public abstract org.freedesktop.dbus.types.UInt64 modified()
- Returns:
- The unix time when the item was last modified.
-
-