Class RelayUri


  • public class RelayUri
    extends java.lang.Object
    Utilities for working with URIs (aka URNs) for Relay devices, groups, and interactions.
    • Constructor Summary

      Constructors 
      Constructor Description
      RelayUri()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String deviceId​(java.lang.String id)
      Creates a URN from a device ID.
      static java.lang.String deviceName​(java.lang.String name)
      Creates a URN from a device name.
      static java.lang.String groupId​(java.lang.String id)
      Creates a URN from a group ID.
      static java.lang.String groupMember​(java.lang.String group, java.lang.String device)
      Creates a URN for a group member.
      static java.lang.String groupName​(java.lang.String name)
      Creates a URN from a group name.
      static java.lang.String interactionName​(java.lang.String name)
      Creates a URN from an interaction name.
      static boolean isInteractionUri​(java.lang.String uri)
      Checks if the URN is for an interaction.
      static boolean isRelayUri​(java.lang.String uri)
      Checks if the URN is a Relay URN.
      static java.lang.String parseDeviceId​(java.lang.String uri)
      Parses out a device ID from a device or interaction URN.
      static java.lang.String parseDeviceName​(java.lang.String uri)
      Parses out a device name from a device or interaction URN.
      static java.lang.String parseGroupId​(java.lang.String uri)
      Parses out a group ID from a group URN.
      static java.lang.String parseGroupName​(java.lang.String uri)
      Parses out a group name from a group URN.
      static java.lang.String parseInteraction​(java.lang.String uri)
      Parses out the name of an interaction from an interaction URN.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RelayUri

        public RelayUri()
    • Method Detail

      • groupId

        public static java.lang.String groupId​(java.lang.String id)
        Creates a URN from a group ID.
        Parameters:
        id - the ID of the group.
        Returns:
        the newly constructed URN.
      • groupName

        public static java.lang.String groupName​(java.lang.String name)
        Creates a URN from a group name.
        Parameters:
        name - the name of the group.
        Returns:
        the newly constructed URN.
      • groupMember

        public static java.lang.String groupMember​(java.lang.String group,
                                                   java.lang.String device)
        Creates a URN for a group member.
        Parameters:
        group - the name of the group that the device belongs to.
        device - the newly constructed URN.
        Returns:
      • deviceId

        public static java.lang.String deviceId​(java.lang.String id)
        Creates a URN from a device ID.
        Parameters:
        id - the ID of the device.
        Returns:
        the newly constructed URN.
      • deviceName

        public static java.lang.String deviceName​(java.lang.String name)
        Creates a URN from a device name.
        Parameters:
        name - the name of the device.
        Returns:
        the newly constructed URN.
      • interactionName

        public static java.lang.String interactionName​(java.lang.String name)
        Creates a URN from an interaction name.
        Parameters:
        name - the name of the interaction.
        Returns:
        the newly constructed URN.
      • parseGroupName

        public static java.lang.String parseGroupName​(java.lang.String uri)
        Parses out a group name from a group URN.
        Parameters:
        uri - the URN that you would like to extract the group name from.
        Returns:
      • parseGroupId

        public static java.lang.String parseGroupId​(java.lang.String uri)
        Parses out a group ID from a group URN.
        Parameters:
        uri - the URN that you would like to extract the group ID from.
        Returns:
        the group ID.
      • parseDeviceName

        public static java.lang.String parseDeviceName​(java.lang.String uri)
        Parses out a device name from a device or interaction URN.
        Parameters:
        uri - the device or interaction URN that you would liek to extract the device name from.
        Returns:
        the device name.
      • parseDeviceId

        public static java.lang.String parseDeviceId​(java.lang.String uri)
        Parses out a device ID from a device or interaction URN.
        Parameters:
        uri - the device or interaction URN that you would like to extract the device ID from.
        Returns:
        the device ID.
      • parseInteraction

        public static java.lang.String parseInteraction​(java.lang.String uri)
        Parses out the name of an interaction from an interaction URN.
        Parameters:
        uri - the interaction URN that you would like to parse the interaction from.
        Returns:
        the name of the interaction.
      • isInteractionUri

        public static boolean isInteractionUri​(java.lang.String uri)
        Checks if the URN is for an interaction.
        Parameters:
        uri - the device, group, or interaction URN.
        Returns:
        true if the URN is a Relay URN, false otherwise.
      • isRelayUri

        public static boolean isRelayUri​(java.lang.String uri)
        Checks if the URN is a Relay URN.
        Parameters:
        uri - the device, group, or interaction URN.
        Returns:
        true if the URN is a Relay URN, false otherwise.