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 legal-notices/CDDLv1_0.txt 010 * or http://forgerock.org/license/CDDLv1.0.html. 011 * See the License for the specific language governing permissions 012 * and limitations under the License. 013 * 014 * When distributing Covered Code, include this CDDL HEADER in each 015 * file and include the License file at legal-notices/CDDLv1_0.txt. 016 * If applicable, add the following below this CDDL HEADER, with the 017 * fields enclosed by brackets "[]" replaced with your own identifying 018 * information: 019 * Portions Copyright [yyyy] [name of copyright owner] 020 * 021 * CDDL HEADER END 022 * 023 * 024 * Copyright 2014-2015 ForgeRock AS. 025 */ 026package org.opends.server.core; 027 028import org.forgerock.opendj.config.server.ServerManagementContext; 029import org.opends.server.extensions.DiskSpaceMonitor; 030import org.opends.server.loggers.CommonAudit; 031import org.opends.server.schema.SchemaUpdater; 032import org.opends.server.types.DirectoryEnvironmentConfig; 033import org.opends.server.types.Schema; 034 035/** 036 * Context for the server, giving access to global properties of the server. 037 */ 038public interface ServerContext 039{ 040 041 /** 042 * Returns the directory of server instance. 043 * 044 * @return the instance root directory 045 */ 046 String getInstanceRoot(); 047 048 /** 049 * Returns the root directory of server. 050 * 051 * @return the server root directory 052 */ 053 String getServerRoot(); 054 055 /** 056 * Returns the schema of the server. 057 * 058 * @return the schema 059 */ 060 Schema getSchema(); 061 062 /** 063 * Returns the new schema of the server (SDK schema). 064 * <p> 065 * This method will disappear once migration to new schema 066 * is finished. Meanwhile, it is necessary to keep both the 067 * legacy version and the new version. 068 * 069 * @return the new version of the schema 070 */ 071 org.forgerock.opendj.ldap.schema.Schema getSchemaNG(); 072 073 /** 074 * Returns the schema updater, which provides 075 * a mean to update the server's current schema. 076 * 077 * @return the schema updater 078 */ 079 SchemaUpdater getSchemaUpdater(); 080 081 /** 082 * Returns the environment of the server. 083 * 084 * @return the environment 085 */ 086 DirectoryEnvironmentConfig getEnvironment(); 087 088 /** 089 * Returns the server management context, which gives 090 * an entry point on configuration objects. 091 * 092 * @return the server management context 093 */ 094 ServerManagementContext getServerManagementContext(); 095 096 /** 097 * Returns the memory quota system for reserving long term memory. 098 * 099 * @return the memory quota system 100 */ 101 MemoryQuota getMemoryQuota(); 102 103 /** 104 * Returns the Disk Space Monitoring service, for checking free disk space. 105 * Configure a directory to be monitored and optionally get alerted when 106 * disk space transitions from low to full to back to normal. 107 * 108 * @return the Disk Space Monioring service 109 */ 110 DiskSpaceMonitor getDiskSpaceMonitor(); 111 112 /** 113 * Returns the common audit manager. 114 * 115 * @return the common audit manager 116 */ 117 CommonAudit getCommonAudit(); 118}