Examples of ISharedObjectService


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

   * @param persistent
   *            Whether SharedObject instance should be persistent or not
   * @return <code>true</code> if SO was created, <code>false</code> otherwise
   */
  public boolean createSharedObject(IScope scope, String name, boolean persistent) {
    ISharedObjectService service = (ISharedObjectService) ScopeUtils.getScopeService(scope, ISharedObjectService.class, SharedObjectService.class, false);
    return service.createSharedObject(scope, name, persistent);
  }
View Full Code Here

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

   * @param name
   *            Name of SharedObject
   * @return Shared object instance with name given
   */
  public ISharedObject getSharedObject(IScope scope, String name) {
    ISharedObjectService service = (ISharedObjectService) ScopeUtils.getScopeService(scope, ISharedObjectService.class, SharedObjectService.class, false);
    return service.getSharedObject(scope, name);
  }
View Full Code Here

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

   * @param persistent
   *            Whether SharedObject instance should be persistent or not
   * @return Shared object instance with name given
   */
  public ISharedObject getSharedObject(IScope scope, String name, boolean persistent) {
    ISharedObjectService service = (ISharedObjectService) ScopeUtils.getScopeService(scope, ISharedObjectService.class, SharedObjectService.class, false);
    return service.getSharedObject(scope, name, persistent);
  }
View Full Code Here

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

   *
   * @param scope
   *            Scope that SO belong to
   */
  public Set<String> getSharedObjectNames(IScope scope) {
    ISharedObjectService service = (ISharedObjectService) ScopeUtils.getScopeService(scope, ISharedObjectService.class, SharedObjectService.class, false);
    return service.getSharedObjectNames(scope);
  }
View Full Code Here

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

   *            Scope that SO belong to
   * @param name
   *            Name of SharedObject
   */
  public boolean hasSharedObject(IScope scope, String name) {
    ISharedObjectService service = (ISharedObjectService) ScopeUtils.getScopeService(scope, ISharedObjectService.class, SharedObjectService.class, false);
    return service.hasSharedObject(scope, name);
  }
View Full Code Here

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

    return duration;
  }

  /** {@inheritDoc} */
  public boolean clearSharedObjects(IScope scope, String name) {
    ISharedObjectService service = (ISharedObjectService) ScopeUtils.getScopeService(scope, ISharedObjectService.class, SharedObjectService.class, false);
    return service.clearSharedObjects(scope, name);
  }
View Full Code Here

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

      // so name
      String name = message.getName();
      // whether or not the incoming so is persistent
      boolean persistent = message.isPersistent();
      // shared object service
      ISharedObjectService sharedObjectService = (ISharedObjectService) ScopeUtils.getScopeService(scope, ISharedObjectService.class, SharedObjectService.class, false);
      if (!sharedObjectService.hasSharedObject(scope, name)) {
        log.debug("Shared object service doesnt have requested object, creation will be attempted");
        ISharedObjectSecurityService security = (ISharedObjectSecurityService) ScopeUtils.getScopeService(scope, ISharedObjectSecurityService.class);
        if (security != null) {
          // Check handlers to see if creation is allowed
          for (ISharedObjectSecurity handler : security.getSharedObjectSecurity()) {
            if (!handler.isCreationAllowed(scope, name, persistent)) {
              log.debug("Shared object create failed, creation is not allowed");
              sendSOCreationFailed(conn, message);
              return;
            }
          }
        }
        if (!sharedObjectService.createSharedObject(scope, name, persistent)) {
          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 {
View Full Code Here

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

  public void setGlobalScope(IScope scope) {
    globalScope = scope;
  }

  public ISharedObject getScopeStatisticsSO(IScope scope) {
    ISharedObjectService soService = (ISharedObjectService) ScopeUtils.getScopeService(scope, ISharedObjectService.class, false);
    return soService.getSharedObject(scope, SCOPE_STATS_SO_NAME, false);
  }
View Full Code Here

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

    Set<String> result = scope.getScopeNames();
    return result;
  }

  public ISharedObject getSharedObjectStatisticsSO(IScope scope) {
    ISharedObjectService soService = (ISharedObjectService) ScopeUtils.getScopeService(scope, ISharedObjectService.class, false);
    return soService.getSharedObject(scope, SO_STATS_SO_NAME, false);
  }
View Full Code Here

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

    return soService.getSharedObject(scope, SO_STATS_SO_NAME, false);
  }

  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
TOP
Copyright © 2018 www.massapi.com. 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.