Examples of IConnection


Examples of org.red5.server.api.IConnection

   *
   */
  public synchronized void streamPublishStart(IBroadcastStream stream) {
    try {

      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
           
      // Notify all the clients that the stream had been started
      log.debug("start streamPublishStart broadcast start: "+ stream.getPublishedName() + "CONN " + current);
     
      //In case its a screen sharing we start a new Video for that
      if (currentClient.getIsScreenClient()) {
       
        currentClient.setScreenPublishStarted(true);
       
        this.clientListManager.updateClientByStreamId(current.getClient().getId(), currentClient);
       
      }

      //Notify all users of the same Scope
      //We need to iterate through the streams to cathc if anybody is recording
      Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
      for (Set<IConnection> conset : conCollection) {
        for (IConnection conn : conset) {
          if (conn != null) {
            if (conn instanceof IServiceCapableConnection) {
              if (conn.equals(current)){
View Full Code Here

Examples of org.red5.server.api.IConnection

   */ 
  private synchronized void sendClientBroadcastNotifications(IBroadcastStream stream,String clientFunction, RoomClient rc){
    try {

      // Store the local so that we do not send notification to ourself back
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
       
      if (currentClient == null) {
       
        //In case the client has already left(kicked) this message might be thrown later then the RoomLeave
        //event and the currentClient is already gone
        //The second Use-Case where the currentClient is maybe null is if we remove the client because its a Zombie/Ghost
       
        return;
       
      }
      // Notify all the clients that the stream had been started
      log.debug("sendClientBroadcastNotifications: "+ stream.getPublishedName());
      log.debug("sendClientBroadcastNotifications : "+ currentClient+ " " + currentClient.getStreamid());
     
      //Notify all clients of the same scope (room)
      Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
      for (Set<IConnection> conset : conCollection) {
        for (IConnection conn : conset) {
          if (conn != null) {
            if (conn instanceof IServiceCapableConnection) {
              if (conn.equals(current)){
                //there is a Bug in the current implementation of the appDisconnect
                if (clientFunction.equals("closeStream")){
                  RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
                  if (clientFunction.equals("closeStream") && rcl.getIsRecording()){
                    log.debug("*** sendClientBroadcastNotifications Any Client is Recording - stop that");
                    //StreamService.stopRecordingShowForClient(conn, currentClient, rcl.getRoomRecordingName(), false);
                    this.flvRecorderService.stopRecordingShowForClient(conn, currentClient);
                  }
                  // Don't notify current client
                  current.ping();
                }
                continue;
              } else {
                RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
                if (rcl != null){
View Full Code Here

Examples of org.red5.server.api.IConnection

  public synchronized Long addModerator(String publicSID) {
    try {
     
      log.debug("*..*addModerator publicSID: " + publicSID);
     
      IConnection current = Red5.getConnectionLocal();
      //String streamid = current.getClient().getId();
     
      RoomClient currentClient = this.clientListManager.getClientByPublicSID(publicSID);
     
      if (currentClient == null) {
        return -1L;
      }
      Long room_id = currentClient.getRoom_id();
     
      currentClient.setIsMod(true);
      //Put the mod-flag to true for this client
      this.clientListManager.updateClientByStreamId(currentClient.getStreamid(), currentClient);
     
      List<RoomClient> currentMods = this.clientListManager.getCurrentModeratorByRoom(room_id);
     
      //Notify all clients of the same scope (room)
      Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
      for (Set<IConnection> conset : conCollection) {
        for (IConnection conn : conset) {
          if (conn != null) {
            RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
           
View Full Code Here

Examples of org.red5.server.api.IConnection

  }
 
  public void setNewCursorPosition(Object item) {
    try {
     
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
     
      //log.debug("[setNewCursorPosition]"+item);
     
      Map cursor = (Map) item;
      cursor.put("streamPublishName",currentClient.getStreamPublishName());
     
      //log.debug("[setNewCursorPosition x]"+cursor.get("cursor_x"));
      //log.debug("[setNewCursorPosition y]"+cursor.get("cursor_y"));
      //log.debug("[setNewCursorPosition publicSID]"+cursor.get("publicSID"));
     
      //Notify all users of the same Scope
      Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
      for (Set<IConnection> conset : conCollection) {
        for (IConnection conn : conset) {
          if (conn != null) {
            if (conn instanceof IServiceCapableConnection) {
              if (conn.equals(current)){
View Full Code Here

Examples of org.red5.server.api.IConnection

  public synchronized Long removeModerator(String publicSID) {
    try {
     
      log.debug("*..*addModerator publicSID: " + publicSID);
     
      IConnection current = Red5.getConnectionLocal();
      //String streamid = current.getClient().getId();
     
      RoomClient currentClient = this.clientListManager.getClientByPublicSID(publicSID);
     
      if (currentClient == null) {
        return -1L;
      }
      Long room_id = currentClient.getRoom_id();
     
      currentClient.setIsMod(false);
      //Put the mod-flag to true for this client
      this.clientListManager.updateClientByStreamId(currentClient.getStreamid(), currentClient);
     
      List<RoomClient> currentMods = this.clientListManager.getCurrentModeratorByRoom(room_id);
     
      //Notify all clients of the same scope (room)
      Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
      for (Set<IConnection> conset : conCollection) {
        for (IConnection conn : conset) {
          if (conn != null) {
            RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
            if (rcl == null) {
View Full Code Here

Examples of org.red5.server.api.IConnection

  public synchronized Long setBroadCastingFlag(String publicSID, boolean value, Integer interviewPodId) {
    try {
     
      log.debug("*..*setBroadCastingFlag publicSID: " + publicSID);
     
      IConnection current = Red5.getConnectionLocal();
      //String streamid = current.getClient().getId();
     
      RoomClient currentClient = this.clientListManager.getClientByPublicSID(publicSID);
     
      if (currentClient == null) {
        return -1L;
      }
     
      currentClient.setIsBroadcasting(value);
      currentClient.setInterviewPodId(interviewPodId);
     
      //Put the mod-flag to true for this client
      this.clientListManager.updateClientByStreamId(currentClient.getStreamid(), currentClient);
     
      //Notify all clients of the same scope (room)
      Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
      for (Set<IConnection> conset : conCollection) {
        for (IConnection conn : conset) {
          if (conn != null) {
            RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
            if (rcl == null) {
View Full Code Here

Examples of org.red5.server.api.IConnection

   * @return Long 1 => means get Moderation, 2 => ask Moderator for Moderation, 3 => wait for Moderator
   */
  public synchronized Long applyForModeration(String publicSID) {
    try {
     
      IConnection current = Red5.getConnectionLocal();
      //String streamid = current.getClient().getId();
     
      RoomClient currentClient = this.clientListManager.getClientByPublicSID(publicSID);
     
      List<RoomClient> currentModList = this.clientListManager.getCurrentModeratorByRoom(currentClient.getRoom_id());
View Full Code Here

Examples of org.serviceconnector.net.connection.IConnection

  /** {@inheritDoc} */
  @Override
  protected void channelIdle(ChannelHandlerContext ctx, IdleState state, long lastActivityTimeMillis)
      throws Exception {
    super.channelIdle(ctx, state, lastActivityTimeMillis);
    IConnection connection = this.connectionContext.getConnection();
    if (ConnectionLogger.isEnabledFull()) {
      ConnectionLogger.logKeepAlive(this.getClass().getSimpleName(), connection.getHost(), 0, this.connectionContext
          .getConnection().getNrOfIdlesInSequence());
    }
    IIdleConnectionCallback callback = this.connectionContext.getIdleCallback();
    callback.connectionIdle(connection);
  }
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.