Search in sources :

Example 1 with ListCommandInfoRequestProto

use of org.smartdata.common.protocol.AdminServerProto.ListCommandInfoRequestProto in project SSM by Intel-bigdata.

the class SmartAdminProtocolAdminSideTranslatorPB method listCommandInfo.

@Override
public List<CommandInfo> listCommandInfo(long rid, CommandState commandState) throws IOException {
    ListCommandInfoRequestProto req = ListCommandInfoRequestProto.newBuilder().setRuleID(rid).setCommandState(commandState.getValue()).build();
    try {
        List<CommandInfoProto> protoslist = rpcProxy.listCommandInfo(null, req).getCommandInfosList();
        if (protoslist == null)
            return new ArrayList<>();
        List<CommandInfo> list = new ArrayList<>();
        for (CommandInfoProto infoProto : protoslist) {
            list.add(PBHelper.convert(infoProto));
        }
        return list;
    } catch (ServiceException e) {
        throw PBHelper.getRemoteException(e);
    }
}
Also used : CommandInfo(org.smartdata.common.command.CommandInfo) ListCommandInfoRequestProto(org.smartdata.common.protocol.AdminServerProto.ListCommandInfoRequestProto) ServiceException(com.google.protobuf.ServiceException) ArrayList(java.util.ArrayList) CommandInfoProto(org.smartdata.common.protocol.AdminServerProto.CommandInfoProto)

Aggregations

ServiceException (com.google.protobuf.ServiceException)1 ArrayList (java.util.ArrayList)1 CommandInfo (org.smartdata.common.command.CommandInfo)1 CommandInfoProto (org.smartdata.common.protocol.AdminServerProto.CommandInfoProto)1 ListCommandInfoRequestProto (org.smartdata.common.protocol.AdminServerProto.ListCommandInfoRequestProto)1