Search in sources :

Example 1 with ListRulesInfoRequestProto

use of org.smartdata.protocol.AdminServerProto.ListRulesInfoRequestProto 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);
    }
}
Also used : ListRulesInfoRequestProto(org.smartdata.protocol.AdminServerProto.ListRulesInfoRequestProto) ServiceException(com.google.protobuf.ServiceException) ArrayList(java.util.ArrayList) RuleInfoProto(org.smartdata.protocol.AdminServerProto.RuleInfoProto) RuleInfo(org.smartdata.model.RuleInfo)

Aggregations

ServiceException (com.google.protobuf.ServiceException)1 ArrayList (java.util.ArrayList)1 RuleInfo (org.smartdata.model.RuleInfo)1 ListRulesInfoRequestProto (org.smartdata.protocol.AdminServerProto.ListRulesInfoRequestProto)1 RuleInfoProto (org.smartdata.protocol.AdminServerProto.RuleInfoProto)1