Search in sources :

Example 1 with TaggedComponent

use of com.sun.corba.ee.spi.ior.TaggedComponent in project Payara by payara.

the class CSIV2TaggedComponentInfo method getSecurityMechanisms.

/**
 * Get the Compound security mechanism list from the given IOR.
 *
 * @param the IOR.
 * @return the array of compound security mechanisms.
 */
public CompoundSecMech[] getSecurityMechanisms(IOR ior) {
    IIOPProfile prof = ior.getProfile();
    IIOPProfileTemplate ptemp = (IIOPProfileTemplate) prof.getTaggedProfileTemplate();
    Iterator<TaggedComponent> itr = ptemp.iteratorById(TAG_CSI_SEC_MECH_LIST.value);
    if (!itr.hasNext()) {
        if (logger.isLoggable(FINE)) {
            logger.log(FINE, "IIOP:TAG_CSI_SEC_MECH_LIST tagged component not found");
        }
        return null;
    }
    TaggedComponent tcomp = itr.next();
    if (logger.isLoggable(Level.FINE)) {
        logger.log(Level.FINE, "Component:" + tcomp);
    }
    if (itr.hasNext()) {
        String msg = "More than one TAG_CSI_SEC_MECH_LIST tagged " + "component found ";
        logger.log(Level.SEVERE, "iiop.many_tagged_component");
        throw new RuntimeException(msg);
    }
    org.omg.IOP.TaggedComponent comp = tcomp.getIOPComponent(orb);
    byte[] b = comp.component_data;
    CDRInputObject in = new EncapsInputStream(orb, b, b.length);
    in.consumeEndian();
    CompoundSecMechList l = CompoundSecMechListHelper.read(in);
    CompoundSecMech[] list = l.mechanism_list;
    return list;
}
Also used : CDRInputObject(com.sun.corba.ee.impl.encoding.CDRInputObject) IIOPProfile(com.sun.corba.ee.spi.ior.iiop.IIOPProfile) CompoundSecMechList(com.sun.corba.ee.org.omg.CSIIOP.CompoundSecMechList) CompoundSecMech(com.sun.corba.ee.org.omg.CSIIOP.CompoundSecMech) EncapsInputStream(com.sun.corba.ee.impl.encoding.EncapsInputStream) TaggedComponent(com.sun.corba.ee.spi.ior.TaggedComponent) IIOPProfileTemplate(com.sun.corba.ee.spi.ior.iiop.IIOPProfileTemplate)

Aggregations

CDRInputObject (com.sun.corba.ee.impl.encoding.CDRInputObject)1 EncapsInputStream (com.sun.corba.ee.impl.encoding.EncapsInputStream)1 CompoundSecMech (com.sun.corba.ee.org.omg.CSIIOP.CompoundSecMech)1 CompoundSecMechList (com.sun.corba.ee.org.omg.CSIIOP.CompoundSecMechList)1 TaggedComponent (com.sun.corba.ee.spi.ior.TaggedComponent)1 IIOPProfile (com.sun.corba.ee.spi.ior.iiop.IIOPProfile)1 IIOPProfileTemplate (com.sun.corba.ee.spi.ior.iiop.IIOPProfileTemplate)1