001    /*
002     * CDDL HEADER START
003     *
004     * The contents of this file are subject to the terms of the
005     * Common Development and Distribution License, Version 1.0 only
006     * (the "License").  You may not use this file except in compliance
007     * with the License.
008     *
009     * You can obtain a copy of the license at
010     * docs/licenses/cddl.txt
011     * or http://www.opensource.org/licenses/cddl1.php.
012     * See the License for the specific language governing permissions
013     * and limitations under the License.
014     *
015     * When distributing Covered Code, include this CDDL HEADER in each
016     * file and include the License file at
017     * docs/licenses/cddl.txt.  If applicable,
018     * add the following below this CDDL HEADER, with the fields enclosed
019     * by brackets "[]" replaced with your own identifying information:
020     *      Portions Copyright [yyyy] [name of copyright owner]
021     *
022     * CDDL HEADER END
023     *
024     *
025     *      Copyright 2010-2012 UnboundID Corp.
026     */
027    package com.unboundid.directory.sdk.common.api;
028    
029    
030    
031    import java.io.File;
032    import java.util.List;
033    
034    import com.unboundid.directory.sdk.ds.internal.DirectoryServerExtension;
035    import com.unboundid.directory.sdk.proxy.internal.DirectoryProxyServerExtension;
036    import com.unboundid.directory.sdk.sync.internal.SynchronizationServerExtension;
037    import com.unboundid.util.Extensible;
038    import com.unboundid.util.ThreadSafety;
039    import com.unboundid.util.ThreadSafetyLevel;
040    
041    
042    
043    /**
044     * This interface defines a set of methods that should be implemented by
045     * classes which may consume a significant amount of disk space on the server
046     * filesystem.  It may be used by the server to monitor usable disk space for
047     * those components.  Disk space consumers should be registered using the
048     * {@code ServerContext.registerDiskSpaceConsumer} method, and should be
049     * deregistered using the corresponding {@code deregisterDiskSpaceConsumer}
050     * method if they are no longer needed.
051     */
052    @Extensible()
053    @DirectoryServerExtension()
054    @DirectoryProxyServerExtension(appliesToLocalContent=true,
055         appliesToRemoteContent=false)
056    @SynchronizationServerExtension(appliesToLocalContent=true,
057         appliesToSynchronizedContent=false)
058    @ThreadSafety(level=ThreadSafetyLevel.INTERFACE_NOT_THREADSAFE)
059    public interface DiskSpaceConsumer
060    {
061      /**
062       * Retrieves the name that should be used to identify this disk space
063       * consumer.
064       *
065       * @return  The name that should be used to identify this disk space consumer.
066       */
067      String getDiskSpaceConsumerName();
068    
069    
070    
071      /**
072       * Retrieves a list of filesystem paths in which this disk space consumer may
073       * store files which may consume a significant amount of space.  It is
074       * generally recommended that the paths be directories, but they may also be
075       * individual files.
076       *
077       * @return  A list of filesystem paths in which this disk space consumer may
078       *          store files which may consume a significant amount of space.
079       */
080      List<File> getDiskSpaceConsumerPaths();
081    }