Package org.red5.server.api

Examples of org.red5.server.api.IScope


    ISharedObjectService soService = (ISharedObjectService) ScopeUtils.getScopeService(scope, ISharedObjectService.class, false);
    return soService.getSharedObject(scope, SCOPE_STATS_SO_NAME, false);
  }

  private IScope getScope(String path) throws ScopeNotFoundException {
    IScope scope;
    if (path != null && !path.equals("")) {
      scope = ScopeUtils.resolveScope(globalScope, path);
    } else {
      scope = globalScope;
    }
View Full Code Here


  public Set<String> getScopes() {
    return getScopes(null);
  }

  public Set<String> getScopes(String path) throws ScopeNotFoundException {
    IScope scope = getScope(path);
    Set<String> result = new HashSet<String>();
    Iterator<String> iter = scope.getScopeNames();
    while (iter.hasNext()) {
      String name = iter.next();
      result.add(name.substring(name.indexOf(IScope.SEPARATOR) + 1));
    }
View Full Code Here

    ISharedObjectService soService = (ISharedObjectService) ScopeUtils.getScopeService(scope, ISharedObjectService.class, false);
    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());
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

    so.setAttribute(path, scope.getAttributes());
  }

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

   * @param callback
   *       object to notify when result is received
   */
  public static void invokeOnAllConnections(String method, Object[] params,
      IPendingServiceCallback callback) {
    IScope scope = Red5.getConnectionLocal().getScope();
    invokeOnAllConnections(scope, method, params, callback);
  }
View Full Code Here

   *       name of the method to notifynotify
   * @param params
   *       parameters to pass to the method
   */
  public static void notifyOnAllConnections(String method, Object[] params) {
    IScope scope = Red5.getConnectionLocal().getScope();
    notifyOnAllConnections(scope, method, params);
  }
View Full Code Here

    IConnection conn = Red5.getConnectionLocal();
    if (conn == null) {
      return;
    }

    IScope scope = conn.getScope();
    if (scope != null) {
      Thread.currentThread().setContextClassLoader(scope.getClassLoader());
    }
  }
View Full Code Here

  /** {@inheritDoc} */
  public void saveAs(String name, boolean isAppend) throws IOException,
      ResourceNotFoundException, ResourceExistException {
    try {
    IScope scope = getScope();
    IStreamFilenameGenerator generator = (IStreamFilenameGenerator) ScopeUtils
    .getScopeService(scope, IStreamFilenameGenerator.class,
        DefaultStreamFilenameGenerator.class);
   
    String filename = generator.generateFilename(scope, name, ".flv", GenerationType.RECORD);
    // Get file for that filename
    File file;
    if (generator.resolvesToAbsolutePath()) {
      file = new File(filename);
    } else {
      file = scope.getContext().getResource(filename).getFile();
    }
    if (!isAppend) {
      if (file.exists()) {
        // Per livedoc of FCS/FMS:
        // When "live" or "record" is used,
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

TOP

Related Classes of org.red5.server.api.IScope

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.