if (extMetaData instanceof EndpointMetaData)
{
EndpointMetaData endpointMD = (EndpointMetaData) extMetaData;
// prepare wsrm metadata
RMConfig rmMD = endpointMD.getConfig().getRMMetaData();
if (rmMD == null)
{
rmMD = new RMConfig();
endpointMD.getConfig().setRMMetaData(rmMD);
}
// construct new port metadata
RMPortConfig portMD = new RMPortConfig();
portMD.setPortName(endpointMD.getPortName());
RMDeliveryAssuranceConfig deliveryMD = new RMDeliveryAssuranceConfig();
deliveryMD.setInOrder("false");
deliveryMD.setQuality("AtLeastOnce");
portMD.setDeliveryAssurance(deliveryMD);
// ensure port does not exists yet
for (RMPortConfig pMD : rmMD.getPorts())
{
assert ! pMD.getPortName().equals(portMD.getPortName());
}
// set up port WSRMP metadata
rmMD.getPorts().add(portMD);
if (!WSRM_NS.equals(RMProvider.get().getNamespaceURI()))
{
throw new IllegalArgumentException("RM provider namespace mismatch");
}
}