Examples of TaggedComponent


Examples of org.omg.IOP.TaggedComponent

        if (metadata == null) {
            JacORBLogger.ROOT_LOGGER.createSSLTaggedComponentWithNullMetaData();
            return null;
        }

        TaggedComponent tc;
        try {
            int supports = createTargetSupports(metadata.getTransportConfig());
            int requires = createTargetRequires(metadata.getTransportConfig());
            SSL ssl = new SSL((short) supports, (short) requires, (short) sslPort);
            Any any = orb.create_any();
            SSLHelper.insert(any, ssl);
            byte[] componentData = codec.encode_value(any);
            tc = new TaggedComponent(TAG_SSL_SEC_TRANS.value, componentData);
        } catch (InvalidTypeForEncoding e) {
            throw JacORBLogger.ROOT_LOGGER.unexpectedException(e);
        }
        return tc;
    }
View Full Code Here

Examples of org.omg.IOP.TaggedComponent

        if (metadata == null) {
            JacORBLogger.ROOT_LOGGER.createSecurityTaggedComponentWithNullMetaData();
            return null;
        }

        TaggedComponent tc;

        // get the the supported security mechanisms.
        CompoundSecMech[] mechList = createCompoundSecMechanisms(metadata, codec, sslPort, orb);

        // the above is wrapped into a CSIIOP.CompoundSecMechList structure, which is NOT a CompoundSecMech[].
        // we don't support stateful/reusable security contexts (false).
        CompoundSecMechList csmList = new CompoundSecMechList(false, mechList);
        // finally, the CompoundSecMechList must be encoded as a TaggedComponent
        try {
            Any any = orb.create_any();
            CompoundSecMechListHelper.insert(any, csmList);
            byte[] b = codec.encode_value(any);
            tc = new TaggedComponent(TAG_CSI_SEC_MECH_LIST.value, b);
        } catch (InvalidTypeForEncoding e) {
            throw JacORBLogger.ROOT_LOGGER.unexpectedException(e);
        }
        return tc;
    }
View Full Code Here

Examples of org.omg.IOP.TaggedComponent

                                                                int sslPort, ORB orb) {
        // support just 1 security mechanism for now (and ever).
        CompoundSecMech[] csmList = new CompoundSecMech[1];

        // a CompoundSecMech contains: target_requires, transport_mech, as_context_mech, sas_context_mech.
        TaggedComponent transport_mech = createTransportMech(metadata.getTransportConfig(), codec, sslPort, orb);

        // create AS Context.
        AS_ContextSec asContext = createAuthenticationServiceContext(metadata);

        // create SAS Context.
View Full Code Here

Examples of org.omg.IOP.TaggedComponent

     * @param orb     a reference to the running {@code ORB}.
     * @return the constructed {@code TaggedComponent}.
     */
    public static TaggedComponent createTransportMech(IORTransportConfigMetaData tconfig, Codec codec, int sslPort, ORB orb) {

        TaggedComponent tc;

        // what we support and require as a target.
        int support = 0;
        int require = 0;

        if (tconfig != null) {
            require = createTargetRequires(tconfig);
            support = createTargetSupports(tconfig);
        }

        if (tconfig == null || support == 0 || sslPort < 0) {
            // no support for transport security.
            tc = new TaggedComponent(TAG_NULL_TAG.value, new byte[0]);
        } else {
            // my ip address.
            String host = CorbaORBService.getORBProperty(JacORBSubsystemConstants.ORB_ADDRESS);

            // this will create only one transport address.
            TransportAddress[] taList = createTransportAddress(host, sslPort);
            TLS_SEC_TRANS tst = new TLS_SEC_TRANS((short) support, (short) require, taList);

            // The tricky part, we must encode TLS_SEC_TRANS into an octet sequence.
            try {
                Any any = orb.create_any();
                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 JacORBLogger.ROOT_LOGGER.unexpectedException(e);
            }
        }

View Full Code Here

Examples of org.omg.IOP.TaggedComponent

     */
    public static CompoundSecMech getMatchingSecurityMech(ClientRequestInfo ri, Codec codec, short clientSupports,
                                                          short clientRequires) {
        CompoundSecMechList csmList;
        try {
            TaggedComponent tc = ri.get_effective_component(TAG_CSI_SEC_MECH_LIST.value);

            Any any = codec.decode_value(tc.component_data, CompoundSecMechListHelper.type());
            csmList = CompoundSecMechListHelper.extract(any);

            // look for the first matching security mech.
View Full Code Here

Examples of org.omg.IOP.TaggedComponent

                    (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);
View Full Code Here

Examples of org.omg.IOP.TaggedComponent

        }

        boolean interopIONA = "on".equalsIgnoreCase(CorbaORBService.getORBProperty(JacORBSubsystemConstants.INTEROP_IONA));
        if (csiv2Policy != null) {
            // if csiv2Policy effective, stuff a copy of the TaggedComponents already created by the CSIv2Policy into the IOR's IIOP profile.
            TaggedComponent sslComponent = csiv2Policy.getSSLTaggedComponent();
            // if interop with IONA ASP is on, don't add the SSL component to the IOR.
            if (sslComponent != null && !interopIONA) {
                info.add_ior_component_to_profile(sslComponent, TAG_INTERNET_IOP.value);
            }
            TaggedComponent csiv2Component = csiv2Policy.getSecurityTaggedComponent();
            if (csiv2Component != null) {
                info.add_ior_component_to_profile(csiv2Component, TAG_INTERNET_IOP.value);
            }
        } else {
            if (defaultSSLComponent != null && !interopIONA) {
View Full Code Here

Examples of org.omg.IOP.TaggedComponent

        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 JacORBLogger.ROOT_LOGGER.errorEncodingContext(e);
        }
    }
View Full Code Here

Examples of org.omg.IOP.TaggedComponent

    }

    public boolean doesSFSBVersionPolicyExist(ClientRequestInfo ri) {
        boolean result = false;
        try {
            TaggedComponent sfsbVersionTag = ri
                    .get_effective_component(POARemoteReferenceFactory.SFSB_VERSION_POLICY_TYPE);
            result = (sfsbVersionTag != null);
        } catch (BAD_PARAM e) {
            // ignore
        }
View Full Code Here

Examples of org.omg.IOP.TaggedComponent

                AlternateIIOPAddressComponent iiopAddress =
                    new AlternateIIOPAddressComponent(address, intToShort(port));
                Any any = ORB.init().create_any();
                AlternateIIOPAddressComponentHelper.insert(any, iiopAddress);
                byte[] data = codec.encode_value(any);
                TaggedComponent taggedComponent =
                    new TaggedComponent( org.omg.IOP.TAG_ALTERNATE_IIOP_ADDRESS.value,
          //AlternateIIOPAddressComponent.TAG_ALTERNATE_IIOP_ADDRESS_ID,
                            data);
                iorInfo.add_ior_component(taggedComponent);
            }
        } catch (Exception e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.