IIOPEndpointInfo.java revision 672:2bb058ce572e
1181834Sroberto/* 2181834Sroberto * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. 3181834Sroberto * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4200576Sroberto * 5181834Sroberto * This code is free software; you can redistribute it and/or modify it 6181834Sroberto * under the terms of the GNU General Public License version 2 only, as 7181834Sroberto * published by the Free Software Foundation. Oracle designates this 8181834Sroberto * particular file as subject to the "Classpath" exception as provided 9181834Sroberto * by Oracle in the LICENSE file that accompanied this code. 10181834Sroberto * 11181834Sroberto * This code is distributed in the hope that it will be useful, but WITHOUT 12181834Sroberto * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13181834Sroberto * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14181834Sroberto * version 2 for more details (a copy is included in the LICENSE file that 15181834Sroberto * accompanied this code). 16181834Sroberto * 17181834Sroberto * You should have received a copy of the GNU General Public License version 18181834Sroberto * 2 along with this work; if not, write to the Free Software Foundation, 19181834Sroberto * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20181834Sroberto * 21181834Sroberto * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22200576Sroberto * or visit www.oracle.com if you need additional information or have any 23181834Sroberto * questions. 24181834Sroberto */ 25181834Sroberto 26181834Srobertopackage com.sun.corba.se.impl.naming.namingutil; 27181834Sroberto 28181834Srobertoimport com.sun.corba.se.impl.orbutil.ORBConstants; 29181834Sroberto 30181834Sroberto/** 31181834Sroberto * EndpointInfo is used internally by CorbaLoc object to store the 32181834Sroberto * host information used in creating the Service Object reference 33181834Sroberto * from the -ORBInitDef and -ORBDefaultInitDef definitions. 34181834Sroberto * 35181834Sroberto * @author Hemanth 36181834Sroberto */ 37200576Srobertopublic class IIOPEndpointInfo 38181834Sroberto{ 39181834Sroberto // Version information 40181834Sroberto private int major, minor; 41181834Sroberto 42181834Sroberto // Host Name and Port Number 43181834Sroberto private String host; 44181834Sroberto private int port; 45181834Sroberto 46181834Sroberto IIOPEndpointInfo( ) { 47181834Sroberto // Default IIOP Version 48181834Sroberto major = ORBConstants.DEFAULT_INS_GIOP_MAJOR_VERSION; 49181834Sroberto minor = ORBConstants.DEFAULT_INS_GIOP_MINOR_VERSION; 50181834Sroberto // Default host is localhost 51181834Sroberto host = ORBConstants.DEFAULT_INS_HOST; 52181834Sroberto // Default INS Port 53181834Sroberto port = ORBConstants.DEFAULT_INS_PORT; 54181834Sroberto } 55181834Sroberto 56181834Sroberto public void setHost( String theHost ) { 57181834Sroberto host = theHost; 58181834Sroberto } 59181834Sroberto 60181834Sroberto public String getHost( ) { 61181834Sroberto return host; 62181834Sroberto } 63181834Sroberto 64181834Sroberto public void setPort( int thePort ) { 65181834Sroberto port = thePort; 66181834Sroberto } 67181834Sroberto 68181834Sroberto public int getPort( ) { 69181834Sroberto return port; 70181834Sroberto } 71181834Sroberto 72181834Sroberto public void setVersion( int theMajor, int theMinor ) { 73181834Sroberto major = theMajor; 74181834Sroberto minor = theMinor; 75181834Sroberto } 76181834Sroberto 77181834Sroberto public int getMajor( ) { 78181834Sroberto return major; 79181834Sroberto } 80181834Sroberto 81181834Sroberto public int getMinor( ) { 82181834Sroberto return minor; 83181834Sroberto } 84181834Sroberto 85181834Sroberto /** Internal Debug Method. 86181834Sroberto */ 87181834Sroberto public void dump( ) { 88181834Sroberto System.out.println( " Major -> " + major + " Minor -> " + minor ); 89181834Sroberto System.out.println( "host -> " + host ); 90181834Sroberto System.out.println( "port -> " + port ); 91181834Sroberto } 92181834Sroberto} 93181834Sroberto