Search in sources :

Example 66 with BAD_PARAM

use of org.omg.CORBA.BAD_PARAM in project narayana by jbosstm.

the class POABase method destroyPOA.

public void destroyPOA(String adapterName) throws SystemException {
    if (adapterName == null)
        throw new BAD_PARAM();
    org.omg.PortableServer.POA childPoa = (org.omg.PortableServer.POA) _poas.remove(adapterName);
    if (childPoa != null) {
        childPoa.destroy(true, true);
        childPoa = null;
    } else
        throw new BAD_OPERATION();
}
Also used : BAD_PARAM(org.omg.CORBA.BAD_PARAM) BAD_OPERATION(org.omg.CORBA.BAD_OPERATION)

Example 67 with BAD_PARAM

use of org.omg.CORBA.BAD_PARAM in project wildfly by wildfly.

the class CSIv2IORInterceptor method establish_components.

@Override
public void establish_components(IORInfo info) {
    // check if CSIv2 policy is in effect for this IOR.
    CSIv2Policy csiv2Policy = null;
    try {
        csiv2Policy = (CSIv2Policy) info.get_effective_policy(CSIv2Policy.TYPE);
    } catch (BAD_PARAM e) {
        IIOPLogger.ROOT_LOGGER.debug("CSIv2Policy not found in IORInfo");
    } catch (Exception e) {
        IIOPLogger.ROOT_LOGGER.failedToFetchCSIv2Policy(e);
    }
    boolean interopIONA = Boolean.parseBoolean(CorbaORBService.getORBProperty(Constants.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) {
            // otherwise stuff the default SSL component (with the minimum set of SSL options) into the IOR's IIOP profile.
            info.add_ior_component_to_profile(defaultSSLComponent, TAG_INTERNET_IOP.value);
        }
        if (defaultCSIComponent != null) {
            // and stuff the default CSI component (with the minimum set of CSI options) into the IOR's IIOP profile.
            info.add_ior_component_to_profile(defaultCSIComponent, TAG_INTERNET_IOP.value);
        }
    }
}
Also used : TaggedComponent(org.omg.IOP.TaggedComponent) BAD_PARAM(org.omg.CORBA.BAD_PARAM)

Example 68 with BAD_PARAM

use of org.omg.CORBA.BAD_PARAM in project wildfly by wildfly.

the class CSIv2Util method getMatchingSecurityMech.

/**
 * <p>
 * Helper method to be called from a client request interceptor. The {@code ri} parameter refers to the current
 * request. This method returns the first {@code CompoundSecMech} found in the target IOR such that
 * <ul>
 * <li>all {@code CompoundSecMech} requirements are satisfied by the options in the {@code clientSupports}
 * parameter, and</li>
 * <li>every requirement in the {@code clientRequires} parameter is satisfied by the {@code CompoundSecMech}.
 * </li>
 * </ul>
 * The method returns null if the target IOR contains no {@code CompoundSecMech}s or if no matching
 * {@code CompoundSecMech} is found.
 * </p>
 * <p>
 * Since this method is intended to be called from a client request interceptor, it converts unexpected exceptions
 * into {@code MARSHAL} exceptions.
 * </p>
 *
 * @param ri             a reference to the current {@code ClientRequestInfo}.
 * @param codec          the {@code Codec} used to decode the CSIv2 components.
 * @param clientSupports the client supported transport options that must be satisfied by the {@code CompoundSecMech}.
 * @param clientRequires the client required transport options that must be satisfied by the {@code CompoundSecMech}.
 * @return the {@code CompoundSecMech} instance that satisfies all client options, or {@code null} if no such object
 *         can be found.
 */
public static CompoundSecMech getMatchingSecurityMech(ClientRequestInfo ri, Codec codec, short clientSupports, short clientRequires) {
    CompoundSecMechList csmList;
    try {
        TaggedComponent tc = ri.get_effective_component(org.omg.IOP.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.
        for (int i = 0; i < csmList.mechanism_list.length; i++) {
            CompoundSecMech securityMech = csmList.mechanism_list[i];
            AS_ContextSec authConfig = securityMech.as_context_mech;
            if ((EstablishTrustInTarget.value & (clientRequires ^ authConfig.target_supports) & ~authConfig.target_supports) != 0) {
                // client requires EstablishTrustInTarget, but target does not support it: skip this securityMech.
                continue;
            }
            if ((EstablishTrustInClient.value & (authConfig.target_requires ^ clientSupports) & ~clientSupports) != 0) {
                // target requires EstablishTrustInClient, but client does not support it: skip this securityMech.
                continue;
            }
            SAS_ContextSec identityConfig = securityMech.sas_context_mech;
            if ((IdentityAssertion.value & (identityConfig.target_requires ^ clientSupports) & ~clientSupports) != 0) {
                // target requires IdentityAssertion, but client does not support it: skip this securityMech
                continue;
            }
            // found matching securityMech.
            return securityMech;
        }
        // no matching securityMech was found.
        return null;
    } catch (BAD_PARAM e) {
        // no component with TAG_CSI_SEC_MECH_LIST was found.
        return null;
    } catch (org.omg.IOP.CodecPackage.TypeMismatch e) {
        // unexpected exception in codec
        throw IIOPLogger.ROOT_LOGGER.unexpectedException(e);
    } catch (org.omg.IOP.CodecPackage.FormatMismatch e) {
        // unexpected exception in codec
        throw IIOPLogger.ROOT_LOGGER.unexpectedException(e);
    }
}
Also used : SAS_ContextSec(org.omg.CSIIOP.SAS_ContextSec) AS_ContextSec(org.omg.CSIIOP.AS_ContextSec) CompoundSecMechList(org.omg.CSIIOP.CompoundSecMechList) TaggedComponent(org.omg.IOP.TaggedComponent) CompoundSecMech(org.omg.CSIIOP.CompoundSecMech) BAD_PARAM(org.omg.CORBA.BAD_PARAM) SAS_ContextSec(org.omg.CSIIOP.SAS_ContextSec) Any(org.omg.CORBA.Any)

Example 69 with BAD_PARAM

use of org.omg.CORBA.BAD_PARAM in project wildfly by wildfly.

the class TxServerInterceptor method receive_request_service_contexts.

public void receive_request_service_contexts(ServerRequestInfo ri) {
    IIOPLogger.ROOT_LOGGER.tracef("Intercepting receive_request_service_contexts, operation: %s", ri.operation());
    try {
        ServiceContext sc = ri.get_request_service_context(txContextId);
        Any any = codec.decode_value(sc.context_data, PropagationContextHelper.type());
        ri.set_slot(slotId, any);
    } catch (BAD_PARAM e) {
    // no service context with txContextId: do nothing
    } catch (FormatMismatch e) {
        throw IIOPLogger.ROOT_LOGGER.errorDecodingContextData(this.name(), e);
    } catch (TypeMismatch e) {
        throw IIOPLogger.ROOT_LOGGER.errorDecodingContextData(this.name(), e);
    } catch (InvalidSlot e) {
        throw IIOPLogger.ROOT_LOGGER.errorSettingSlotInTxInterceptor(e);
    }
}
Also used : ServiceContext(org.omg.IOP.ServiceContext) BAD_PARAM(org.omg.CORBA.BAD_PARAM) InvalidSlot(org.omg.PortableInterceptor.InvalidSlot) Any(org.omg.CORBA.Any) FormatMismatch(org.omg.IOP.CodecPackage.FormatMismatch) TypeMismatch(org.omg.IOP.CodecPackage.TypeMismatch)

Aggregations

BAD_PARAM (org.omg.CORBA.BAD_PARAM)69 SystemException (org.omg.CORBA.SystemException)31 UNKNOWN (org.omg.CORBA.UNKNOWN)27 Any (org.omg.CORBA.Any)22 ServiceContext (org.omg.IOP.ServiceContext)21 AcsJNoPermissionEx (alma.maciErrType.wrappers.AcsJNoPermissionEx)13 BadParametersException (com.cosylab.acs.maci.BadParametersException)13 CoreException (com.cosylab.acs.maci.CoreException)13 NoResourcesException (com.cosylab.acs.maci.NoResourcesException)13 NO_RESOURCES (org.omg.CORBA.NO_RESOURCES)12 TRANSACTION_REQUIRED (org.omg.CORBA.TRANSACTION_REQUIRED)12 Coordinator (org.omg.CosTransactions.Coordinator)12 UidCoordinator (com.arjuna.ArjunaOTS.UidCoordinator)9 ControlWrapper (com.arjuna.ats.internal.jts.ControlWrapper)8 Object (org.omg.CORBA.Object)8 Unavailable (org.omg.CosTransactions.Unavailable)8 FormatMismatch (org.omg.IOP.CodecPackage.FormatMismatch)8 TypeMismatch (org.omg.IOP.CodecPackage.TypeMismatch)8 URI (java.net.URI)7 URISyntaxException (java.net.URISyntaxException)7