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