Package net.gridshield.nexsm.entityclasses

Examples of net.gridshield.nexsm.entityclasses.PushResult


                // get the response
                BufferedReader rd = new BufferedReader(new InputStreamReader(con.getInputStream()));
                String line;
                PusherEvent pe = new PusherEvent(this);
                pe.setType(PusherEvent.PusherEventType.UNKNOWN);
                PushResult pr = null;
                while ((line = rd.readLine()) != null) {
          //          System.out.println(line);  /* debug line */
                    if (line.contains("Your command request was successfully submitted to Nagios for processing.")) {
                        pe.setType(PusherEvent.PusherEventType.FINISHED);
                        pr = new PushResult(PusherEvent.PusherEventType.FINISHED_OK, line);
                        pe.setObject(pr);
                        outval = true;
                    } else if (line.contains("An error occurred while processing your command")) {
                        outval = false;
                        pe.setType(PusherEvent.PusherEventType.FINISHED);
                        pr = new PushResult(PusherEvent.PusherEventType.ERROR, line);
                        pe.setObject(pr);
                    }
                }

                if (getPushManager() != null) { getPushManager().firePusherFinished(pe); }
View Full Code Here


    public void endDocument() throws Exception {
    }

    public void text(String str) throws Exception {
        if (txtmsg) {
            result = new PushResult(PusherEvent.PusherEventType.FINISHED_OK, str);
        }
        if (txterror) {
            result = new PushResult(PusherEvent.PusherEventType.ERROR, str);
        }
    }
View Full Code Here

      pe.setObject(pushHandler.getList());
      getPushManager().firePusherFinished(pe);
    }catch(Exception e){
      PusherEvent pe = new PusherEvent(this, _destinationFileName);
      pe.setType(PusherEvent.PusherEventType.ERROR);
      PushResult pr = new PushResult(PusherEvent.PusherEventType.ERROR, e.toString());
      pe.setObject(pr);
      getPushManager().firePusherError(pe);
      this.e = e;
    }finally{
      try{
View Full Code Here

        return _graphManager.getIntegerParam(name);
    }
   
    private void takePusherAction(LinkedList<Object> l) {
        MapperEvent me;
        PushResult pr = null;
        for (Object o: l) {
            if (o instanceof PushResult) {
                pr = (PushResult)o;
                if (pr.getType() == PusherEvent.PusherEventType.ERROR) {
                    me = new MapperEvent(this);
                    me.setMapperType(MapperActionType.DisplayError);
                    Date d = new Date(System.currentTimeMillis());
                    NexsmLog nl = new NexsmLog(d, NexsmLogType.Critical, "Pusher error",
                            pr.getMsg());
                    me.setParams(nl);
                    fireMapperActionRequested(me);
                } else if (pr.getType() == PusherEvent.PusherEventType.FINISHED_OK) {
                    me = new MapperEvent(this);
                    me.setMapperType(MapperActionType.DisplayInfo);
                    Date d = new Date(System.currentTimeMillis());
                    NexsmLog nl = new NexsmLog(d, NexsmLogType.Informational, "Pusher finished",
                            pr.getMsg());
                    me.setParams(nl);
                    fireMapperActionRequested(me);
                }
            }
        }
View Full Code Here

TOP

Related Classes of net.gridshield.nexsm.entityclasses.PushResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.