Package org.red5.server.api.so

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


  public Set<ISharedObjectStatistics> getSharedObjects(String path) {
    IScope scope = getScope(path);
    ISharedObjectService soService = (ISharedObjectService) ScopeUtils.getScopeService(scope, ISharedObjectService.class, false);
    Set<ISharedObjectStatistics> result = new HashSet<ISharedObjectStatistics>();
    for (String name : soService.getSharedObjectNames(scope)) {
      ISharedObject so = soService.getSharedObject(scope, name);
      result.add(so.getStatistics());
    }
    return result;
  }
View Full Code Here


    return result;
  }

  public void updateScopeStatistics(String path) throws ScopeNotFoundException {
    IScope scope = getScope(path);
    ISharedObject so = getScopeStatisticsSO(Red5.getConnectionLocal().getScope());
    so.setAttribute(path, scope.getAttributes());
  }
View Full Code Here

  }

  public void updateSharedObjectStatistics(String path, String name) throws ScopeNotFoundException, SharedObjectException {
    IScope scope = getScope(path);
    ISharedObjectService soService = (ISharedObjectService) ScopeUtils.getScopeService(scope, ISharedObjectService.class, false);
    ISharedObject sourceSO = soService.getSharedObject(scope, name);
    if (sourceSO == null)
      throw new SharedObjectException();

    ISharedObject so = getSharedObjectStatisticsSO(Red5.getConnectionLocal().getScope());
    so.setAttribute(path + '|' + name, sourceSO.getData());
  }
View Full Code Here

    IScope scope = context.resolveScope(path_app);
    ISharedObjectService service = new SharedObjectService();
    assertTrue("should be empty", !service.hasSharedObject(scope, "blah"));
    assertTrue("create so", service.createSharedObject(scope, name, false));
    assertTrue("so exists?", service.hasSharedObject(scope, name));
    ISharedObject so = service.getSharedObject(scope, name);
    assertTrue("so not null", so != null);
    assertTrue("name same", so.getName().equals(name));
    //assertTrue("persistent",!so.isPersistent());
    so.addEventListener(this);
    so.setAttribute("this", "that");
  }
View Full Code Here

    // save ref
    appScope = app;
    // create persistent SO
    createSharedObject(app, persistentSO, true);
    // get the SO
    ISharedObject sharedObject = getSharedObject(app, persistentSO, true);
    //
    return super.appStart(app);
  }
View Full Code Here

    if (!hasSharedObject(appScope, "issue323")) {
      if (!createSharedObject(appScope, "issue323", false)) {
        log.warn("Shared object creation failed");
      }
    }
    ISharedObject so = getSharedObject(appScope, "issue323");
    log.debug("#1 {}", so);
    // close it
    if (!so.clear()) {
      log.debug("Shared object clear failed");
    }
    so.close();
  }
View Full Code Here

    IScope room1 = appScope.getScope("room1");
    log.debug("Room 1: {}", room1);
    assertTrue(room1.getDepth() == 2);

    // get the SO
    ISharedObject sharedObject = app.getSharedObject(room1, soName, true);
    log.debug("SO: {}", sharedObject);
    assertNotNull(sharedObject);

    log.debug("testSharedObject-end");
  }
View Full Code Here

    // get our room
    IScope room1 = ScopeUtils.resolveScope(appScope, "/junit/room1");
    // create the SO
    app.createSharedObject(room1, soName, true);
    // get the SO
    ISharedObject sharedObject = app.getSharedObject(room1, soName, true);
    assertTrue(sharedObject != null);
    log.debug("testPersistentCreation-end");
  }
View Full Code Here

    try {
      Thread.sleep(500);
    } catch (Exception e) {
    }
    // set something on the so
    ISharedObject so = app.getSharedObject(appScope, "statusSO");
    so.setAttribute("testing", true);
    // go to sleep
    try {
      Thread.sleep(1000);
    } catch (Exception e) {
    }
    log.debug("Attribute names: {}", so.getAttributeNames());
    // [status, testing]
    assertTrue(so.getAttributeNames().size() == 2);
  }
View Full Code Here

   * @param uid
   *       the unique id of the user that connected
   */
  @SuppressWarnings("unchecked")
  public void addClient(IScope scope, String username, String uid) {
    ISharedObject so = getSharedObject(scope);
    so.setAttribute(uid, username);
  }
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.