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 2008 Sun Microsystems, Inc. 025 * Portions copyright 2013 ForgeRock AS. 026 */ 027package org.forgerock.opendj.server.core; 028 029/** 030 * The status of a data provider. A data provider may be enabled, disabled, or 031 * providing a restricted service. 032 */ 033public enum DataProviderStatus { 034 /** 035 * The data provider is disabled and rejecting all operations. 036 */ 037 DISABLED("disabled"), 038 039 /** 040 * The data provider is enabled and accepting all operations. 041 */ 042 ENABLED("enabled"), 043 044 /** 045 * The data provider is only accepting read operations; all write operations 046 * will be rejected. 047 */ 048 READ_ONLY("read-only"), 049 050 /** 051 * The data provider is accepting read operations, internal write 052 * operations, and updates through synchronization; all other write 053 * operations will be rejected. 054 */ 055 WRITE_INTERNAL_ONLY("write-internal-only"); 056 057 /** The human-readable name for this status. */ 058 private String name; 059 060 /** 061 * Creates a new data provider status with the provided name. 062 * 063 * @param name 064 * The human-readable name for this status. 065 */ 066 private DataProviderStatus(final String name) { 067 this.name = name; 068 } 069 070 /** 071 * Retrieves a string representation of this status. 072 * 073 * @return A string representation of this status. 074 */ 075 @Override 076 public String toString() { 077 return name; 078 } 079}