All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.freedesktop.dbus.interfaces.Properties Maven / Gradle / Ivy

Go to download

Slightly improved version of the Java DBus library provided by freedesktop.org (https://dbus.freedesktop.org/doc/dbus-java/). Changes: - Fixed lot's of Java warnings - Fixed broken 'Gettext' feature (Exceptions on unsupported languages, usage of "_" as method name). - Renamed some classes/methods/variables to comply with Java naming scheme. - Removed usage of proprietary logger and replaced it with sl4fj. - Renamed/refactored some parts to be more 'Java' like (e.g. naming, shadowing) - Fixed problems with DbusConnection.getConnection(SESSION) when using display export (e.g. SSH X11 forward)

There is a newer version: 3.3.2
Show newest version
package org.freedesktop.dbus.interfaces;

import java.util.List;
import java.util.Map;

import org.freedesktop.dbus.annotations.DBusInterfaceName;
import org.freedesktop.dbus.exceptions.DBusException;
import org.freedesktop.dbus.messages.DBusSignal;
import org.freedesktop.dbus.types.Variant;

/**
* A standard properties interface.
*/
@DBusInterfaceName("org.freedesktop.DBus.Properties")
public interface Properties extends DBusInterface {
    /**
     * Get the value for the given property.
     * @param  whatever
     * @param interface_name The interface this property is associated with.
     * @param property_name The name of the property.
     * @return The value of the property (may be any valid DBus type).
     */
     A Get(String interface_name, String property_name);

    /**
     * Set the value for the given property.
     * @param  whatever
     * @param interface_name The interface this property is associated with.
     * @param property_name The name of the property.
     * @param value The new value of the property (may be any valid DBus type).
     */
     void Set(String interface_name, String property_name, A value);

    /**
     * Get all properties and values.
     * @param interface_name The interface the properties is associated with.
     * @return The properties mapped to their values.
     */
    Map> GetAll(String interface_name);

    /**
     * Signal generated when a property changes.
     */
    public static class PropertiesChanged extends DBusSignal {
        private final Map> propertiesChanged;
        private final List         propertiesRemoved;
        
        private final String interfaceName;
        

        public PropertiesChanged(String _path, String _interfaceName, Map> _propertiesChanged, List _propertiesRemoved) throws DBusException {
            super(_path, _interfaceName, _propertiesChanged, _propertiesRemoved);

            this.propertiesChanged = _propertiesChanged;
            this.propertiesRemoved = _propertiesRemoved;
            this.interfaceName = _interfaceName;
        }

        /**
         * Get name of the interface created this signal (e.g. org.bluez.Adapter1).
         * @return String
         */
        public String getInterfaceName() {
            return interfaceName;
        }

        
        /**
         * Return the changed properties.
         * Key is the properties name, value is Variant containing any type.
         * @return Map
         */
        public Map> getPropertiesChanged() {
            return propertiesChanged;
        }

        /**
         * Returns a list of removed property keys.        
         * @return List
         */
        public List getPropertiesRemoved() {
            return propertiesRemoved;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy