1. /*
  2. * @(#)OldPOAObjectKeyTemplate.java 1.7 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. // @(#)OldPOAObjectKeyTemplate.java 1.7 03/01/23
  8. package com.sun.corba.se.internal.ior;
  9. import com.sun.corba.se.internal.core.ORBVersion ;
  10. import com.sun.corba.se.internal.core.ORBVersionImpl ;
  11. import com.sun.corba.se.internal.ior.ObjectId ;
  12. import com.sun.corba.se.internal.ior.ObjectKeyFactory ;
  13. import org.omg.CORBA_2_3.portable.InputStream ;
  14. import org.omg.CORBA_2_3.portable.OutputStream ;
  15. import org.omg.CORBA.ORB ;
  16. import org.omg.CORBA.INTERNAL ;
  17. import org.omg.CORBA.OctetSeqHolder ;
  18. /**
  19. * @author
  20. */
  21. public final class OldPOAObjectKeyTemplate extends OldObjectKeyTemplateBase
  22. {
  23. private int orbid ;
  24. private int poaid ;
  25. public boolean equals( Object obj )
  26. {
  27. if (!super.equals( obj ))
  28. return false ;
  29. if (!(obj instanceof POAObjectKeyTemplate))
  30. return false ;
  31. OldPOAObjectKeyTemplate other = (OldPOAObjectKeyTemplate)obj ;
  32. return (orbid == other.orbid) && (poaid == other.poaid) ;
  33. }
  34. public OldPOAObjectKeyTemplate( int magic, int scid, InputStream is,
  35. OctetSeqHolder osh )
  36. {
  37. super( magic, scid, is.read_long() ) ;
  38. orbid = is.read_long() ;
  39. poaid = is.read_long() ;
  40. osh.value = readObjectKey( is ) ;
  41. }
  42. /**
  43. * @param scid
  44. * @param serverid
  45. * @param orbid
  46. * @param poaid
  47. * @return
  48. * @exception
  49. * @author
  50. * @roseuid 3915F507004D
  51. */
  52. public OldPOAObjectKeyTemplate( int magic, int scid, int serverid,
  53. int orbid, int poaid)
  54. {
  55. super( magic, scid, serverid ) ;
  56. this.orbid = orbid ;
  57. this.poaid = poaid ;
  58. }
  59. /**
  60. * @param objectId
  61. * @param os
  62. * @return void
  63. * @exception
  64. * @author
  65. * @roseuid 3915FFEA00EB
  66. */
  67. public void write(OutputStream os)
  68. {
  69. os.write_long( getMagic() ) ;
  70. os.write_long( getSubcontractId() ) ;
  71. os.write_long( getServerId() ) ;
  72. os.write_long( orbid ) ;
  73. os.write_long( poaid ) ;
  74. }
  75. public int getORBId()
  76. {
  77. return orbid ;
  78. }
  79. public int getPOAId()
  80. {
  81. return poaid ;
  82. }
  83. public ORBVersion getORBVersion()
  84. {
  85. if (getMagic() == ObjectKeyTemplate.JAVAMAGIC_OLD)
  86. return ORBVersionImpl.OLD ;
  87. else if (getMagic() == ObjectKeyTemplate.JAVAMAGIC_NEW)
  88. return ORBVersionImpl.NEW ;
  89. else
  90. throw new INTERNAL() ;
  91. }
  92. }