Interface DBus

    • Field Detail

      • DBUS_NAME_FLAG_ALLOW_REPLACEMENT

        static final int DBUS_NAME_FLAG_ALLOW_REPLACEMENT
        See Also:
        Constant Field Values
      • DBUS_NAME_FLAG_REPLACE_EXISTING

        static final int DBUS_NAME_FLAG_REPLACE_EXISTING
        See Also:
        Constant Field Values
      • DBUS_NAME_FLAG_DO_NOT_QUEUE

        static final int DBUS_NAME_FLAG_DO_NOT_QUEUE
        See Also:
        Constant Field Values
      • DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER

        static final int DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER
        See Also:
        Constant Field Values
      • DBUS_REQUEST_NAME_REPLY_IN_QUEUE

        static final int DBUS_REQUEST_NAME_REPLY_IN_QUEUE
        See Also:
        Constant Field Values
      • DBUS_REQUEST_NAME_REPLY_EXISTS

        static final int DBUS_REQUEST_NAME_REPLY_EXISTS
        See Also:
        Constant Field Values
      • DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER

        static final int DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER
        See Also:
        Constant Field Values
      • DBUS_RELEASE_NAME_REPLY_RELEASED

        static final int DBUS_RELEASE_NAME_REPLY_RELEASED
        See Also:
        Constant Field Values
      • DBUS_RELEASE_NAME_REPLY_NON_EXISTANT

        static final int DBUS_RELEASE_NAME_REPLY_NON_EXISTANT
        See Also:
        Constant Field Values
      • DBUS_RELEASE_NAME_REPLY_NOT_OWNER

        static final int DBUS_RELEASE_NAME_REPLY_NOT_OWNER
        See Also:
        Constant Field Values
      • DBUS_START_REPLY_ALREADY_RUNNING

        static final int DBUS_START_REPLY_ALREADY_RUNNING
        See Also:
        Constant Field Values
    • Method Detail

      • Hello

        String Hello()
        Initial message to register ourselves on the Bus.
        Returns:
        The unique name of this connection to the Bus.
      • RequestName

        UInt32 RequestName​(String name,
                           UInt32 flags)
        Request a name on the bus.
        Parameters:
        name - The name to request.
        flags - DBUS_NAME flags.
        Returns:
        DBUS_REQUEST_NAME_REPLY constants.
      • ReleaseName

        UInt32 ReleaseName​(String name)
        Release a name on the bus.
        Parameters:
        name - The name to release.
        Returns:
        DBUS_RELEASE_NAME_REPLY constants.
      • ListQueuedOwners

        String[] ListQueuedOwners​(String name)
        List the connections currently queued for a name.
        Parameters:
        name - The name to query
        Returns:
        A list of unique connection IDs.
      • ListNames

        String[] ListNames()
        Lists all connected names on the Bus.
        Returns:
        An array of all connected names.
      • ListActivatableNames

        String[] ListActivatableNames()
        Returns a list of all names that can be activated on the bus.
        Returns:
        Array of strings where each string is a bus name
      • NameHasOwner

        boolean NameHasOwner​(String name)
        Determine if a name has an owner.
        Parameters:
        name - The name to query.
        Returns:
        true if the name has an owner.
      • StartServiceByName

        UInt32 StartServiceByName​(String name,
                                  UInt32 flags)
        Start a service. If the given service is not provided by any application, it will be started according to the .service file for that service.
        Parameters:
        name - The service name to start.
        flags - Unused.
        Returns:
        DBUS_START_REPLY constants.
      • UpdateActivationEnvironment

        void UpdateActivationEnvironment​(Map<String,​String>[] environment)
        DBUS Specification:
        Normally, session bus activated services inherit the environment of the bus daemon. This method adds to or modifies that environment when activating services. Some bus instances, such as the standard system bus, may disable access to this method for some or all callers. Note, both the environment variable names and values must be valid UTF-8. There's no way to update the activation environment with data that is invalid UTF-8.
        Parameters:
        environment - Environment to add or update
      • GetNameOwner

        String GetNameOwner​(String name)
        Get the connection unique name that owns the given name.
        Parameters:
        name - The name to query.
        Returns:
        The connection which owns the name.
      • GetConnectionUnixUser

        UInt32 GetConnectionUnixUser​(String connection_name)
        Get the Unix UID that owns a connection name.
        Parameters:
        connection_name - The connection name.
        Returns:
        The Unix UID that owns it.
      • GetConnectionUnixProcessID

        UInt32 GetConnectionUnixProcessID​(String connection_name)
        Returns the proccess ID associated with a connection.
        Parameters:
        connection_name - The name of the connection
        Returns:
        The PID of the connection.
      • GetConnectionCredentials

        Map<String,​Variant<?>> GetConnectionCredentials​(String busName)
        DBUS Specification:
        Returns as many credentials as possible for the process connected to the server. If unable to determine certain credentials (for instance, because the process is not on the same machine as the bus daemon, or because this version of the bus daemon does not support a particular security framework), or if the values of those credentials cannot be represented as documented here, then those credentials are omitted.

        Keys in the returned dictionary not containing "." are defined by this specification. Bus daemon implementors supporting credentials frameworks not mentioned in this document should either contribute patches to this specification, or use keys containing "." and starting with a reversed domain name.

        Parameters:
        busName - Unique or well-known bus name of the connection to query, such as :12.34 or com.example.tea
        Returns:
        Credentials
      • GetAdtAuditSessionData

        Byte[] GetAdtAuditSessionData​(String busName)
        DBUS Specification:
        Returns auditing data used by Solaris ADT, in an unspecified
        binary format. If you know what this means, please contribute
        documentation via the D-Bus bug tracking system.
        This method is on the core DBus interface for historical reasons;
        the same information should be made available via
        the section called "org.freedesktop.DBus.GetConnectionCredentials"
        in future.
        Parameters:
        busName - Unique or well-known bus name of the connection to query, such as :12.34 or com.example.tea
        Returns:
        auditing data as returned by adt_export_session_data()
      • GetConnectionSELinuxSecurityContext

        Byte[] GetConnectionSELinuxSecurityContext​(String busName)
        DBUS Specification:
        Returns the security context used by SELinux, in an unspecified
        format. If you know what this means, please contribute
        documentation via the D-Bus bug tracking system.
        This method is on the core DBus interface for historical reasons;
        the same information should be made available via
        the section called "org.freedesktop.DBus.GetConnectionCredentials
        in future.
        Parameters:
        busName - Unique or well-known bus name of the connection to query, such as :12.34 or com.example.tea
        Returns:
        some sort of string of bytes, not necessarily UTF-8, not including '\0'
      • AddMatch

        void AddMatch​(String matchrule)
               throws MatchRuleInvalid
        Add a match rule. Will cause you to receive messages that aren't directed to you which match this rule.
        Parameters:
        matchrule - The Match rule as a string. Format Undocumented.
        Throws:
        MatchRuleInvalid
      • RemoveMatch

        void RemoveMatch​(String matchrule)
                  throws MatchRuleInvalid
        Remove a match rule. Will cause you to stop receiving messages that aren't directed to you which match this rule.
        Parameters:
        matchrule - The Match rule as a string. Format Undocumented.
        Throws:
        MatchRuleInvalid
      • GetId

        String GetId()
        DBUS Specification:
        Gets the unique ID of the bus. The unique ID here is shared among all addresses the
        bus daemon is listening on (TCP, UNIX domain socket, etc.) and its format is described in
        the section called "UUIDs”.
        Each address the bus is listening on also has its own unique
        ID, as described in the section called "Server Addresses”. The per-bus and per-address IDs are not related.
        There is also a per-machine ID, described in the section called "org.freedesktop.DBus.Peer and returned by org.freedesktop.DBus.Peer.GetMachineId().
        For a desktop session bus, the bus ID can be used as a way to uniquely identify a user's session.
        Returns:
        id Unique ID identifying the bus daemon