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

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


      Long users_id = sessiondataDao.checkSession(SID);
      Long user_level = userManager.getUserLevelByID(users_id);
      // users only
      if (authLevelUtil.checkUserLevel(user_level)) {

        Client rcl = this.sessionManager.getClientByPublicSID(
            publicSID, false, 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,
            rcl.getStreamid(), currentScope);

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

        return true;
View Full Code Here


      for (Set<IConnection> conset : conCollection) {
        for (IConnection conn : conset) {
          if (conn != null) {
            if (conn instanceof IServiceCapableConnection) {

              Client rcl = sessionManager.getClientByStreamId(
                      conn.getClient().getId(), null);

              // FIXME: Check if this function is really in use at
              // the moment
              // if (!rcl.getIsScreenClient()) {
              // ((IServiceCapableConnection)
              // conn).invoke("stoppedRecording",new Object[] {
              // currentClient }, this);
              // }

              log.debug("is this users still alive? stop it :" + rcl);

              if (rcl.getIsScreenClient()) {

                if (rcl.getFlvRecordingId() != null
                    && rcl.isScreenPublishStarted()) {

                  // Stop FLV Recording
                  stopRecordingShow(conn,
                      rcl.getStreamPublishName(),
                      rcl.getFlvRecordingMetaDataId());

                  // Update Meta Data
                  this.flvRecordingMetaDataDao
                      .updateFlvRecordingMetaDataEndDate(
                          rcl.getFlvRecordingMetaDataId(),
                          new Date());
                }

              } else if (rcl.getIsAVClient()
                  && (rcl.getAvsettings().equals("av")
                  || rcl.getAvsettings().equals("a")
                  || rcl.getAvsettings().equals("v"))) {

                stopRecordingShow(conn,
                    String.valueOf(rcl.getBroadCastID())
                        .toString(),
                    rcl.getFlvRecordingMetaDataId());

                // Update Meta Data
                this.flvRecordingMetaDataDao
                    .updateFlvRecordingMetaDataEndDate(
                        rcl.getFlvRecordingMetaDataId(),
                        new Date());

              }

            }
View Full Code Here

      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();

      log.debug("getCurrentRoomClient -2- " + streamid);

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

      log.debug("getCurrentRoomClient -#########################- "
          + currentClient.getRoom_id());

      for (Client rcl : sessionManager.getClientListByRoomAll(currentClient.getRoom_id())) {
        if (rcl.getIsRecording()) {
          return rcl;
        }
      }
View Full Code Here

      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();

      log.debug("getCurrentRoomClient -2- " + streamid);

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

      for (Client rcl : sessionManager.getClientListByRoom(currentClient.getRoom_id())) {
        if (rcl.getIsRecording()) {
          return rcl;
        }
      }
View Full Code Here

    try {
     
      log.debug(":: recordMeetingStream ::");

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

      Date now = new Date();

      // Receive flvRecordingId
      Long flvRecordingId = this.flvRecordingDaoImpl.addFlvRecording("",
          roomRecordingName, null, currentClient.getUser_id(),
          room_id, now, null, currentClient.getUser_id(), comment,
          currentClient.getStreamid(), currentClient.getVWidth(),
          currentClient.getVHeight(), isInterview);

      // Update Client and set Flag
      currentClient.setIsRecording(true);
      currentClient.setFlvRecordingId(flvRecordingId);
      this.sessionManager.updateClientByStreamId(current.getClient()
          .getId(), currentClient, false, null);

      // get all stream and start recording them
      Collection<Set<IConnection>> conCollection = current.getScope()
          .getConnections();
      for (Set<IConnection> conset : conCollection) {
        for (IConnection conn : conset) {
          if (conn != null) {
            if (conn instanceof IServiceCapableConnection) {
              Client rcl = this.sessionManager
                  .getClientByStreamId(conn.getClient()
                      .getId(), null);

              // Send every user a notification that the recording did start
              if (!rcl.getIsAVClient()) {
                ((IServiceCapableConnection) conn).invoke(
                    "startedRecording",
                    new Object[] { currentClient }, this);
              }

              // If its the recording client we need another type
              // of Meta Data
              if (rcl.getIsScreenClient()) {

                if (rcl.getFlvRecordingId() != null
                    && rcl.isScreenPublishStarted()) {

                  String streamName_Screen = generateFileName(
                      flvRecordingId, rcl
                          .getStreamPublishName()
                          .toString());

                  Long flvRecordingMetaDataId = this.flvRecordingMetaDataDao
                      .addFlvRecordingMetaData(
                          flvRecordingId,
                          rcl.getFirstname() + " "
                              + rcl.getLastname(),
                          now, false, false, true,
                          streamName_Screen,
                          rcl.getInterviewPodId());

                  // Start FLV Recording
                  recordShow(conn,
                      rcl.getStreamPublishName(),
                      streamName_Screen,
                      flvRecordingMetaDataId, true,
                      isInterview);

                  // Add Meta Data
                  rcl.setFlvRecordingMetaDataId(flvRecordingMetaDataId);

                  this.sessionManager
                      .updateClientByStreamId(
                          rcl.getStreamid(), rcl, false, null);

                }

              } else if
              // if the user does publish av, a, v
              // But we only record av or a, video only is not
              // interesting
              (rcl.getIsAVClient() &&
                  (rcl.getAvsettings().equals("av")
                  || rcl.getAvsettings().equals("a")
                  || rcl.getAvsettings().equals("v"))) {

                String streamName = generateFileName(
                    flvRecordingId,
                    String.valueOf(rcl.getBroadCastID())
                        .toString());

                // Add Meta Data
                boolean isAudioOnly = false;
                if (rcl.getAvsettings().equals("a")) {
                  isAudioOnly = true;
                }

                boolean isVideoOnly = false;
                if (rcl.getAvsettings().equals("v")) {
                  isVideoOnly = true;
                }

                Long flvRecordingMetaDataId = this.flvRecordingMetaDataDao
                    .addFlvRecordingMetaData(
                        flvRecordingId,
                        rcl.getFirstname() + " "
                            + rcl.getLastname(),
                        now, isAudioOnly, isVideoOnly,
                        false, streamName,
                        rcl.getInterviewPodId());

                rcl.setFlvRecordingMetaDataId(flvRecordingMetaDataId);

                this.sessionManager.updateClientByStreamId(
                    rcl.getStreamid(), rcl, false, null);

                // Start FLV recording
                recordShow(conn,
                    String.valueOf(rcl.getBroadCastID())
                        .toString(), streamName,
                    flvRecordingMetaDataId, false,
                    isInterview);

              }
View Full Code Here

      String port = request.getParameter("port");
      if (port == null) {
        throw new Exception("port is empty: ");
      }
      Client rc = sessionManager.getClientByPublicSID(publicSID, false, null);
      if (rc == null) {
        throw new Exception("port is empty: ");
      }
      Long roomId = rc.getRoom_id();
      boolean allowRecording = rc.getAllowRecording()
        && (0 == sessionManager.getRecordingCount(roomId));
      boolean allowPublishing = (0 == sessionManager
          .getPublishingCount(roomId));
     
      Context ctx = new VelocityContext();
View Full Code Here

      server.setName("Test Server");
      server.setActive(true);
      serverDao.update(server, null);
    }

    Client cl1 = new Client();
    cl1.setStreamid("1");
    cl1.setServer(null);
    cl1.setUser_id(1L);
    cl1.setRoom_id(1L);
    cl1.setPublicSID("public1");
    clientDao.add(cl1);

    Client cl2 = new Client();
    cl2.setStreamid("2");
    cl2.setServer(null);
    cl2.setRoom_id(1L);
    cl2.setUser_id(2L);
    cl2.setPublicSID("public2");
    clientDao.add(cl2);

    Client cl3 = new Client();
    cl3.setStreamid("3");
    cl3.setServer(server);
    cl3.setRoom_id(3L);
    cl3.setUser_id(3L);
    cl3.setPublicSID("public3");
    clientDao.add(cl3);
   
    Client clTest = clientDao.getClientByServerAndStreamId(null, "1");

    log.debug("cl1 " + cl1);
    log.debug("clTest " + clTest);

    assertEquals(clTest.getId(), cl1.getId());

    Client clTest3 = clientDao.getClientByServerAndStreamId(server, "3");

    log.debug("cl3 " + cl3);
    log.debug("clTest3 " + clTest3);

    assertEquals(clTest3.getId(), cl3.getId());

    Client clTest_NOT_3 = clientDao.getClientByServerAndStreamId(null, "3");

    log.debug("clTest_NOT_3 " + clTest_NOT_3);
    assertEquals(null, clTest_NOT_3);
   
    long numberOfClients1 = clientDao.countClientsByServerAndStreamId(null, "1");
View Full Code Here

      server.setName("Test Server");
      server.setActive(true);
      serverDao.update(server, null);
    }

    Client cl1 = new Client();
    cl1.setStreamid("1");
    cl1.setServer(server);
    cl1.setUser_id(1L);
    cl1.setRoom_id(1L);
    cl1.setPublicSID("public1");
    clientDao.add(cl1);

    Client cl2 = new Client();
    cl2.setStreamid("2");
    cl2.setServer(server);
    cl2.setRoom_id(1L);
    cl2.setUser_id(2L);
    cl2.setPublicSID("public2");
    clientDao.add(cl2);

    Client cl3 = new Client();
    cl3.setStreamid("3");
    cl3.setServer(server);
    cl3.setRoom_id(3L);
    cl3.setUser_id(3L);
    cl3.setPublicSID("public3");
    clientDao.add(cl3);
   
    List<Long> roomids = clientDao.getRoomsIdsByServer(server);

    assertEquals(2, roomids.size());
View Full Code Here

      String streamid = current.getClient().getId();

      log.debug("getCurrentRoomClient -1- " + SID);
      log.debug("getCurrentRoomClient -2- " + streamid);

      Client currentClient = this.sessionManager
          .getClientByStreamId(streamid, null);
      return currentClient;
    } catch (Exception err) {
      log.error("[getCurrentRoomClient]", err);
    }
View Full Code Here

  }

  public User loginByRemember(String SID, String remoteHashId) {
    try {

      Client currentClient;
      IConnection current = Red5.getConnectionLocal();

      User o = null;

      currentClient = sessionManager.getClientByStreamId(current
          .getClient().getId(), null);

      o = userManager.loginUserByRemoteHash(SID, remoteHashId);

      if (o == null)
        return null;

      if (o.getOrganisation_users().isEmpty()) {
        throw new Exception("Users has no organization assigned");
      }

      o.setSessionData(sessiondataDao.getSessionByHash(remoteHashId));
      currentClient.setUser_id(o.getUser_id());
      SessionVariablesUtil.setUserId(current.getClient(), o.getUser_id());
     
      if (currentClient.getUser_id() != null
          && currentClient.getUser_id() > 0) {

        currentClient.setFirstname(o.getFirstname());
        currentClient.setLastname(o.getLastname());
       
        scopeApplicationAdapter.syncMessageToCurrentScope("roomConnect", currentClient, false);

      }
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.