Package com.betfair.tornjak.monitor

Examples of com.betfair.tornjak.monitor.Status


        if (destinationType == DestinationType.Topic || destinationType == DestinationType.DurableTopic) {
            boolean monitorThisEvent = monitorEvent(eventName);
            if (monitorThisEvent) {
                long pingFailureTimeout = getSubscriberPingFailureTimeout(eventName);
                long pingWarningTimeout = getSubscriberPingWarningTimeout(eventName);
                Status maxStatus = getSubscriberMaxEffectOnOverallStatus(eventName);
                ret = new TopicSubscriberPingMonitor(transportIdentifier, destinationName, subscriptionId, pingWarningTimeout, pingFailureTimeout, maxStatus);
                subscriberMonitorsBySession.put(session, ret);
                if (monitorRegistry != null) {
                    monitorRegistry.addMonitor(ret);
                }
View Full Code Here


            for (EventBindingDescriptor descriptor : eventServiceBindingDescriptor.getEventBindings()) {
                boolean emitPing = sendPingForEvent(descriptor.getEventName());
                if (emitPing) {
                    String destination = getDestinationResolver().resolveDestination(descriptor.getEventClass(), null);
                    long pingPeriod = getPingPeriod(descriptor.getEventName());
                    Status maxImpact = getPublisherMaxEffectOnOverallStatus(descriptor.getEventName());
                    TopicPublisherPingMonitor monitor = new TopicPublisherPingMonitor(this, pingPeriod, destination, maxImpact);
                    publisherPingMonitors.add(monitor);
                    if (monitorRegistry != null) {
                        monitorRegistry.addMonitor(monitor);
                    }
View Full Code Here

          for (ServiceAware serviceAware : serviceAwareImpls) {
            serviceAware.setServices(services);
          }
        }       

                Status status = monitorRegistry
                        .getStatusAggregator()
                        .getStatus();
                logger.log((status != Status.OK ? Level.WARNING : Level.INFO),
                        "Cougar returned status %s at startup", status);
      } catch (Exception e) {
View Full Code Here

        StatusAggregator agg = monitorRegistry.getStatusAggregator();
        if (agg == null) {
            logger.log(Level.SEVERE, "StatusAggregator is null");
            throw new HealthException(ResponseCode.InternalError, HealthExceptionErrorCodeEnum.NULL);
        }
        Status status = agg.getStatus();
        if (status == null) {
            logger.log(Level.SEVERE, "Status is null");
            throw new HealthException(ResponseCode.InternalError, HealthExceptionErrorCodeEnum.NULL);
        }
        if (status.equals(Status.FAIL)) {
            currentState = RestrictedHealthStatus.FAIL;
        }
    return currentState;
   
  }
View Full Code Here

        List<SubComponentStatus> subStatuses = new ArrayList<>();
        for (Monitor m : monitorRegistry.getMonitorSet()) {
            SubComponentStatus scs = new SubComponentStatus();
            scs.setName(m.getName());
            Status monitorStatus = m.getStatus();
            scs.setStatus(getHealthStatus(monitorStatus));
            subStatuses.add(scs);
        }
        detail.setSubComponentList(subStatuses);
    if (!isSystemInService()) {
View Full Code Here

    return returnObject;

  }

  private Status toStatus(String statusString) {
        Status s = Status.valueOf(statusString);
        if (s == null) {
            throw new IllegalArgumentException("Unrecognised status: "+ statusString);
        }
        return s;
    }
View Full Code Here

    return returnObject;

  }

  private Status toStatus(String statusString) {
        Status s = Status.valueOf(statusString);
        if (s == null) {
            throw new IllegalArgumentException("Unrecognised status: "+ statusString);
        }
        return s;
    }
View Full Code Here

    }

    @ManagedAttribute
    public void setInService(boolean inService) throws IOException {
        try {
            Status newStatus = inService ? Status.OK : Status.FAIL;
            writeLine(newStatus.name(), cachedStatusFile);
            status = newStatus;
        }
        catch (IOException e) {
            logger.error("Can't write cached status to disk", e);
            throw e;
View Full Code Here

            }

            public void render(Map model, HttpServletRequest request,
                               HttpServletResponse response) throws Exception {
                StatusAggregator sa = monitorRegistry.getStatusAggregator();
                Status status = (sa == null) ? FAIL : sa.getStatus();
                // webping only supports OK or FAIL response
                if (status == WARN) {
                    status = OK;
                }
                response.getWriter().print(webping.replace("${status}", status.name()));
            }
        }, "status", "");
    }
View Full Code Here

            }

            public void render(Map model, HttpServletRequest request,
                               HttpServletResponse response) throws Exception {
                StatusAggregator sa = monitorRegistry.getStatusAggregator();
                Status status = (sa == null) ? FAIL : sa.getStatus();
                // webping only supports OK or FAIL response
                if (status == WARN) {
                    status = OK;
                }
                response.getWriter().print(webping.replace("${status}", status.name()));
            }
        }, "status", "");
    }
View Full Code Here

TOP

Related Classes of com.betfair.tornjak.monitor.Status

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.