use of com.helger.as2lib.partner.xml.IPartner in project as2-server by phax.
the class ViewPartnerCommand method execute.
@Override
protected CommandResult execute(final IPartnershipFactoryWithPartners partFx, final Object[] params) throws OpenAS2Exception {
if (params.length < 1)
return new CommandResult(ECommandResultType.TYPE_INVALID_PARAM_COUNT, getUsage());
final String name = params[0].toString();
final IPartner aPartner = partFx.getPartnerOfName(name);
if (aPartner != null) {
final String out = name + "\n" + aPartner.toString();
return new CommandResult(ECommandResultType.TYPE_OK, out);
}
return new CommandResult(ECommandResultType.TYPE_ERROR, "Unknown partner name");
}
Aggregations