Search in sources :

Example 1 with ListCmdletInfoRequestProto

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

Aggregations

ServiceException (com.google.protobuf.ServiceException)1 ArrayList (java.util.ArrayList)1 CmdletInfo (org.smartdata.model.CmdletInfo)1 CmdletInfoProto (org.smartdata.protocol.AdminServerProto.CmdletInfoProto)1 ListCmdletInfoRequestProto (org.smartdata.protocol.AdminServerProto.ListCmdletInfoRequestProto)1