use of org.smartdata.common.protocol.AdminServerProto.CommandInfoProto in project SSM by Intel-bigdata.
the class ClientSmartProtocolServerSideTranslatorPB method listCommandInfo.
@Override
public ListCommandInfoResponseProto listCommandInfo(RpcController controller, ListCommandInfoRequestProto req) throws ServiceException {
try {
List<CommandInfo> list = server.listCommandInfo(req.getRuleID(), CommandState.fromValue(req.getCommandState()));
if (list == null)
return ListCommandInfoResponseProto.newBuilder().build();
List<CommandInfoProto> protoList = new ArrayList<>();
for (CommandInfo info : list) {
protoList.add(PBHelper.convert(info));
}
return ListCommandInfoResponseProto.newBuilder().addAllCommandInfos(protoList).build();
} catch (IOException e) {
throw new ServiceException(e);
}
}
use of org.smartdata.common.protocol.AdminServerProto.CommandInfoProto 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);
}
}
Aggregations