Package org.omg.CORBA

Examples of org.omg.CORBA.Any


    @Override
    public void receive_reply(ClientRequestInfo ri) {
        try {
            ServiceContext sc = ri.get_reply_service_context(sasContextId);
            Any msg = codec.decode_value(sc.context_data, SASContextBodyHelper.type());
            SASContextBody contextBody = SASContextBodyHelper.extract(msg);

            // At this point contextBody should contain a CompleteEstablishContext message, which does not require any
            // treatment. ContextError messages should arrive via receive_exception().
            JacORBLogger.ROOT_LOGGER.traceReceiveReply(contextBody.discriminator());
View Full Code Here


    @Override
    public void receive_exception(ClientRequestInfo ri) {
        try {
            ServiceContext sc = ri.get_reply_service_context(sasContextId);
            Any msg = codec.decode_value(sc.context_data, SASContextBodyHelper.type());
            SASContextBody contextBody = SASContextBodyHelper.extract(msg);

            // At this point contextBody may contain a either a CompleteEstablishContext message or a ContextError message.
            // Neither message requires any treatment. We decoded the context body just to check that it contains
            // a well-formed message.
View Full Code Here

        ConstantDescription d =
                new ConstantDescription(name, id, defined_in_id, version,
                        typeCode, value);

        Any any = getORB().create_any();

        ConstantDescriptionHelper.insert(any, d);

        return new Description(DefinitionKind.dk_Constant, any);
    }
View Full Code Here

        AttributeDescription d =
                new AttributeDescription(name, id, defined_in_id, version,
                        typeCode, mode);

        Any any = getORB().create_any();

        AttributeDescriptionHelper.insert(any, d);

        return new Description(DefinitionKind.dk_Attribute, any);
    }
View Full Code Here

        org.omg.CORBA.InterfaceDescription md =
                new InterfaceDescription(name, id, defined_in_id, version,
                        base_interfaces, false);

        Any any = getORB().create_any();

        InterfaceDescriptionHelper.insert(any, md);

        return new Description(DefinitionKind.dk_Interface, any);
    }
View Full Code Here

            // Create security policies if security metadata has been provided.
            List<Policy> policyList = new ArrayList<Policy>();
            if (iorSecurityConfigMetaData != null) {

                // Create csiv2Policy for both home and remote containing IorSecurityConfigMetadata.
                final Any secPolicy = orb.create_any();
                secPolicy.insert_Value(iorSecurityConfigMetaData);
                Policy csiv2Policy = orb.create_policy(CSIv2Policy.TYPE, secPolicy);
                policyList.add(csiv2Policy);

                // Create SSLPolicy (SSL_REQUIRED ensures home and remote IORs will have port 0 in the primary address).
                boolean sslRequired = false;
                if (iorSecurityConfigMetaData != null) {
                    IORTransportConfigMetaData tc = iorSecurityConfigMetaData.getTransportConfig();
                    sslRequired = IORTransportConfigMetaData.INTEGRITY_REQUIRED.equals(tc.getIntegrity())
                            || IORTransportConfigMetaData.CONFIDENTIALITY_REQUIRED.equals(tc.getConfidentiality())
                            || IORTransportConfigMetaData.ESTABLISH_TRUST_IN_CLIENT_REQUIRED.equals(tc.getEstablishTrustInClient());
                }
                final Any sslPolicyValue = orb.create_any();
                SSLPolicyValueHelper.insert(sslPolicyValue, (sslRequired) ? SSLPolicyValue.SSL_REQUIRED : SSLPolicyValue.SSL_NOT_REQUIRED);
                Policy sslPolicy = orb.create_policy(SSL_POLICY_TYPE.value, sslPolicyValue);
                policyList.add(sslPolicy);

                EjbLogger.ROOT_LOGGER.debug("container's SSL policy: " + sslPolicy);
View Full Code Here

        ValueMember d =
                new ValueMember(name, id, defined_in_id, version,
                        typeCode, type_def(), access());

        Any any = getORB().create_any();

        ValueMemberHelper.insert(any, d);

        return new Description(DefinitionKind.dk_ValueMember, any);
    }
View Full Code Here

        OperationDescription od;
        od = new OperationDescription(name, id, defined_in_id, version, typeCode,
                mode(), contexts(), params(), exds);

        Any any = getORB().create_any();

        OperationDescriptionHelper.insert(any, od);

        return new Description(DefinitionKind.dk_Operation, any);
    }
View Full Code Here

        {

            log.fine("accepting ITTPrincipalName");

            byte[] name = establishMsg.identity_token.principal_name();
            Any aa;
            try {
                aa = codec.decode_value(name, OctetSeqHelper.type());
            }
            catch (UserException e) {
                MARSHAL me = new MARSHAL("cannot decode security descriptor",
                                         0, CompletionStatus.COMPLETED_NO);
                me.initCause(e);
                throw me;
            }

            byte[] exported_name = OctetSeqHelper.extract(aa);
            // byte[] exported_name = uncapsulateByteArray(name);
            String userAtDomain = decodeGSSExportedName(exported_name);

            log.fine("establish ITTPrincipalName " + userAtDomain);

            int idx = userAtDomain.indexOf('@');
            String user = "";
            String domain;

            if (idx == -1) {
                user = userAtDomain;
                domain = "default";
            } else {
                user = userAtDomain.substring(0, idx);
                domain = userAtDomain.substring(idx + 1);
            }

            if (gssup_domain != null && !domain.equals(gssup_domain)) {
                returnContextError(ri, 1, 1);

                log.warning("request designates wrong domain: " + userAtDomain);
                throw new org.omg.CORBA.NO_PERMISSION("bad domain");
            }

            // CSISubjectInfo.setPropagatedCaller (user, domain);
            Subject subject = SecurityContext.delegate(user, domain);
            SecurityContext.setAuthenticatedSubject(subject);

            returnCompleteEstablishContext(ri);

        } else if (establishMsg.identity_token.discriminator() == ITTAnonymous.value) {
            // establish anoynous identity

            log.fine("accepting ITTAnonymous");

            // CSISubjectInfo.setAnonymousSubject ();
            try {
                Subject subject = SecurityContext.anonymousLogin();
                SecurityContext.setAuthenticatedSubject(subject);
            }
            catch (LoginException ex) {
                // Won't happen
            }

            returnCompleteEstablishContext(ri);

        } else if (establishMsg.identity_token.discriminator() == ITTDistinguishedName.value) {

            log.fine("accepting ITTDistinguishedName");

            byte[] name_data = establishMsg.identity_token.dn();

            Any aa;
            try {
                aa = codec.decode_value(name_data, OctetSeqHelper.type());
            }
            catch (UserException e) {
                MARSHAL me = new MARSHAL("cannot encode security descriptor",
View Full Code Here

        mech.sas_context_mech = sas;

        CompoundSecMechList mech_list = new CompoundSecMechList(false,
                                                                new CompoundSecMech[]{mech});

        Any a = getOrb().create_any();
        CompoundSecMechListHelper.insert(a, mech_list);
        byte[] mech_data;
        try {
            mech_data = codec.encode_value(a);
        }
View Full Code Here

TOP

Related Classes of org.omg.CORBA.Any

Copyright © 2018 www.massapicom. 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.