Class Collection

java.lang.Object
de.swiesend.secretservice.handlers.Messaging
de.swiesend.secretservice.Collection
All Implemented Interfaces:
Collection, org.freedesktop.dbus.interfaces.DBusInterface

public class Collection extends de.swiesend.secretservice.handlers.Messaging implements Collection
  • Nested Class Summary

    Nested classes/interfaces inherited from interface de.swiesend.secretservice.interfaces.Collection

    Collection.ItemChanged, Collection.ItemCreated, Collection.ItemDeleted
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final List<Class<? extends org.freedesktop.dbus.messages.DBusSignal>>
     

    Fields inherited from class de.swiesend.secretservice.handlers.Messaging

    connection, interfaceName, msg, objectPath, serviceName, sh

    Fields inherited from interface de.swiesend.secretservice.interfaces.Collection

    LABEL
  • Constructor Summary

    Constructors
    Constructor
    Description
    Collection(String id, Service service)
     
    Collection(org.freedesktop.dbus.DBusPath path, Service service)
     
    Collection(org.freedesktop.dbus.DBusPath path, Service service, List<Class<? extends org.freedesktop.dbus.messages.DBusSignal>> signals)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.freedesktop.dbus.types.UInt64
     
    Pair<org.freedesktop.dbus.ObjectPath,org.freedesktop.dbus.ObjectPath>
    createItem(Map<String,org.freedesktop.dbus.types.Variant> properties, Secret secret, boolean replace)
    Create an item with the given attributes, secret and label.
    static Map<String,org.freedesktop.dbus.types.Variant>
    Create propterties for a new collection.
    org.freedesktop.dbus.ObjectPath
    Delete this collection.
     
    List<org.freedesktop.dbus.ObjectPath>
    Items is a D-Bus Property.
    Label is a D-Bus Property.
     
    boolean
     
    boolean
     
    org.freedesktop.dbus.types.UInt64
     
    List<org.freedesktop.dbus.ObjectPath>
    Search for items in this collection matching the lookup attributes.
    void
    Label is a D-Bus Property.

    Methods inherited from class de.swiesend.secretservice.handlers.Messaging

    getAllProperties, getConnection, getInterfaceName, getMessageHandler, getPath, getProperty, getServiceName, getSignalHandler, send, send, setProperty

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • signals

      public static final List<Class<? extends org.freedesktop.dbus.messages.DBusSignal>> signals
  • Constructor Details

    • Collection

      public Collection(org.freedesktop.dbus.DBusPath path, Service service)
    • Collection

      public Collection(org.freedesktop.dbus.DBusPath path, Service service, List<Class<? extends org.freedesktop.dbus.messages.DBusSignal>> signals)
    • Collection

      public Collection(String id, Service service)
  • Method Details

    • createProperties

      public static Map<String,org.freedesktop.dbus.types.Variant> createProperties(String label)
      Create propterties for a new collection.
      Parameters:
      label - The displayable label of this collection.

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

      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:
      createItem(Map properties, Secret secret, boolean replace)
      Service.createCollection(Map properties)
      Service.createCollection(Map properties, String alias)
      Item.createProperties(String label, Map attributes)
    • delete

      public org.freedesktop.dbus.ObjectPath delete()
      Description copied from interface: Collection
      Delete this collection.
      Specified by:
      delete in interface Collection
      Returns:
      prompt — A prompt to delete the collection, or the special value '/' when no prompt is necessary.
      See Also:
      • ObjectPath
    • searchItems

      public List<org.freedesktop.dbus.ObjectPath> searchItems(Map<String,String> attributes)
      Description copied from interface: Collection
      Search for items in this collection matching the lookup attributes.
      Specified by:
      searchItems in interface Collection
      Parameters:
      attributes - Attributes to match.
      Returns:
      results — Items that matched the attributes.
      See Also:
    • createItem

      public Pair<org.freedesktop.dbus.ObjectPath,org.freedesktop.dbus.ObjectPath> createItem(Map<String,org.freedesktop.dbus.types.Variant> properties, Secret secret, boolean replace)
      Description copied from interface: Collection
      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.
      Specified by:
      createItem in interface Collection
      Parameters:
      properties - 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 - The secret to store in the item, encoded with the included session.
      replace - Whether to replace an item with the same attributes or not.
      Returns:
      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:
      createProperties(String label)
      Item.createProperties(String label, Map attributes)
      See Also:
    • getItems

      public List<org.freedesktop.dbus.ObjectPath> getItems()
      Description copied from interface: Collection
      Items is a D-Bus Property.

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

      Specified by:
      getItems in interface Collection
      Returns:
      Items in this collection.
    • getLabel

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

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

      Specified by:
      getLabel in interface Collection
      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: Collection
      Label is a D-Bus Property.

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

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

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

    • isLocked

      public boolean isLocked()
      Specified by:
      isLocked in interface Collection
      Returns:
      Whether the collection is locked and must be authenticated by the client application.
    • created

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

      public org.freedesktop.dbus.types.UInt64 modified()
      Specified by:
      modified in interface Collection
      Returns:
      The unix time when the collection 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 de.swiesend.secretservice.handlers.Messaging
    • getId

      public String getId()