001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2014-2016 ForgeRock AS.
015 */
016package org.opends.server.core;
017
018import org.forgerock.opendj.config.server.ServerManagementContext;
019import org.opends.server.extensions.DiskSpaceMonitor;
020import org.opends.server.loggers.CommonAudit;
021import org.opends.server.types.DirectoryEnvironmentConfig;
022import org.opends.server.types.Schema;
023
024/** Context for the server, giving access to global properties of the server. */
025public interface ServerContext
026{
027  /**
028   * Returns the directory of server instance.
029   *
030   * @return the instance root directory
031   */
032  String getInstanceRoot();
033
034  /**
035   * Returns the root directory of server.
036   *
037   * @return the server root directory
038   */
039  String getServerRoot();
040
041  /**
042   * Returns the schema of the server.
043   *
044   * @return the schema
045   */
046  Schema getSchema();
047
048  /**
049   * Returns the new schema of the server (SDK schema).
050   * <p>
051   * This method will disappear once migration to new schema
052   * is finished. Meanwhile, it is necessary to keep both the
053   * legacy version and the new version.
054   *
055   * @return the new version of the schema
056   */
057  org.forgerock.opendj.ldap.schema.Schema getSchemaNG();
058
059  /**
060   * Returns the environment of the server.
061   *
062   * @return the environment
063   */
064  DirectoryEnvironmentConfig getEnvironment();
065
066  /**
067   * Returns the server management context, which gives
068   * an entry point on configuration objects.
069   *
070   * @return the server management context
071   */
072  ServerManagementContext getServerManagementContext();
073
074  /**
075   * Returns the memory quota system for reserving long term memory.
076   *
077   * @return the memory quota system
078   */
079  MemoryQuota getMemoryQuota();
080
081  /**
082   * Returns the Disk Space Monitoring service, for checking free disk space.
083   * Configure a directory to be monitored and optionally get alerted when
084   * disk space transitions from low to full to back to normal.
085   *
086   * @return the Disk Space Monitoring service
087   */
088  DiskSpaceMonitor getDiskSpaceMonitor();
089
090  /**
091   * Returns the common audit manager.
092   *
093   * @return the common audit manager
094   */
095  CommonAudit getCommonAudit();
096
097  /**
098   * Returns the logger config manager.
099   *
100   * @return the logger config manager
101   */
102  LoggerConfigManager getLoggerConfigManager();
103}