Class InterOperableNamingImpl

java.lang.Object
com.sun.corba.ee.impl.naming.cosnaming.InterOperableNamingImpl

public class InterOperableNamingImpl extends 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.
  • Constructor Details

    • InterOperableNamingImpl

      public InterOperableNamingImpl()
  • Method Details

    • convertToString

      public 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(String str)
    • contains

      private boolean contains(String str, char ch)
    • convertNameComponentToString

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

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

      public NameComponent[] convertToNameComponent(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 String[] breakStringToNameComponents(String sname)
      Step1 in converting Stringified name into array of Name Component is breaking the String into multiple name components
    • StringComponentsFromIndices

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

      private NameComponent createNameComponentFromString(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 String cleanEscapeCharacter(String theString)
      This method cleans the escapes in the Stringified name and returns the correct String
    • createURLBasedAddress

      public String createURLBasedAddress(String address, 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 String encode(String stringToEncode)
      Encodes the string according to RFC 2396 IETF spec required by INS.