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-2013 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.metrics.internal.MetricsEngineExtension;
036 import com.unboundid.directory.sdk.proxy.internal.DirectoryProxyServerExtension;
037 import com.unboundid.directory.sdk.sync.internal.SynchronizationServerExtension;
038 import com.unboundid.util.Extensible;
039 import com.unboundid.util.ThreadSafety;
040 import com.unboundid.util.ThreadSafetyLevel;
041
042
043
044 /**
045 * This interface defines a set of methods that should be implemented by
046 * classes which may consume a significant amount of disk space on the server
047 * filesystem. It may be used by the server to monitor usable disk space for
048 * those components. Disk space consumers should be registered using the
049 * {@code ServerContext.registerDiskSpaceConsumer} method, and should be
050 * deregistered using the corresponding {@code deregisterDiskSpaceConsumer}
051 * method if they are no longer needed.
052 */
053 @Extensible()
054 @DirectoryServerExtension()
055 @DirectoryProxyServerExtension(appliesToLocalContent=true,
056 appliesToRemoteContent=false)
057 @SynchronizationServerExtension(appliesToLocalContent=true,
058 appliesToSynchronizedContent=false)
059 @MetricsEngineExtension()
060 @ThreadSafety(level=ThreadSafetyLevel.INTERFACE_NOT_THREADSAFE)
061 public interface DiskSpaceConsumer
062 {
063 /**
064 * Retrieves the name that should be used to identify this disk space
065 * consumer.
066 *
067 * @return The name that should be used to identify this disk space consumer.
068 */
069 String getDiskSpaceConsumerName();
070
071
072
073 /**
074 * Retrieves a list of filesystem paths in which this disk space consumer may
075 * store files which may consume a significant amount of space. It is
076 * generally recommended that the paths be directories, but they may also be
077 * individual files.
078 *
079 * @return A list of filesystem paths in which this disk space consumer may
080 * store files which may consume a significant amount of space.
081 */
082 List<File> getDiskSpaceConsumerPaths();
083 }