use of org.smartdata.protocol.AdminServerProto.CmdletInfoProto in project SSM by Intel-bigdata.
the class AdminProtocolClientSideTranslator method listCmdletInfo.
@Override
public List<CmdletInfo> listCmdletInfo(long rid, CmdletState cmdletState) throws IOException {
ListCmdletInfoRequestProto req = ListCmdletInfoRequestProto.newBuilder().setRuleID(rid).setCmdletState(cmdletState.getValue()).build();
try {
List<CmdletInfoProto> protoslist = rpcProxy.listCmdletInfo(null, req).getCmdletInfosList();
if (protoslist == null) {
return new ArrayList<>();
}
List<CmdletInfo> list = new ArrayList<>();
for (CmdletInfoProto infoProto : protoslist) {
list.add(ProtoBufferHelper.convert(infoProto));
}
return list;
} catch (ServiceException e) {
throw ProtoBufferHelper.getRemoteException(e);
}
}
use of org.smartdata.protocol.AdminServerProto.CmdletInfoProto in project SSM by Intel-bigdata.
the class ServerProtocolsServerSideTranslator method listCmdletInfo.
@Override
public ListCmdletInfoResponseProto listCmdletInfo(RpcController controller, ListCmdletInfoRequestProto req) throws ServiceException {
try {
List<CmdletInfo> list = server.listCmdletInfo(req.getRuleID(), CmdletState.fromValue(req.getCmdletState()));
if (list == null) {
return ListCmdletInfoResponseProto.newBuilder().build();
}
List<CmdletInfoProto> protoList = new ArrayList<>();
for (CmdletInfo info : list) {
protoList.add(ProtoBufferHelper.convert(info));
}
return ListCmdletInfoResponseProto.newBuilder().addAllCmdletInfos(protoList).build();
} catch (IOException e) {
throw new ServiceException(e);
}
}
Aggregations