/** * <p> * Make a deep copy of an {@code IOP:TaggedComponent}. * </p> * * @param tc the {@code TaggedComponent} to be copied. * @return a reference to the created copy. */ public static TaggedComponent createCopy(TaggedComponent tc) { TaggedComponent copy = null; if (tc != null) { byte[] buf = new byte[tc.component_data.length]; System.arraycopy(tc.component_data, 0, buf, 0, tc.component_data.length); copy = new TaggedComponent(tc.tag, buf); } return copy; }
public void establish_components(IORInfo info) { try { // Invocation Policy = EITHER Any any = ORB.init().create_any(); any.insert_short(EITHER); byte[] taggedComponentData = codec.encode_value(any); info.add_ior_component(new TaggedComponent(TAG_INV_POLICY, taggedComponentData)); // OTS Policy = ADAPTS any = ORB.init().create_any(); any.insert_short(ADAPTS); taggedComponentData = codec.encode_value(any); info.add_ior_component(new TaggedComponent(TAG_OTS_POLICY, taggedComponentData)); } catch (InvalidTypeForEncoding e) { throw IIOPLogger.ROOT_LOGGER.errorEncodingContext(e); } } }
tc = new TaggedComponent(TAG_NULL_TAG.value, new byte[0]); } else { TLS_SEC_TRANSHelper.insert(any, tst); byte[] b = codec.encode_value(any); tc = new TaggedComponent(TAG_TLS_SEC_TRANS.value, b); } catch (InvalidTypeForEncoding e) { throw IIOPLogger.ROOT_LOGGER.unexpectedException(e);
/** * <p> * Creates an instance of {@code CSIv2IORInterceptor} with the specified codec. * </p> * * @param codec the {@code Codec} used to encode the IOR security components. */ public CSIv2IORInterceptor(Codec codec) { String sslPortString = CorbaORBService.getORBProperty(Constants.ORB_SSL_PORT); int sslPort = sslPortString == null ? 0 : Integer.parseInt(sslPortString); try { SSL ssl = new SSL((short) MIN_SSL_OPTIONS, (short) 0, /* required options */ (short) sslPort); ORB orb = ORB.init(); Any any = orb.create_any(); SSLHelper.insert(any, ssl); byte[] componentData = codec.encode_value(any); defaultSSLComponent = new TaggedComponent(TAG_SSL_SEC_TRANS.value, componentData); IORSecurityConfigMetaData iorSecurityConfigMetaData = IORSecConfigMetaDataService.getCurrent(); if (iorSecurityConfigMetaData == null) iorSecurityConfigMetaData = new IORSecurityConfigMetaData(); defaultCSIComponent = CSIv2Util.createSecurityTaggedComponent(iorSecurityConfigMetaData, codec, sslPort, orb); } catch (InvalidTypeForEncoding e) { throw IIOPLogger.ROOT_LOGGER.unexpectedException(e); } }
CompoundSecMechListHelper.insert(any, csmList); byte[] b = codec.encode_value(any); tc = new TaggedComponent(TAG_CSI_SEC_MECH_LIST.value, b); } catch (InvalidTypeForEncoding e) { throw IIOPLogger.ROOT_LOGGER.unexpectedException(e);
SSLHelper.insert(any, ssl); byte[] componentData = codec.encode_value(any); tc = new TaggedComponent(TAG_SSL_SEC_TRANS.value, componentData); } catch (InvalidTypeForEncoding e) { throw IIOPLogger.ROOT_LOGGER.unexpectedException(e);
/** * <p> * Make a deep copy of an {@code IOP:TaggedComponent}. * </p> * * @param tc the {@code TaggedComponent} to be copied. * @return a reference to the created copy. */ public static TaggedComponent createCopy(TaggedComponent tc) { TaggedComponent copy = null; if (tc != null) { byte[] buf = new byte[tc.component_data.length]; System.arraycopy(tc.component_data, 0, buf, 0, tc.component_data.length); copy = new TaggedComponent(tc.tag, buf); } return copy; }
/** * <p> * Make a deep copy of an {@code IOP:TaggedComponent}. * </p> * * @param tc the {@code TaggedComponent} to be copied. * @return a reference to the created copy. */ public static TaggedComponent createCopy(TaggedComponent tc) { TaggedComponent copy = null; if (tc != null) { byte[] buf = new byte[tc.component_data.length]; System.arraycopy(tc.component_data, 0, buf, 0, tc.component_data.length); copy = new TaggedComponent(tc.tag, buf); } return copy; }
public Object clone() throws CloneNotSupportedException { TaggedComponentList result = (TaggedComponentList)super.clone(); result.components = new TaggedComponent[this.components.length]; for (int i=0; i<this.components.length; i++) { result.components[i] = new TaggedComponent ( this.components[i].tag, new byte [this.components[i].component_data.length] ); System.arraycopy (this.components[i].component_data, 0, result.components[i].component_data, 0, this.components[i].component_data.length); } return result; }
/** * Adds a tagged component to this list. */ public void addComponent (int tag, byte[] data) { addComponent (new TaggedComponent (tag, data)); }
/** * @return org.omg.IOP.TaggedComponent * @exception * @author */ public org.omg.IOP.TaggedComponent getIOPComponent( ORB orb ) { return new org.omg.IOP.TaggedComponent( getId(), getData() ) ; } }
public static org.omg.IOP.TaggedComponent read (org.omg.CORBA.portable.InputStream istream) { org.omg.IOP.TaggedComponent value = new org.omg.IOP.TaggedComponent (); value.tag = istream.read_ulong (); value.component_data = org.omg.CORBA.OctetSeqHelper.read (istream); return value; }
public static org.omg.IOP.TaggedComponent read (final org.omg.CORBA.portable.InputStream in) { org.omg.IOP.TaggedComponent result = new org.omg.IOP.TaggedComponent(); result.tag=in.read_ulong(); result.component_data = org.omg.CORBA.OctetSeqHelper.read(in); return result; } public static void write (final org.omg.CORBA.portable.OutputStream out, final org.omg.IOP.TaggedComponent s)
public static org.omg.IOP.TaggedComponent read (final org.omg.CORBA.portable.InputStream in) { org.omg.IOP.TaggedComponent result = new org.omg.IOP.TaggedComponent(); result.tag=in.read_ulong(); result.component_data = org.omg.CORBA.OctetSeqHelper.read(in); return result; } public static void write (final org.omg.CORBA.portable.OutputStream out, final org.omg.IOP.TaggedComponent s)
public org.omg.IOP.TaggedComponent get_effective_component(int id) { for (int i = 0; i < profileInfo_.components.length; i++) if (profileInfo_.components[i].tag == id) { org.omg.IOP.TaggedComponent result = new org.omg.IOP.TaggedComponent(); result.tag = profileInfo_.components[i].tag; result.component_data = new byte[profileInfo_.components[i].component_data.length]; System.arraycopy(profileInfo_.components[i].component_data, 0, result.component_data, 0, profileInfo_.components[i].component_data.length); return result; } throw new org.omg.CORBA.BAD_PARAM( org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidComponentId) + ": " + id, org.apache.yoko.orb.OB.MinorCodes.MinorInvalidComponentId, org.omg.CORBA.CompletionStatus.COMPLETED_NO); }
public static TaggedComponent read(org.omg.CORBA.portable.InputStream in) { TaggedComponent _ob_v = new TaggedComponent(); _ob_v.tag = ComponentIdHelper.read(in); int len0 = in.read_ulong(); _ob_v.component_data = new byte[len0]; in.read_octet_array(_ob_v.component_data, 0, len0); return _ob_v; }
/** * @see org.omg.PortableInterceptor.IORInterceptorOperations#establish_components(IORInfo) */ public void establish_components(IORInfo info) { String codeBase = (String) currentCodeBase.get(); if (codeBase != null) { logger.finer("registering " + codeBase + " for ORB"); // // Create encapsulation // Any any = ORB.init().create_any(); any.insert_string(codeBase); try { byte[] data = codec.encode(any); TaggedComponent component = new TaggedComponent( TAG_JAVA_CODEBASE.value, data); info.add_ior_component(component); } catch (InvalidTypeForEncoding e) { logger.log(Level.WARNING, "Failed to add java codebase to IOR" + e.getMessage(), e); } } }
private org.omg.IOP.TaggedComponent createCompoundSecMechListComponent( CompoundSecMech[] mechList) { CDROutputObject out = (CDROutputObject) orb.create_output_stream(); out.putEndian(); boolean stateful = false; CompoundSecMechList list = new CompoundSecMechList( stateful, mechList); CompoundSecMechListHelper.write(out, list); byte[] buf = out.toByteArray(); org.omg.IOP.TaggedComponent tc = new org.omg.IOP.TaggedComponent( TAG_CSI_SEC_MECH_LIST.value, buf ) ; return tc; }
private org.omg.IOP.TaggedComponent createTlsSecTransComponent( int targetSupports, int targetRequires, TransportAddress[] listTa ) { TLS_SEC_TRANS tls_sec = new TLS_SEC_TRANS( (short)targetSupports, (short)targetRequires, listTa); CDROutputObject out = (CDROutputObject) orb.create_output_stream(); out.putEndian() ; TLS_SEC_TRANSHelper.write((org.omg.CORBA.portable.OutputStream)out, tls_sec); byte[] buf = out.toByteArray() ; // create new Tagged Component for SSL org.omg.IOP.TaggedComponent tc = new org.omg.IOP.TaggedComponent( TAG_TLS_SEC_TRANS.value, buf ) ; return tc; }
public void establish_components(IORInfo info) { try { // Invocation Policy = EITHER Any any = ORB.init().create_any(); any.insert_short(EITHER); byte[] taggedComponentData = codec.encode_value(any); info.add_ior_component(new TaggedComponent(TAG_INV_POLICY, taggedComponentData)); // OTS Policy = ADAPTS any = ORB.init().create_any(); any.insert_short(ADAPTS); taggedComponentData = codec.encode_value(any); info.add_ior_component(new TaggedComponent(TAG_OTS_POLICY, taggedComponentData)); } catch (InvalidTypeForEncoding e) { throw IIOPLogger.ROOT_LOGGER.errorEncodingContext(e); } } }