use of com.sun.corba.ee.org.omg.CSIIOP.CompoundSecMechList in project Payara by payara.
the class CSIV2TaggedComponentInfo method createCompoundSecMechListComponent.
private org.omg.IOP.TaggedComponent createCompoundSecMechListComponent(CompoundSecMech[] mechList) {
CDROutputObject out = (CDROutputObject) orb.create_output_stream();
out.putEndian();
boolean stateful = false;
CompoundSecMechListHelper.write(out, new CompoundSecMechList(stateful, mechList));
return new org.omg.IOP.TaggedComponent(TAG_CSI_SEC_MECH_LIST.value, out.toByteArray());
}
use of com.sun.corba.ee.org.omg.CSIIOP.CompoundSecMechList 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;
}
Aggregations