Search in sources :

Example 1 with IPartner

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");
}
Also used : IPartner(com.helger.as2lib.partner.xml.IPartner) CommandResult(com.helger.as2.cmd.CommandResult)

Aggregations

CommandResult (com.helger.as2.cmd.CommandResult)1 IPartner (com.helger.as2lib.partner.xml.IPartner)1