Package com.lucimber.dbus.standard
Interface Properties
public interface Properties
The org.freedesktop.DBus.Properties interface provides methods to expose properties or
attributes of objects. It is conventional to give D-Bus properties names consisting of
capitalized words without punctuation ("CamelCase"), like member names. Strictly speaking, D-Bus
property names are not required to follow the same naming restrictions as member names, but D-Bus
property names that would not be valid member names (in particular, GObject-style dash-separated
property names) can cause interoperability problems and should be avoided.
-
Method Summary
Modifier and TypeMethodDescriptiongetProperties(DBusString interfaceName) Gets all properties.getProperty(DBusString interfaceName, DBusString propertyName) Gets the value of a property.voidsetProperty(DBusString interfaceName, DBusString propertyName, DBusVariant value) Sets the value of a property.
-
Method Details
-
getProperty
Optional<DBusVariant> getProperty(DBusString interfaceName, DBusString propertyName) throws UnknownInterfaceException, UnknownPropertyException, AccessDeniedException Gets the value of a property.- Parameters:
interfaceName- the name of the interfacepropertyName- the name of the property- Returns:
- An
OptionalofDBusVariant. - Throws:
UnknownInterfaceException- If the interface is unknown to the implementation.UnknownPropertyException- If the property is unknown to the implementation.AccessDeniedException- If caller is not allowed to access the property.
-
setProperty
void setProperty(DBusString interfaceName, DBusString propertyName, DBusVariant value) throws UnknownInterfaceException, UnknownPropertyException, AccessDeniedException, PropertyReadOnlyException Sets the value of a property.- Parameters:
interfaceName- the name of the interfacepropertyName- the name of the propertyvalue- the value that should be assigned- Throws:
UnknownInterfaceException- If the interface is unknown to the implementation.UnknownPropertyException- If the property is unknown to the implementation.AccessDeniedException- If caller is not allowed to access the property.PropertyReadOnlyException- If the property can only be read.
-
getProperties
DBusDict<DBusString,DBusVariant> getProperties(DBusString interfaceName) throws UnknownInterfaceException Gets all properties. Properties, to which the caller has no access, are silently omitted from the result array.- Parameters:
interfaceName- the name of the interface- Returns:
- A
DBusDictofDBusStringandDBusVariant. - Throws:
UnknownInterfaceException- If the interface is unknown to the implementation.
-