1 7 8 package com.sun.corba.se.impl.protocol.giopmsgheaders; 9 10 import org.omg.CORBA.Principal ; 11 import com.sun.corba.se.spi.servicecontext.ServiceContexts; 12 import com.sun.corba.se.spi.ior.iiop.GIOPVersion; 13 import com.sun.corba.se.spi.orb.ORB; 14 import com.sun.corba.se.spi.ior.ObjectKey; 15 16 import com.sun.corba.se.spi.logging.CORBALogDomains ; 17 import com.sun.corba.se.impl.logging.ORBUtilSystemException ; 18 19 25 26 public final class RequestMessage_1_1 extends Message_1_1 27 implements RequestMessage { 28 29 31 private ORB orb = null; 32 private ORBUtilSystemException wrapper = null ; 33 private ServiceContexts service_contexts = null; 34 private int request_id = (int) 0; 35 private boolean response_expected = false; 36 private byte[] reserved = null; private byte[] object_key = null; 38 private String operation = null; 39 private Principal requesting_principal = null; 40 private ObjectKey objectKey = null; 41 42 44 RequestMessage_1_1(ORB orb) { 45 this.orb = orb; 46 this.wrapper = ORBUtilSystemException.get( orb, 47 CORBALogDomains.RPC_PROTOCOL ) ; 48 } 49 50 RequestMessage_1_1(ORB orb, ServiceContexts _service_contexts, 51 int _request_id, boolean _response_expected, byte[] _reserved, 52 byte[] _object_key, String _operation, 53 Principal _requesting_principal) { 54 super(Message.GIOPBigMagic, GIOPVersion.V1_1, FLAG_NO_FRAG_BIG_ENDIAN, 55 Message.GIOPRequest, 0); 56 this.orb = orb; 57 this.wrapper = ORBUtilSystemException.get( orb, 58 CORBALogDomains.RPC_PROTOCOL ) ; 59 service_contexts = _service_contexts; 60 request_id = _request_id; 61 response_expected = _response_expected; 62 reserved = _reserved; 63 object_key = _object_key; 64 operation = _operation; 65 requesting_principal = _requesting_principal; 66 } 67 68 70 public ServiceContexts getServiceContexts() { 71 return this.service_contexts; 72 } 73 74 public int getRequestId() { 75 return this.request_id; 76 } 77 78 public boolean isResponseExpected() { 79 return this.response_expected; 80 } 81 82 public byte[] getReserved() { 83 return this.reserved; 84 } 85 86 public ObjectKey getObjectKey() { 87 if (this.objectKey == null) { 88 this.objectKey = MessageBase.extractObjectKey(object_key, orb); 90 } 91 92 return this.objectKey; 93 } 94 95 public String getOperation() { 96 return this.operation; 97 } 98 99 public Principal getPrincipal() { 100 return this.requesting_principal; 101 } 102 103 105 public void read(org.omg.CORBA.portable.InputStream istream) { 106 super.read(istream); 107 this.service_contexts 108 = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream ) istream); 109 this.request_id = istream.read_ulong(); 110 this.response_expected = istream.read_boolean(); 111 this.reserved = new byte[3]; 112 for (int _o0 = 0;_o0 < (3); ++_o0) { 113 this.reserved[_o0] = istream.read_octet(); 114 } 115 int _len1 = istream.read_long(); 116 this.object_key = new byte[_len1]; 117 istream.read_octet_array(this.object_key, 0, _len1); 118 this.operation = istream.read_string(); 119 this.requesting_principal = istream.read_Principal(); 120 } 121 122 public void write(org.omg.CORBA.portable.OutputStream ostream) { 123 super.write(ostream); 124 if (this.service_contexts != null) { 125 service_contexts.write( 126 (org.omg.CORBA_2_3.portable.OutputStream ) ostream, 127 GIOPVersion.V1_1); 128 } else { 129 ServiceContexts.writeNullServiceContext( 130 (org.omg.CORBA_2_3.portable.OutputStream ) ostream); 131 } 132 ostream.write_ulong(this.request_id); 133 ostream.write_boolean(this.response_expected); 134 nullCheck(this.reserved); 135 if (this.reserved.length != (3)) { 136 throw wrapper.badReservedLength( 137 org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); 138 } 139 for (int _i0 = 0;_i0 < (3); ++_i0) { 140 ostream.write_octet(this.reserved[_i0]); 141 } 142 nullCheck(this.object_key); 143 ostream.write_long(this.object_key.length); 144 ostream.write_octet_array(this.object_key, 0, this.object_key.length); 145 ostream.write_string(this.operation); 146 if (this.requesting_principal != null) { 147 ostream.write_Principal(this.requesting_principal); 148 } else { 149 ostream.write_long(0); 150 } 151 } 152 153 public void callback(MessageHandler handler) 154 throws java.io.IOException 155 { 156 handler.handleInput(this); 157 } 158 } | Popular Tags |