Package org.red5.server.api.so

Examples of org.red5.server.api.so.ISharedObject


 

  public Long _clientCancelRecording(String roomrecordingName){
    try {
     
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
      Long room_id = currentClient.getRoom_id();
      currentClient.setIsRecording(false);
      currentClient.setRoomRecordingName("");
      this.clientListManager.updateClientByStreamId(current.getClient().getId(), currentClient);
     
      RoomRecording roomRecording = roomRecordingList.get(roomrecordingName);
      String conferenceType = roomRecording.getConferenceType();
     
      //get all stream and stop recording them
      //Todo: Check that nobody does Recording at the same time Issue 253
      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


   * @deprecated
   * @return
   */
  public RoomClient checkForRecording(){
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
      Long room_id = currentClient.getRoom_id();
     
      //Check if any client in the same room is recording at the moment
     
      Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
      for (Set<IConnection> conset : conCollection) {
        for (IConnection cons : conset) {
          if (cons != null) {
            if (cons instanceof IServiceCapableConnection) {
              if (!cons.equals(current)){
View Full Code Here

  public boolean roomJoin(IClient client, IScope room) {
    log.debug("roomJoin : ");
   
    try {
     
      IConnection conn = Red5.getConnectionLocal();
      IServiceCapableConnection service = (IServiceCapableConnection) conn;
      String streamId = client.getId();
     
      log.debug("### Client connected to OpenMeetings, register Client StreamId: "
          + streamId + " scope "+ room.getName() );
     
      //Set StreamId in Client
      service.invoke("setId", new Object[] { streamId },this);

      String swfURL = "";
      if (conn.getConnectParams().get("swfUrl") != null) {
        swfURL = conn.getConnectParams().get("swfUrl").toString();
      }
     
      RoomClient rcm = this.clientListManager.addClientListItem(streamId, room.getName(), conn.getRemotePort(),
          conn.getRemoteAddress(), swfURL);
     
      //Log the User
      ConferenceLogDaoImpl.getInstance().addConferenceLog("ClientConnect", rcm.getUser_id(),
          streamId, null, rcm.getUserip(), rcm.getScope(),
          rcm.getExternalUserId(), rcm.getExternalUserType(),
View Full Code Here

          }
          String scopeName = "hibernate";
          if (rcl.getRoom_id() != null) {
            scopeName = rcl.getRoom_id().toString();
          }
          IScope currentScope = ScopeApplicationAdapter.getInstance()
              .getRoomScope(scopeName);
          ScopeApplicationAdapter.getInstance().roomLeaveByScope(rcl,
              currentScope);

          HashMap<Integer, String> messageObj = new HashMap<Integer, String>();
View Full Code Here

        String scopeName = "hibernate";
        if (rcl.getRoom_id() != null) {
          scopeName = rcl.getRoom_id().toString();
        }
        IScope currentScope = ScopeApplicationAdapter.getInstance()
            .getRoomScope(scopeName);
        ScopeApplicationAdapter.getInstance().roomLeaveByScope(rcl,
            currentScope);

        HashMap<Integer, String> messageObj = new HashMap<Integer, String>();
View Full Code Here

         }
         String scopeName = "hibernate";
         if (rcl.getRoom_id() != null) {
           scopeName = rcl.getRoom_id().toString();
         }
         IScope currentScope = this.scopeApplicationAdapter.getRoomScope(scopeName);
         this.scopeApplicationAdapter.roomLeaveByScope(rcl, currentScope);
        
        
         HashMap<Integer,String> messageObj = new HashMap<Integer,String>();
         messageObj.put(0, "kick");
View Full Code Here

          }
          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);
View Full Code Here

    // ------------------------------------------------------------------------

    private void createPlayStream( IPendingServiceCallback callback ) {

        logger.debug( "create play stream" );
        IPendingServiceCallback wrapper = new CreatePlayStreamCallBack( callback );
        invoke( "createStream", null, wrapper );
    }
View Full Code Here

          log.debug("Shared object create failed");
          sendSOCreationFailed(conn, message);
          return;
        }
      }
      ISharedObject so = sharedObjectService.getSharedObject(scope, name);
      if (so != null) {
        if (so.isPersistent() == persistent) {
          log.debug("Dispatch persistent shared object");
          so.dispatchEvent(message);
        } else {
          log.warn("Shared object persistence mismatch - current: {} incoming: {}", so.isPersistent(), persistent);
          // reset the object so we can re-use it
          message.reset();
          // add the error event
          message.addEvent(new SharedObjectEvent(ISharedObjectEvent.Type.CLIENT_STATUS, "error", SO_PERSISTENCE_MISMATCH));
          conn.getChannel(3).write(message);
View Full Code Here

      assertTrue(app.createChildScope("mt"));
      room = ScopeUtils.resolveScope(appScope, "/junit/mt");
    }
    // create the SO
    assertTrue(app.createSharedObject(room, "mtSO", persistent));
    ISharedObject so = app.getSharedObject(room, "mtSO");
    // acquire only works with non-persistent so's
    if (!persistent) {
      so.acquire();
      assertTrue(so.isAcquired());
    }
    // test runnables represent clients
    trs = new TestRunnable[21];
    for (int t = 0; t < trs.length; t++) {
      trs[t] = new ScopeClientWorker(t, app, room);
    }
    MultiThreadedTestRunner mttr = new MultiThreadedTestRunner(trs);
    // fires off threads
    long start = System.nanoTime();
    mttr.runTestRunnables();
    System.out.println("Runtime: " + (System.nanoTime() - start) + "ns");
    // go to sleep
    try {
      Thread.sleep(3000);
    } catch (Exception e) {
    }
    for (TestRunnable r : trs) {
      ScopeClientWorker cl = (ScopeClientWorker) r;
      log.debug("Worker: {} shared object: {}", cl.getId(), cl.getSharedObject().getAttributes());
    }
    if (!persistent) {
      assertTrue(so.isAcquired());
      so.release();
      assertFalse(so.isAcquired());
    }
    app.stop(appScope);

    //    IScope room1 = ScopeUtils.resolveScope(appScope, "/junit/room1");
    //    IScope room4 = ScopeUtils.resolveScope(appScope, "/junit/room1/room4");
View Full Code Here

TOP

Related Classes of org.red5.server.api.so.ISharedObject

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.