use of org.smartdata.protocol.AdminServerProto.RuleInfoProto in project SSM by Intel-bigdata.
the class AdminProtocolClientSideTranslator method listRulesInfo.
@Override
public List<RuleInfo> listRulesInfo() throws IOException {
try {
ListRulesInfoRequestProto req = ListRulesInfoRequestProto.newBuilder().build();
List<RuleInfoProto> infoProtos = rpcProxy.listRulesInfo(null, req).getRulesInfoList();
if (infoProtos == null) {
return null;
}
List<RuleInfo> ret = new ArrayList<>();
for (RuleInfoProto infoProto : infoProtos) {
ret.add(ProtoBufferHelper.convert(infoProto));
}
return ret;
} catch (ServiceException e) {
throw ProtoBufferHelper.getRemoteException(e);
}
}
use of org.smartdata.protocol.AdminServerProto.RuleInfoProto in project SSM by Intel-bigdata.
the class ServerProtocolsServerSideTranslator method listRulesInfo.
@Override
public ListRulesInfoResponseProto listRulesInfo(RpcController controller, ListRulesInfoRequestProto req) throws ServiceException {
try {
List<RuleInfo> infos = server.listRulesInfo();
List<RuleInfoProto> infoProtos = new ArrayList<>();
for (RuleInfo info : infos) {
infoProtos.add(ProtoBufferHelper.convert(info));
}
return ListRulesInfoResponseProto.newBuilder().addAllRulesInfo(infoProtos).build();
} catch (IOException e) {
throw new ServiceException(e);
}
}
Aggregations