Examples of PushResult


Examples of cn.jpush.api.push.PushResult

       
        // For push, all you need do is to build PushPayload object.
        PushPayload payload = buildPushObject_all_all_alert();
       
        try {
            PushResult result = jpushClient.sendPush(payload);
            LOG.info("Got result - " + result);
           
        } catch (APIConnectionException e) {
            LOG.error("Connection error. Should retry later. ", e);
           
View Full Code Here

Examples of cn.jpush.api.push.PushResult

       
        // For push, all you need do is to build PushPayload object.
        PushPayload payload = buildPushObject_all_all_alert();
        LOG.info("Paylaod JSON - " + payload.toString());
       
        PushResult result = jpushClient.sendPush(payload);
        if (result.isResultOK()) {
            LOG.debug(result.toString());
        } else {
            if (result.getErrorCode() > 0) {
                LOG.warn(result.getOriginalContent());
            } else {
                LOG.debug("Maybe connect error. Retry laster. ");
            }
        }
  }
View Full Code Here

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

Examples of net.gridshield.nexsm.entityclasses.PushResult

    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

Examples of net.gridshield.nexsm.entityclasses.PushResult

      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

Examples of net.gridshield.nexsm.entityclasses.PushResult

        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

Examples of org.eclipse.jgit.transport.PushResult

        final Collection<RemoteRefUpdate> toPush = transport
            .findRemoteRefUpdatesFor(refSpecs);

        try {
          PushResult result = transport.push(monitor, toPush);
          pushResults.add(result);

        } catch (TransportException e) {
          throw new JGitInternalException(
              JGitText.get().exceptionCaughtDuringExecutionOfPushCommand,
View Full Code Here

Examples of org.eclipse.jgit.transport.PushResult

        final Collection<RemoteRefUpdate> toPush = transport
            .findRemoteRefUpdatesFor(refSpecs);

        try {
          PushResult result = transport.push(monitor, toPush);
          pushResults.add(result);

        } catch (TransportException e) {
          throw new JGitInternalException(
              JGitText.get().exceptionCaughtDuringExecutionOfPushCommand,
View Full Code Here

Examples of org.eclipse.jgit.transport.PushResult

        final Collection<RemoteRefUpdate> toPush = transport
            .findRemoteRefUpdatesFor(refSpecs);

        try {
          PushResult result = transport.push(monitor, toPush);
          pushResults.add(result);

        } catch (TransportException e) {
          throw new JGitInternalException(
              JGitText.get().exceptionCaughtDuringExecutionOfPushCommand,
View Full Code Here

Examples of org.eclipse.jgit.transport.PushResult

    RefSpec spec = new RefSpec(branch + ":" + branch);
    Iterable<PushResult> resultIterable = git.push().setRemote(remote)
        .setRefSpecs(spec).call();

    PushResult result = resultIterable.iterator().next();
    TrackingRefUpdate trackingRefUpdate = result
        .getTrackingRefUpdate(trackingBranch);

    assertNotNull(trackingRefUpdate);
    assertEquals(trackingBranch, trackingRefUpdate.getLocalName());
    assertEquals(branch, trackingRefUpdate.getRemoteName());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.