Class RegInfo

  • All Implemented Interfaces:
    java.util.Map

    public class RegInfo
    extends SampMap
    Represents information provided to a client at registration by the hub.
    Since:
    14 Jul 2008
    Author:
    Mark Taylor
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String HUBID_KEY
      Key for client public-id used by hub when sending messages itself.
      private static java.lang.String[] KNOWN_KEYS  
      static java.lang.String PRIVATEKEY_KEY
      Key for private-key token used for communications between hub and registering client (Standard Profile).
      static java.lang.String SELFID_KEY
      Key for client public-id owned by the registering application.
    • Constructor Summary

      Constructors 
      Constructor Description
      RegInfo()
      Constructs an empty RegInfo.
      RegInfo​(java.util.Map map)
      Constructs a RegInfo based on an existing map.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static RegInfo asRegInfo​(java.util.Map map)
      Returns a given map as a RegInfo.
      void check()
      Checks that this object is ready for use with the SAMP toolkit.
      java.lang.String getHubId()
      Returns the hub's own public client id.
      java.lang.String getPrivateKey()
      Returns the registered client's private key (Standard Profile).
      java.lang.String getSelfId()
      Returns the registered client's public client id.
      • Methods inherited from class java.util.AbstractMap

        clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, putAll, remove, size, toString, values
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Field Detail

      • HUBID_KEY

        public static final java.lang.String HUBID_KEY
        Key for client public-id used by hub when sending messages itself.
        See Also:
        Constant Field Values
      • SELFID_KEY

        public static final java.lang.String SELFID_KEY
        Key for client public-id owned by the registering application.
        See Also:
        Constant Field Values
      • PRIVATEKEY_KEY

        public static final java.lang.String PRIVATEKEY_KEY
        Key for private-key token used for communications between hub and registering client (Standard Profile).
        See Also:
        Constant Field Values
      • KNOWN_KEYS

        private static final java.lang.String[] KNOWN_KEYS
    • Constructor Detail

      • RegInfo

        public RegInfo()
        Constructs an empty RegInfo.
      • RegInfo

        public RegInfo​(java.util.Map map)
        Constructs a RegInfo based on an existing map.
        Parameters:
        map - map containing initial data for this object
    • Method Detail

      • getHubId

        public java.lang.String getHubId()
        Returns the hub's own public client id.
        Returns:
        HUBID_KEY value
      • getSelfId

        public java.lang.String getSelfId()
        Returns the registered client's public client id.
        Returns:
        SELFID_KEY value
      • getPrivateKey

        public java.lang.String getPrivateKey()
        Returns the registered client's private key (Standard Profile).
        Returns:
        PRIVATEKEY_KEY value
      • check

        public void check()
        Description copied from class: SampMap
        Checks that this object is ready for use with the SAMP toolkit. As well as calling SampUtils.checkMap(java.util.Map) (ensuring that all keys are Strings, and all values Strings, Lists or Maps), subclass-specific invariants may be checked. In the case that there's something wrong, an informative DataException will be thrown.
        Overrides:
        check in class SampMap
      • asRegInfo

        public static RegInfo asRegInfo​(java.util.Map map)
        Returns a given map as a RegInfo.
        Parameters:
        map - map
        Returns:
        registration info