FileDocCategorySizeDatePackage
CorbanameURL.javaAPI DocJava SE 5 API3509Fri Aug 26 14:54:26 BST 2005com.sun.corba.se.impl.naming.namingutil

CorbanameURL

public class CorbanameURL extends INSURLBase
The corbaname: URL definitions from the -ORBInitDef and -ORBDefaultInitDef's will be stored in this object. This object is capable of storing CorbaLoc profiles as defined in the CorbaName grammer.
Author
Hemanth

Fields Summary
private static com.sun.corba.se.impl.logging.NamingSystemException
wrapper
Constructors Summary
public CorbanameURL(String aURL)
This constructor takes a corbaname: url with 'corbaname:' prefix stripped and initializes all the variables accordingly. If there are any parsing errors then BAD_PARAM exception is raised.


                                    
         
        String url = aURL;
  
        // First Clean the URL Escapes if there are any
        try {
            url = Utility.cleanEscapes( url );
        } catch( Exception e ) {
            badAddress( e );
        }

        int delimiterIndex = url.indexOf( '#" );
        String corbalocString = null;
        if( delimiterIndex != -1 ) {
                // Append corbaloc: for Grammar check, Get the string between
                // corbaname: and # which forms the corbaloc string
                corbalocString = "corbaloc:" +
                    url.substring( 0, delimiterIndex ) + "/";
        } else {
            // Build a corbaloc string to check the grammar.
            // 10 is the length of corbaname:
            corbalocString = "corbaloc:" + url.substring( 0, url.length() );
            // If the string doesnot end with a / then add one to end the
            // URL correctly
            if( corbalocString.endsWith( "/" ) != true ) {
                corbalocString = corbalocString + "/";
            }
        }
        try {
            // Check the corbaloc grammar and set the returned corbaloc
            // object to the CorbaName Object
            INSURL insURL = 
                INSURLHandler.getINSURLHandler().parseURL( corbalocString );
            copyINSURL( insURL );
            // String after '#' is the Stringified name used to resolve
            // the Object reference from the rootnaming context. If
            // the String is null then the Root Naming context is passed
            // back
            if((delimiterIndex > -1) &&
	       (delimiterIndex < (aURL.length() - 1)))
            {
		int start = delimiterIndex + 1 ;
		String result = url.substring(start) ;
		theStringifiedName = result ;
            } 
        } catch( Exception e ) {
            badAddress( e );
        }
    
Methods Summary
private voidbadAddress(java.lang.Throwable e)
A Utility method to throw BAD_PARAM exception.

	throw wrapper.insBadAddress( e ) ;
    
private voidcopyINSURL(INSURL url)
A Utility method to copy all the variables from CorbalocURL object to this instance.

        rirFlag = url.getRIRFlag( );
        theEndpointInfo = (java.util.ArrayList) url.getEndpointInfo( );
        theKeyString = url.getKeyString( );
        theStringifiedName = url.getStringifiedName( );
    
public booleanisCorbanameURL()

        return true;