View Javadoc
1   /*
2    * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
3    * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4    *
5    * This code is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU General Public License version 2 only, as
7    * published by the Free Software Foundation.  Oracle designates this
8    * particular file as subject to the "Classpath" exception as provided
9    * by Oracle in the LICENSE file that accompanied this code.
10   *
11   * This code is distributed in the hope that it will be useful, but WITHOUT
12   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14   * version 2 for more details (a copy is included in the LICENSE file that
15   * accompanied this code).
16   *
17   * You should have received a copy of the GNU General Public License version
18   * 2 along with this work; if not, write to the Free Software Foundation,
19   * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20   *
21   * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22   * or visit www.oracle.com if you need additional information or have any
23   * questions.
24   */
25  
26  package com.sun.corba.se.impl.naming.namingutil;
27  
28  /** The corbaloc: URL definitions from the -ORBInitDef and -ORBDefaultInitDef's
29   *  will be stored in this object. This object is capable of storing multiple
30   *  Host profiles as defined in the CorbaLoc grammer.
31   *
32   *  @author  Hemanth
33   */
34  public abstract class INSURLBase implements INSURL {
35  
36      // If rirFlag is set to true that means internal
37      // boot strapping technique will be used. If set to
38      // false then the EndpointInfo will be used to create the
39      // Service Object reference.
40      protected boolean rirFlag = false ;
41      protected java.util.ArrayList theEndpointInfo = null ;
42      protected String theKeyString = "NameService" ;
43      protected String theStringifiedName = null ;
44  
45      public boolean getRIRFlag( ) {
46          return rirFlag;
47      }
48  
49      public java.util.List getEndpointInfo( ) {
50          return theEndpointInfo;
51      }
52  
53      public String getKeyString( ) {
54          return theKeyString;
55      }
56  
57      public String getStringifiedName( ) {
58          return theStringifiedName;
59      }
60  
61      public abstract boolean isCorbanameURL( );
62  
63      public void dPrint( ) {
64          System.out.println( "URL Dump..." );
65          System.out.println( "Key String = " + getKeyString( ) );
66          System.out.println( "RIR Flag = " + getRIRFlag( ) );
67          System.out.println( "isCorbanameURL = " + isCorbanameURL() );
68          for( int i = 0; i < theEndpointInfo.size( ); i++ ) {
69              ((IIOPEndpointInfo) theEndpointInfo.get( i )).dump( );
70          }
71          if( isCorbanameURL( ) ) {
72              System.out.println( "Stringified Name = " + getStringifiedName() );
73          }
74      }
75  
76  }