/*
 * BEGIN FLOCK GPL
 *
 * Copyright Flock Inc. 2005-2009
 * http://flock.com
 *
 * This file may be used under the terms of the
 * GNU General Public License Version 2 or later (the "GPL"),
 * http://www.gnu.org/licenses/gpl.html
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * END FLOCK GPL
 */

#include "flockIHousekeeping.idl"
interface nsIRDFResource;

/**
 * Stream Housekeeping caps any streams that have a maximum item cap. 
 * You can also call it explicitly on a stream.
 */
[scriptable, uuid(220ef36f-291d-46be-a2b9-2d4198a04250)]
interface flockIStreamHousekeeping : nsISupports {
  void capAllStreams();
  /**
   * Prunes a stream to its maximum item cap.
   *
   * @param aStreamResource (in) The resource of the stream to prune.
   */
  void capItemsforStream(in nsIRDFResource aStreamResource);
};

/**
 * Implement this if your service wants to dynamically determine the
 * maximum item count for a given stream that it owns instead of
 * having StreamHousekeeping look at static properties.
 */
[scriptable, uuid(2b331722-9b3e-47cc-b03d-170a12e93a49)]
interface flockIStreamOwner : nsISupports {
  /**
   * Returns the maximum item count for a given stream.
   *
   * @param aURN The ID of the stream.
   */
  PRUint32 getMaxItemsForStream(in AString aURN);
};
