Package org.red5.server.messaging

Examples of org.red5.server.messaging.IPipeConnectionListener


   * @param newMessage
   * @return
   */
  public int sendMessageToOverallChat(Object newMessage) {
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
     
      //log.error(newMessage.getClass().getName());
      ArrayList messageMap = (ArrayList) newMessage;
      //adding delimiter space, cause otherwise an emoticon in the last string would not be found
      String messageText = messageMap.get(4).toString()+" ";
      //log.error("messageText"+messageText);
      //add server time
      messageMap.set(1,parseDateAsTimeString());
      LinkedList<String[]> parsedStringObjects = ChatString.getInstance().parseChatString(messageText);
      //log.error("parsedStringObjects"+parsedStringObjects.size());
      log.debug("size:" + messageMap.size());
      messageMap.add(parsedStringObjects);
      newMessage = messageMap;
     
     
      HashMap<String,Object> hsm = new HashMap<String,Object>();
      hsm.put("client", currentClient);
      hsm.put("message", newMessage);
     
      List<HashMap<String,Object>> myChatList = myChats.get(overallChatRoomName);
      if (myChatList==null) myChatList = new LinkedList<HashMap<String,Object>>();
     
      if (myChatList.size()==chatRoomHistory) myChatList.remove(0);
      myChatList.add(hsm);
      myChats.put(overallChatRoomName,myChatList);
     
      log.debug("SET CHATROOM: "+overallChatRoomName);
     
      //broadcast to everybody in the room/domain
      Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
      for (Set<IConnection> conset : conCollection) {
          for (IConnection conn : conset) {
            if (conn != null) {
              if (conn instanceof IServiceCapableConnection) {
     
View Full Code Here


   * Loading the List of Objects on the whiteboard
   * @return HashMap<String,Map>
   */
  public WhiteboardObject getRoomItems(){
    try {
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
      Long room_id = currentClient.getRoom_id();
     
      log.debug("getRoomItems: "+room_id);
     
View Full Code Here

  }
 
  public Long getNewWhiteboardId() {
    try {
     
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
      Long room_id = currentClient.getRoom_id();
     
     
      Long whiteBoardId =  this.whiteBoardObjectListManagerById.getNewWhiteboardId(room_id);
View Full Code Here

    return null;
  }
 
  public Boolean deleteWhiteboard(Long whiteBoardId) {
    try {
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
      Long room_id = currentClient.getRoom_id();
     
      WhiteboardObjectList whiteboardObjectList = this.whiteBoardObjectListManagerById.getWhiteBoardObjectListByRoomId(room_id);
   
View Full Code Here

    return null;
  }
 
  public WhiteboardObjectList getRoomItemsBy(){
    try {
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
      Long room_id = currentClient.getRoom_id();
     
      log.debug("getRoomItems: "+room_id);
      WhiteboardObjectList whiteboardObjectList = this.whiteBoardObjectListManagerById.getWhiteBoardObjectListByRoomId(room_id);
View Full Code Here

   * @return
   */
  public Boolean setCanDraw(String SID, String publicSID, boolean canDraw) {
    try {
     
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
     
      Long users_id = Sessionmanagement.getInstance().checkSession(SID);
          Long user_level = Usermanagement.getInstance().getUserLevelByID(users_id);
         
View Full Code Here

  }
 
  public Boolean setCanShare(String SID, String publicSID, boolean canShare) {
    try {
     
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
     
      Long users_id = Sessionmanagement.getInstance().checkSession(SID);
          Long user_level = Usermanagement.getInstance().getUserLevelByID(users_id);
         
View Full Code Here

  }
 
  public Boolean setCanRemote(String SID, String publicSID, boolean canRemote) {
    try {
     
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
     
      Long users_id = Sessionmanagement.getInstance().checkSession(SID);
          Long user_level = Usermanagement.getInstance().getUserLevelByID(users_id);
         
View Full Code Here

  }
 
  public WhiteboardSyncLockObject startNewSyncprocess(){
    try {
     
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
      Long room_id = currentClient.getRoom_id();
     
      WhiteboardSyncLockObject wSyncLockObject = new WhiteboardSyncLockObject();
      wSyncLockObject.setAddtime(new Date());
      wSyncLockObject.setPublicSID(currentClient.getPublicSID());
      wSyncLockObject.setInitialLoaded(true);
     
      Map<String,WhiteboardSyncLockObject> syncListRoom = this.whiteBoardObjectListManager.getWhiteBoardSyncListByRoomid(room_id);
     

      wSyncLockObject.setCurrentLoadingItem(true);
      wSyncLockObject.setStarttime(new Date());
   
      syncListRoom.put(currentClient.getPublicSID(), wSyncLockObject);
      this.whiteBoardObjectListManager.setWhiteBoardSyncListByRoomid(room_id, syncListRoom);
     
      Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
      for (Set<IConnection> conset : conCollection) {
        for (IConnection conn : conset) {
          if (conn != null) {
            if (conn instanceof IServiceCapableConnection) {
              RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
View Full Code Here

  }
 
  public void sendCompletedSyncEvent() {
    try {
     
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
      Long room_id = currentClient.getRoom_id();
     
      Map<String,WhiteboardSyncLockObject> syncListRoom = this.whiteBoardObjectListManager.getWhiteBoardSyncListByRoomid(room_id);

      WhiteboardSyncLockObject wSyncLockObject = syncListRoom.get(currentClient.getPublicSID());
     
      if (wSyncLockObject == null) {
        log.error("WhiteboardSyncLockObject not found for this Client "+syncListRoom);
        return;
      } else if (!wSyncLockObject.isCurrentLoadingItem()) {
        log.warn("WhiteboardSyncLockObject was not started yet "+syncListRoom);
        return;
      } else {
        syncListRoom.remove(currentClient.getPublicSID());
        this.whiteBoardObjectListManager.setWhiteBoardSyncListByRoomid(room_id, syncListRoom);
       
        int numberOfInitial = this.getNumberOfInitialLoaders(syncListRoom);
       
        if (numberOfInitial==0){
          int returnVal = 0;
          Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
          for (Set<IConnection> conset : conCollection) {
            for (IConnection conn : conset) {
              if (conn != null) {
                if (conn instanceof IServiceCapableConnection) {
                  RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
View Full Code Here

TOP

Related Classes of org.red5.server.messaging.IPipeConnectionListener

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.