Send call stats bridge status update.

@param bridgeStatusInfo the bridge status info
184440
public void sendCallStatsBridgeStatusUpdate(BridgeStatusInfo bridgeStatusInfo) {
    if (!isInitialized()) {
      bridgeStatusInfoQueue.push(bridgeStatusInfo);
      return;
    }

    long epoch = System.currentTimeMillis();
    String token = getToken();
    BridgeStatusUpdateMessage eventMessage =
        new BridgeStatusUpdateMessage(bridgeId, epoch, bridgeStatusInfo);
    String requestMessageString = gson.toJson(eventMessage);
    String url = "/" + appId + "/stats/bridge/status";
    httpClient.sendBridgeStatistics(url, token, requestMessageString,
        new CallStatsHttp2ResponseListener() {
          public void onResponse(Response response) {
            int responseStatus = response.code();
            BridgeStatusUpdateResponse eventResponseMessage;
            try {
              String responseString = response.body().string();
              eventResponseMessage =
                  gson.fromJson(responseString, BridgeStatusUpdateResponse.class);
            } catch (IOException e) {
              logger.error("IO Exception " + e.getMessage(), e);
              throw new RuntimeException(e);
            } catch (JsonSyntaxException e) {
              logger.error("Json Syntax Exception " + e.getMessage(), e);
              e.printStackTrace();
              throw new RuntimeException(e);
            }
            logger.debug("BridgeStatusUpdate Response " + eventResponseMessage.getStatus() + ":"
                + eventResponseMessage.getMsg());
            httpClient.setDisrupted(false);
            if (responseStatus == CallStatsResponseStatus.RESPONSE_STATUS_SUCCESS) {
              sendCallStatsBridgeStatusUpdateFromQueue();
            } else if (responseStatus == CallStatsResponseStatus.INVALID_AUTHENTICATION_TOKEN) {
              bridgeKeepAliveManager.stopKeepAliveSender();
              authenticator.doAuthentication();
            } else {
              httpClient.setDisrupted(true);
            }
          }

          public void onFailure(Exception e) {
            logger.error("Response exception" + e.getMessage(), e);
            httpClient.setDisrupted(true);
          }

        });
  }
556175
function Stats(state) {
  this.state = state;
  this.clear();
  this.onConnect = onConnect.bind(this);
  this.onDisconnect = onDisconnect.bind(this);
  this.onRejected = onRejected.bind(this);
  this.onHit = onHit.bind(this);
  this.onMiss = onMiss.bind(this);
  this.onExpired = onExpired.bind(this);
  this.onExpired = onExpired.bind(this);
  this.addStateListeners();
}
133951
public void setStatus(final ConnectionStatus update) {
        status.getAndSet(update);
        if (ConnectionStatus.TERMINATED == status.get()) {
            resourceSynchronizer.doNotify();
        }
    }
477728
private void updateConnected() throws IOException
    {
        byte cid = in.readByte();
        // Ensure the client id is the same
        if (cid != clientId)
        {
            return;
        }
        for (final ConnectionListener listener : listeners)
        {
            listener.notifyConnectionEstablished(Byte.valueOf(clientId), clientName);
        }
        // Read the client list
        final int clientsNumber = in.readByte();
        for (int i = 0; i < clientsNumber; i++)
        {
            cid = in.readByte();
            final String cname = readString();
            for (final ConnectionListener listener : listeners)
            {
                listener.notifyClientConnected(Byte.valueOf(cid), cname);
            }
        }
        // Message of the day if has
        if (in.available() > 0)
        {
            final String motd = readString();
            for (final ConnectionListener listener : listeners)
            {
                listener.notifyMessageOfTheDay(motd);
            }
        }
        // Send the last answer
        out.write(NetworkMessageSystemId.CONNECTED);
        out.write(clientId);
        out.flush();
        Verbose.info("Client: Connected to the server !");
    }
562126
synchronized void statusUpdate(TaskStatus status) {
    setProgress(status.getProgress());
    this.runState = status.getRunState();
    this.stateString = status.getStateString();
    this.nextRecordRange = status.getNextRecordRange();

    setDiagnosticInfo(status.getDiagnosticInfo());
    
    if (status.getStartTime() > 0) {
      this.startTime = status.getStartTime(); 
    }
    if (status.getFinishTime() > 0) {
      setFinishTime(status.getFinishTime()); 
    }
    
    this.phase = status.getPhase();
    this.counters = status.getCounters();
    this.outputSize = status.outputSize;
  }
1131036
protected void updatePageStatus() {
		final boolean ok;
		if (Strings.isEmpty(this.titleField.getText())) {
			ok = false;
			setMessage(Messages.IssueInformationPage_5, IMessageProvider.ERROR);
		} else if (Strings.isEmpty(this.trackerLogin.getText())) {
			ok = false;
			setMessage(Messages.IssueInformationPage_6, IMessageProvider.ERROR);
		} else if (Strings.isEmpty(this.trackerPassword.getText())) {
			ok = false;
			setMessage(Messages.IssueInformationPage_7, IMessageProvider.ERROR);
		} else {
			ok = true;
			if (Strings.isEmpty(this.descriptionField.getText())) {
				setMessage(Messages.IssueInformationPage_8, IMessageProvider.WARNING);
			} else {
				setMessage(null, IMessageProvider.NONE);
			}
		}
		setPageComplete(ok);
	}
588464
public void changeStatus(int newStatus)
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "changeStatus", new java.lang.Object[] { this, new Integer(newStatus) });

        _status = newStatus;

        if (tc.isEntryEnabled())
            Tr.exit(tc, "changeStatus");
    }
1067896
public void setStatusInfos(java.util.Collection<DBInstanceStatusInfo> statusInfos) {
        if (statusInfos == null) {
            this.statusInfos = null;
            return;
        }

        this.statusInfos = new java.util.ArrayList<DBInstanceStatusInfo>(statusInfos);
    }
1137373
public void setConnectionStatuses(java.util.Collection<TerminateConnectionStatus> connectionStatuses) {
        if (connectionStatuses == null) {
            this.connectionStatuses = null;
            return;
        }

        this.connectionStatuses = new com.amazonaws.internal.SdkInternalList<TerminateConnectionStatus>(connectionStatuses);
    }
1213700
private void updateOtherClientConnected() throws IOException
    {
        final byte cid = in.readByte();
        final String cname = readString();
        for (final ConnectionListener listener : listeners)
        {
            listener.notifyClientConnected(Byte.valueOf(cid), cname);
        }
    }
957250
public static void sendNetStreamStatus(IConnection conn, String statusCode, String description, String name, String status, Number streamId) {
        if (conn instanceof RTMPConnection) {
            Status s = new Status(statusCode);
            s.setClientid(streamId);
            s.setDesciption(description);
            s.setDetails(name);
            s.setLevel(status);
            // get the channel
            RTMPConnection rtmpConn = (RTMPConnection) conn;
            Channel channel = rtmpConn.getChannel(rtmpConn.getChannelIdForStreamId(streamId));
            channel.sendStatus(s);
        } else {
            throw new RuntimeException("Connection is not RTMPConnection: " + conn);
        }
    }
1186579
public void updateStatus() {
        Optional<Activity> activity = api.getActivity();
        ObjectNode updateStatus = JsonNodeFactory.instance.objectNode()
                .put("op", GatewayOpcode.STATUS_UPDATE.getCode());
        ObjectNode data = updateStatus.putObject("d")
                .put("status", api.getStatus().getStatusString())
                .put("afk", false)
                .putNull("since");
        ObjectNode activityJson = data.putObject("game");
        activityJson.put("name", activity.isPresent() ? activity.get().getName() : null);
        activityJson.put("type", activity.map(g -> g.getType().getId()).orElse(0));
        activity.ifPresent(g -> g.getStreamingUrl().ifPresent(url -> activityJson.put("url", url)));
        logger.debug("Updating status (content: {})", updateStatus);
        websocket.get().sendText(updateStatus.toString());
    }
676212
function sendStats(socket, stats, force) {
    if (!socket || !stats) return;
    if (!force && stats && stats.assets && stats.assets.every(function (asset) {
        return !asset.emitted;
    })) return;
    socket.emit("hash", stats.hash);
    if (stats.errors.length > 0)
        socket.emit("errors", stats.errors);
    else if (stats.warnings.length > 0)
        socket.emit("warnings", stats.warnings);
    else
        socket.emit("ok");
}
175758
public void updateServiceInstanceStatus(String serviceName, String instanceId, OperationalStatus status, final RegistrationCallback cb, Object context){
        ProtocolHeader header = new ProtocolHeader();
        header.setType(ProtocolType.UpdateServiceInstanceStatus);

        UpdateServiceInstanceStatusProtocol p = new UpdateServiceInstanceStatusProtocol(serviceName, instanceId, status);

        ProtocolCallback pcb = new ProtocolCallback(){

            @Override
            public void call(boolean result, Response response,
                    ErrorCode error, Object ctx) {
                cb.call(result, error, ctx);
            }

        };

        connection.submitCallbackRequest(header, p, pcb, context);
    }
228129
public void updateServiceInstanceInternalStatus(String serviceName, String instanceId, OperationalStatus status, final RegistrationCallback cb, Object context){
        ProtocolHeader header = new ProtocolHeader();
        header.setType(ProtocolType.UpdateServiceInstanceInternalStatus);

        UpdateServiceInstanceInternalStatusProtocol protocol = new UpdateServiceInstanceInternalStatusProtocol(serviceName, instanceId, status);

        ProtocolCallback pcb = new ProtocolCallback(){

            @Override
            public void call(boolean result, Response response,
                    ErrorCode error, Object ctx) {
                cb.call(result, error, ctx);
            }

        };

        connection.submitCallbackRequest(header, protocol, pcb, context);
    }
193252
private void nextStatusUpdate() {
		this.nextStatusUpdateNode = NeoUtils.getNextSingleNode(
				this.nextStatusUpdateNode, SocialGraphRelationshipType.UPDATE);

		// load status update time stamp if existing
		if (this.nextStatusUpdateNode != null) {
			this.statusUpdateTimestamp = (long) this.nextStatusUpdateNode
					.getProperty(Properties.StatusUpdate.TIMESTAMP);
		}
	}
616543
private void sendKeepAliveBridgeMessage(int appId, String bridgeId, String token,
      final CallStatsHttp2Client httpClient) {
    long apiTS = System.currentTimeMillis();
    BridgeKeepAliveMessage message = new BridgeKeepAliveMessage(bridgeId, apiTS);
    String requestMessageString = gson.toJson(message);
    httpClient.sendBridgeAlive(keepAliveEventUrl, token, requestMessageString,
        new CallStatsHttp2ResponseListener() {
          public void onResponse(Response response) {
            int responseStatus = response.code();
            BridgeKeepAliveResponse keepAliveResponse;
            try {
              String responseString = response.body().string();
              keepAliveResponse = gson.fromJson(responseString, BridgeKeepAliveResponse.class);
            } catch (IOException e) {
              e.printStackTrace();
              throw new RuntimeException(e);
            } catch (JsonSyntaxException e) {
              logger.error("Json Syntax Exception " + e.getMessage(), e);
              e.printStackTrace();
              throw new RuntimeException(e);
            }
            httpClient.setDisrupted(false);
            if (responseStatus == CallStatsResponseStatus.RESPONSE_STATUS_SUCCESS) {
              keepAliveStatusListener.onSuccess();

            } else if (responseStatus == CallStatsResponseStatus.INVALID_AUTHENTICATION_TOKEN) {
              stopKeepAliveSender();
              keepAliveStatusListener.onKeepAliveError(CallStatsErrors.AUTH_ERROR,
                  keepAliveResponse.getMsg());
            } else {
              httpClient.setDisrupted(true);
            }
          }

          public void onFailure(Exception e) {
            logger.info("Response exception " + e.toString());
            httpClient.setDisrupted(true);
          }

        });
  }