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