Class Item

All Implemented Interfaces:
org.freedesktop.dbus.interfaces.DBusInterface, Item

public class Item
extends Messaging
implements Item
  • Constructor Details

  • Method Details

    • 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:
      Item.getAttributes()
      Item.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 org.freedesktop.dbus.ObjectPath delete()
      Description copied from interface: Item
      Delete this item.
      Specified by:
      delete in interface Item
      Returns:
      Prompt — A prompt objectpath, or the special value '/' if no prompt is necessary.
    • getSecret

      public Secret getSecret​(org.freedesktop.dbus.ObjectPath session)
      Description copied from interface: Item
      Retrieve the secret for this item.
      Specified by:
      getSecret in interface Item
      Parameters:
      session - The session to use to encode the secret.
      Returns:
      secret — The secret retrieved.
    • setSecret

      public void setSecret​(Secret secret)
      Description copied from interface: Item
      Set the secret for this item.
      Specified by:
      setSecret in interface Item
      Parameters:
      secret - The secret to set, encoded for the included session.
    • isLocked

      public boolean isLocked()
      Specified by:
      isLocked in interface Item
      Returns:
      Whether the item is locked and requires authentication, or not.
    • getAttributes

      public Map<String,​String> getAttributes()
      Description copied from interface: Item
      The lookup attributes for this item. Attributes is a D-Bus Property.

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

      Specified by:
      getAttributes in interface Item
      Returns:
      The attributes of the item.
    • setAttributes

      public void setAttributes​(Map<String,​String> attributes)
      Description copied from interface: Item
      The lookup attributes for this item. Attributes is a D-Bus Property.

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

      Specified by:
      setAttributes in interface Item
      Parameters:
      attributes - The attributes of the item.
    • getLabel

      public String getLabel()
      Description copied from interface: Item
      Label is a D-Bus Property.

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

      Specified by:
      getLabel in interface Item
      Returns:
      The displayable label of this collection.

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

    • setLabel

      public void setLabel​(String label)
      Description copied from interface: Item
      Label is a D-Bus Property.

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

      Specified by:
      setLabel in interface Item
      Parameters:
      label - The displayable label of this collection.

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

    • getType

      public String getType()
      Specified by:
      getType in interface Item
      Returns:
      The "xdg:schema" of the item attributes.
    • created

      public org.freedesktop.dbus.types.UInt64 created()
      Specified by:
      created in interface Item
      Returns:
      The unix time when the item was created.
    • modified

      public org.freedesktop.dbus.types.UInt64 modified()
      Specified by:
      modified in interface Item
      Returns:
      The unix time when the item was last modified.
    • isRemote

      public boolean isRemote()
      Specified by:
      isRemote in interface org.freedesktop.dbus.interfaces.DBusInterface
    • getObjectPath

      public String getObjectPath()
      Specified by:
      getObjectPath in interface org.freedesktop.dbus.interfaces.DBusInterface
      Overrides:
      getObjectPath in class Messaging
    • getId

      public String getId()