Class InterOperableNamingImpl


  • public class InterOperableNamingImpl
    extends java.lang.Object
    Class InteroperableNamingImpl implements the methods defined for NamingContextExt which is part of Interoperable Naming Service specifications. This class is added for doing more of Parsing and Building of Stringified names according to INS Spec.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.lang.String addEscape​(java.lang.String value)
      This method adds escape '\' for the Namecomponent if neccessary
      private java.lang.String[] breakStringToNameComponents​(java.lang.String sname)
      Step1 in converting Stringified name into array of Name Component is breaking the String into multiple name components
      private java.lang.String cleanEscapeCharacter​(java.lang.String theString)
      This method cleans the escapes in the Stringified name and returns the correct String
      private boolean contains​(java.lang.String str, char ch)  
      private java.lang.String convertNameComponentToString​(NameComponent theNameComponent)
      This method converts a single Namecomponent to String, By adding Escapes If neccessary.
      NameComponent[] convertToNameComponent​(java.lang.String theStringifiedName)
      Method which converts the Stringified name into Array of Name Components.
      java.lang.String convertToString​(NameComponent[] theNameComponents)
      Method which stringifies the Name Components given as the input parameter.
      private NameComponent createNameComponentFromString​(java.lang.String theStringifiedNameComponent)
      Step 2: After Breaking the Stringified name into set of NameComponent Strings, The next step is to create Namecomponents from the substring by removing the escapes if there are any.
      java.lang.String createURLBasedAddress​(java.lang.String address, java.lang.String name)
      Method which converts the Stringified name and Host Name Address into a URL based Name
      private java.lang.String encode​(java.lang.String stringToEncode)
      Encodes the string according to RFC 2396 IETF spec required by INS.
      private boolean isEmpty​(java.lang.String str)  
      private java.lang.String[] StringComponentsFromIndices​(int[] theIndices, int indicesCount, java.lang.String theStringifiedName)
      This method breaks one big String into multiple substrings based on the array of index passed in.
      • Methods inherited from class java.lang.Object

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

      • InterOperableNamingImpl

        public InterOperableNamingImpl()
    • Method Detail

      • convertToString

        public java.lang.String convertToString​(NameComponent[] theNameComponents)
        Method which stringifies the Name Components given as the input parameter.
        Parameters:
        theNameComponents - Array of Name Components (Simple or Compound Names)
        Returns:
        string which is the stringified reference.
      • isEmpty

        private boolean isEmpty​(java.lang.String str)
      • contains

        private boolean contains​(java.lang.String str,
                                 char ch)
      • convertNameComponentToString

        private java.lang.String convertNameComponentToString​(NameComponent theNameComponent)
        This method converts a single Namecomponent to String, By adding Escapes If neccessary.
      • addEscape

        private java.lang.String addEscape​(java.lang.String value)
        This method adds escape '\' for the Namecomponent if neccessary
      • convertToNameComponent

        public NameComponent[] convertToNameComponent​(java.lang.String theStringifiedName)
                                               throws InvalidName
        Method which converts the Stringified name into Array of Name Components.
        Parameters:
        theStringifiedName - which is the stringified name.
        Returns:
        Array of Name Components (Simple or Compound Names)
        Throws:
        InvalidName - if the stringified name is invalid
      • breakStringToNameComponents

        private java.lang.String[] breakStringToNameComponents​(java.lang.String sname)
        Step1 in converting Stringified name into array of Name Component is breaking the String into multiple name components
      • StringComponentsFromIndices

        private java.lang.String[] StringComponentsFromIndices​(int[] theIndices,
                                                               int indicesCount,
                                                               java.lang.String theStringifiedName)
        This method breaks one big String into multiple substrings based on the array of index passed in.
      • createNameComponentFromString

        private NameComponent createNameComponentFromString​(java.lang.String theStringifiedNameComponent)
                                                     throws InvalidName
        Step 2: After Breaking the Stringified name into set of NameComponent Strings, The next step is to create Namecomponents from the substring by removing the escapes if there are any.
        Throws:
        InvalidName
      • cleanEscapeCharacter

        private java.lang.String cleanEscapeCharacter​(java.lang.String theString)
        This method cleans the escapes in the Stringified name and returns the correct String
      • createURLBasedAddress

        public java.lang.String createURLBasedAddress​(java.lang.String address,
                                                      java.lang.String name)
                                               throws InvalidAddress
        Method which converts the Stringified name and Host Name Address into a URL based Name
        Parameters:
        address - which is ip based host name
        name - which is the stringified name.
        Returns:
        url based Name.
        Throws:
        InvalidAddress - if the address is invalid
      • encode

        private java.lang.String encode​(java.lang.String stringToEncode)
        Encodes the string according to RFC 2396 IETF spec required by INS.