Search in sources :

Example 1 with ListActionInfoOfLastActionsRequestProto

use of org.smartdata.common.protocol.AdminServerProto.ListActionInfoOfLastActionsRequestProto in project SSM by Intel-bigdata.

the class SmartAdminProtocolAdminSideTranslatorPB method listActionInfoOfLastActions.

@Override
public List<ActionInfo> listActionInfoOfLastActions(int maxNumActions) throws IOException {
    ListActionInfoOfLastActionsRequestProto req = ListActionInfoOfLastActionsRequestProto.newBuilder().setMaxNumActions(maxNumActions).build();
    try {
        List<ActionInfoProto> protoslist = rpcProxy.listActionInfoOfLastActions(null, req).getActionInfoListList();
        if (protoslist == null) {
            return new ArrayList<>();
        }
        List<ActionInfo> list = new ArrayList<>();
        for (ActionInfoProto infoProto : protoslist) {
            list.add(PBHelper.convert(infoProto));
        }
        return list;
    } catch (ServiceException e) {
        throw PBHelper.getRemoteException(e);
    }
}
Also used : ListActionInfoOfLastActionsRequestProto(org.smartdata.common.protocol.AdminServerProto.ListActionInfoOfLastActionsRequestProto) ActionInfoProto(org.smartdata.common.protocol.AdminServerProto.ActionInfoProto) ServiceException(com.google.protobuf.ServiceException) ArrayList(java.util.ArrayList) ActionInfo(org.smartdata.common.actions.ActionInfo)

Aggregations

ServiceException (com.google.protobuf.ServiceException)1 ArrayList (java.util.ArrayList)1 ActionInfo (org.smartdata.common.actions.ActionInfo)1 ActionInfoProto (org.smartdata.common.protocol.AdminServerProto.ActionInfoProto)1 ListActionInfoOfLastActionsRequestProto (org.smartdata.common.protocol.AdminServerProto.ListActionInfoOfLastActionsRequestProto)1