Klasse UDN

java.lang.Object
org.jupnp.model.types.UDN

public class UDN extends Object
A unique device name.

UDA 1.0 does not specify a UUID format, however, UDA 1.1 specifies a format that is compatible with java.util.UUID variant 4. You can use any identifier string you like.

You'll most likely need the uniqueSystemIdentifier(String) method sooner or later.

Autor:
Christian Bauer
  • Felddetails

  • Konstruktordetails

    • UDN

      public UDN(String identifierString)
      Parameter:
      identifierString - The identifier string without the "uuid:" prefix.
    • UDN

      public UDN(UUID uuid)
  • Methodendetails

    • isUDA11Compliant

      public boolean isUDA11Compliant()
    • getIdentifierString

      public String getIdentifierString()
    • valueOf

      public static UDN valueOf(String udnString)
    • uniqueSystemIdentifier

      public static UDN uniqueSystemIdentifier(String salt)
      Generates a global unique identifier that is the same every time this method is invoked on the same machine with the same argument.

      This method combines the first non-loopback network interface's MAC address with given salt to generate a globally unique identifier. In other words, every time you call this method with the same salt on the same machine, you get the same identifier. If you use the same salt on a different machine, a different identifier will be generated.

      Note for Android users: This method does not generate unique identifiers on Android devices and will throw an exception. We can't get details such as the hostname or MAC address on Android. Instead, construct a UDN with new UDN(UUID). When your application is first started, generate all UUIDs needed for your UPnP devices and store them in your Android preferences. Then, use the stored UUID to create a UDN every time your application starts.

      Control points can remember your device's identifier, it will and should be the same every time your device is powered up.

      Parameter:
      salt - An arbitrary string that uniquely identifies the device on the current system, e.g. "MyMediaServer".
      Gibt zurück:
      A global unique identifier, stable for the current system and salt.
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • equals

      public boolean equals(Object o)
      Setzt außer Kraft:
      equals in Klasse Object
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object