Package org.apache.openmeetings.persistence.beans.room

Examples of org.apache.openmeetings.persistence.beans.room.Client


    public Boolean setCanGiveAudio(String SID, String publicSID, boolean canGiveAudio) {
    try {
            log.debug("[setCanGiveAudio] " + SID + ", " + publicSID + ", " + canGiveAudio);
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      Client currentClient = this.sessionManager
          .getClientByStreamId(streamid, null);

      Long users_id = sessiondataDao.checkSession(SID);
      Long user_level = userManager.getUserLevelByID(users_id);

      if (authLevelUtil.checkUserLevel(user_level)) {
        if (currentClient.getIsMod()) {
          Client rcl = this.sessionManager
              .getClientByPublicSID(publicSID, false, null);

          if (rcl != null) {
            rcl.setCanGiveAudio(canGiveAudio);
                this.sessionManager.updateClientByStreamId(
                        rcl.getStreamid(), rcl, false, null);

                HashMap<Integer, Object> newMessage = new HashMap<Integer, Object>();
                newMessage.put(0, "updateGiveAudioStatus");
                newMessage.put(1, rcl);
                this.scopeApplicationAdapter
View Full Code Here


   * @return all ClientList Objects of that room
   */
  public synchronized List<Client> getClientListScope() {
    try {
      IConnection current = Red5.getConnectionLocal();
      Client currentClient = this.sessionManager
          .getClientByStreamId(current.getClient().getId(), null);

      return sessionManager.getClientListByRoom(currentClient.getRoom_id());

    } catch (Exception err) {
      log.debug("[getClientListScope]", err);
    }
    return new ArrayList<Client>();
View Full Code Here

  public WhiteboardSyncLockObject startNewSyncprocess() {
    try {

      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      Client currentClient = this.sessionManager
          .getClientByStreamId(streamid, null);
      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);
     
      //Sync to clients
      this.scopeApplicationAdapter.syncMessageToCurrentScope("sendSyncFlag", wSyncLockObject, true);
View Full Code Here

 
    public synchronized int updateSipTransport() {
    log.debug("-----------  updateSipTransport");
        IConnection current = Red5.getConnectionLocal();
        String streamid = current.getClient().getId();
        Client client = sessionManager.getClientByStreamId(streamid, null);
        Long roomId = client.getRoom_id();
        Integer count = roomManager.getSipConferenceMembersNumber(roomId);
        String newNumber = getSipTransportLastname(roomId, count);
        log.debug("getSipConferenceMembersNumber: " + newNumber);
        if (!newNumber.equals(client.getLastname())) {
            client.setLastname(newNumber);
            sessionManager.updateClientByStreamId(streamid, client, false, null);
            log.debug("updateSipTransport: {}, {}, {}, {}, {}", new Object[]{client.getPublicSID(),
                    client.getRoom_id(), client.getFirstname(), client.getLastname(), client.getAvsettings()});
            sendMessageWithClient(new String[]{"personal",client.getFirstname(),client.getLastname()});
        }
        return count != null && count > 0 ? count - 1 : 0;
    }
View Full Code Here

  public void sendCompletedSyncEvent() {
    try {

      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      Client currentClient = this.sessionManager
          .getClientByStreamId(streamid, null);
      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);
View Full Code Here

      log.debug("startNewObjectSyncprocess: " + object_id);

      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      Client currentClient = this.sessionManager
          .getClientByStreamId(streamid, null);
      Long room_id = currentClient.getRoom_id();

      WhiteboardSyncLockObject wSyncLockObject = new WhiteboardSyncLockObject();
      wSyncLockObject.setAddtime(new Date());
      wSyncLockObject.setPublicSID(currentClient.getPublicSID());
      wSyncLockObject.setStarttime(new Date());

      Map<String, WhiteboardSyncLockObject> syncListImage = this.whiteBoardObjectListManager
          .getWhiteBoardObjectSyncListByRoomAndObjectId(room_id,
              object_id);
      syncListImage.put(currentClient.getPublicSID(), wSyncLockObject);
      this.whiteBoardObjectListManager
          .setWhiteBoardImagesSyncListByRoomAndObjectId(room_id,
              object_id, syncListImage);

      // Do only send the Token to show the Loading Splash for the
View Full Code Here

      log.debug("sendCompletedObjectSyncEvent: " + object_id);

      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      Client currentClient = this.sessionManager
          .getClientByStreamId(streamid, null);
      Long room_id = currentClient.getRoom_id();

      Map<String, WhiteboardSyncLockObject> syncListImage = this.whiteBoardObjectListManager
          .getWhiteBoardObjectSyncListByRoomAndObjectId(room_id,
              object_id);

      log.debug("sendCompletedObjectSyncEvent syncListImage: "
          + syncListImage);

      WhiteboardSyncLockObject wSyncLockObject = syncListImage
          .get(currentClient.getPublicSID());

      if (wSyncLockObject == null) {
        log.error("WhiteboardSyncLockObject not found for this Client "
            + currentClient.getPublicSID());
        log.error("WhiteboardSyncLockObject not found for this syncListImage "
            + syncListImage);
        return -2;

      } else {

        log.debug("sendCompletedImagesSyncEvent remove: "
            + currentClient.getPublicSID());

        syncListImage.remove(currentClient.getPublicSID());
        this.whiteBoardObjectListManager
            .setWhiteBoardImagesSyncListByRoomAndObjectId(room_id,
                object_id, syncListImage);

        int numberOfInitial = this.whiteBoardObjectListManager
View Full Code Here

     * @param number to call
     */
  public synchronized void joinToConfCall(String number) {
    IConnection current = Red5.getConnectionLocal();
    String streamid = current.getClient().getId();
    Client currentClient = sessionManager.getClientByStreamId(streamid, null);
    try {
      String sipNumber = getSipNumber(currentClient.getRoom_id());
      log.debug("asterisk -rx \"originate Local/" + number + "@rooms-out extension " + sipNumber
          + "@rooms-originate\"");
      Runtime.getRuntime().exec(
          new String[] { "asterisk", "-rx",
              "originate Local/" + number + "@rooms-out extension " + sipNumber + "@rooms-originate" });
View Full Code Here

    log.debug("-----------  setSipTransport");
    IConnection current = Red5.getConnectionLocal();
    IClient c = current.getClient();
    String streamid = c.getId();
    // Notify all clients of the same scope (room)
    Client currentClient = sessionManager.getClientByStreamId(streamid, null);
    currentClient.setSipTransport(true);
    currentClient.setRoom_id(room_id);
    currentClient.setRoomEnter(new Date());
    currentClient.setFirstname("SIP Transport");
    currentClient.setLastname(getSipTransportLastname(room_id));
    currentClient.setBroadCastID(Long.parseLong(broadCastId));
    currentClient.setIsBroadcasting(true);
    currentClient.setPublicSID(publicSID);
    currentClient.setVWidth(120);
    currentClient.setVHeight(90);
    currentClient.setPicture_uri("phone.png");
    sessionManager.updateClientByStreamId(streamid, currentClient, false, null);
    SessionVariablesUtil.initClient(c, false, publicSID);

    Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
    for (Set<IConnection> conset : conCollection) {
View Full Code Here

      // admins only
      if (authLevelUtil.checkAdminLevel(user_level)) {

        if (serverId == 0) {

          Client rcl = this.sessionManager
              .getClientByStreamId(streamid, null);

          if (rcl == null) {
            return true;
          }
          String scopeName = "hibernate";
          if (rcl.getRoom_id() != null) {
            scopeName = rcl.getRoom_id().toString();
          }
          IScope currentScope = this.scopeApplicationAdapter
              .getRoomScope(scopeName);

          HashMap<Integer, String> messageObj = new HashMap<Integer, String>();
          messageObj.put(0, "kick");
          this.scopeApplicationAdapter.sendMessageById(messageObj,
              streamid, currentScope);

          this.scopeApplicationAdapter.roomLeaveByScope(rcl,
              currentScope, true);

          return true;

        } else {

          Server server = serverDao.get(serverId);
          Client rcl = sessionManager.getClientByStreamId(
              streamid, server);
          slaveHTTPConnectionManager.kickSlaveUser(server, rcl.getPublicSID());
         
          // true means only the REST call is performed, it is no
          // confirmation that the user is really kicked from the
          // slave
          return true;
View Full Code Here

TOP

Related Classes of org.apache.openmeetings.persistence.beans.room.Client

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.