Package org.red5.server.api.so

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


  }

  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

   *            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) getScopeService(
        scope, ISharedObjectService.class, SharedObjectService.class,
        false);
    return service.createSharedObject(scope, name, persistent);
    }
View Full Code Here

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

   *            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) getScopeService(
        scope, ISharedObjectService.class, SharedObjectService.class,
        false);
    return service.getSharedObject(scope, name, persistent);
  }
View Full Code Here

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

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

    return duration;
  }

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

        return service.clearSharedObjects(scope, name);
    }
View Full Code Here

      // The scope already has been deleted.
      sendSOCreationFailed(conn, name, persistent);
      return;
    }

    ISharedObjectService sharedObjectService = (ISharedObjectService) getScopeService(
        scope, ISharedObjectService.class, SharedObjectService.class,
        false);
    if (!sharedObjectService.hasSharedObject(scope, name)) {
      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)) {
            sendSOCreationFailed(conn, name, persistent);
            return;
          }
        }
      }

      if (!sharedObjectService
          .createSharedObject(scope, name, persistent)) {
        sendSOCreationFailed(conn, name, persistent);
        return;
      }
    }
    so = sharedObjectService.getSharedObject(scope, name);
    if (so.isPersistentObject() != persistent) {
      SharedObjectMessage msg = new SharedObjectMessage(name, 0,
          persistent);
      msg.addEvent(new SharedObjectEvent(
          ISharedObjectEvent.Type.CLIENT_STATUS, "error",
View Full Code Here

   
    return null;
  }
 
  private 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

TOP

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

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.