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.schema.SchemaUpdater; 031import org.opends.server.types.DirectoryEnvironmentConfig; 032import org.opends.server.types.Schema; 033 034/** 035 * Context for the server, giving access to global properties of the server. 036 */ 037public interface ServerContext 038{ 039 040 /** 041 * Returns the directory of server instance. 042 * 043 * @return the instance root directory 044 */ 045 String getInstanceRoot(); 046 047 /** 048 * Returns the root directory of server. 049 * 050 * @return the server root directory 051 */ 052 String getServerRoot(); 053 054 /** 055 * Returns the schema of the server. 056 * 057 * @return the schema 058 */ 059 Schema getSchema(); 060 061 /** 062 * Returns the new schema of the server (SDK schema). 063 * <p> 064 * This method will disappear once migration to new schema 065 * is finished. Meanwhile, it is necessary to keep both the 066 * legacy version and the new version. 067 * 068 * @return the new version of the schema 069 */ 070 org.forgerock.opendj.ldap.schema.Schema getSchemaNG(); 071 072 /** 073 * Returns the schema updater, which provides 074 * a mean to update the server's current schema. 075 * 076 * @return the schema updater 077 */ 078 SchemaUpdater getSchemaUpdater(); 079 080 /** 081 * Returns the environment of the server. 082 * 083 * @return the environment 084 */ 085 DirectoryEnvironmentConfig getEnvironment(); 086 087 /** 088 * Returns the server management context, which gives 089 * an entry point on configuration objects. 090 * 091 * @return the server management context 092 */ 093 ServerManagementContext getServerManagementContext(); 094 095 /** 096 * Returns the memory quota system for reserving long term memory. 097 * 098 * @return the memory quota system 099 */ 100 MemoryQuota getMemoryQuota(); 101 102 /** 103 * Returns the Disk Space Monitoring service, for checking free disk space. 104 * Configure a directory to be monitored and optionally get alerted when 105 * disk space transitions from low to full to back to normal. 106 * 107 * @return the Disk Space Monioring service 108 */ 109 DiskSpaceMonitor getDiskSpaceMonitor(); 110}