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 */
016package org.forgerock.opendj.server.config.client;
017
018
019
020import java.util.Collection;
021import java.util.SortedSet;
022import org.forgerock.opendj.config.ConfigurationClient;
023import org.forgerock.opendj.config.ManagedObjectDefinition;
024import org.forgerock.opendj.config.PropertyException;
025import org.forgerock.opendj.server.config.server.AlertHandlerCfg;
026
027
028
029/**
030 * A client-side interface for reading and modifying Alert Handler
031 * settings.
032 * <p>
033 * Alert Handlers are used to notify administrators of significant
034 * problems or notable events that occur in the OpenDJ directory
035 * server.
036 */
037public interface AlertHandlerCfgClient extends ConfigurationClient {
038
039  /**
040   * Get the configuration definition associated with this Alert Handler.
041   *
042   * @return Returns the configuration definition associated with this Alert Handler.
043   */
044  ManagedObjectDefinition<? extends AlertHandlerCfgClient, ? extends AlertHandlerCfg> definition();
045
046
047
048  /**
049   * Gets the "disabled-alert-type" property.
050   * <p>
051   * Specifies the names of the alert types that are disabled for this
052   * alert handler.
053   * <p>
054   * If there are any values for this attribute, then no alerts with
055   * any of the specified types are allowed. If there are no values for
056   * this attribute, then only alerts with a type included in the set
057   * of enabled alert types are allowed, or if there are no values for
058   * the enabled alert types option, then all alert types are allowed.
059   *
060   * @return Returns the values of the "disabled-alert-type" property.
061   */
062  SortedSet<String> getDisabledAlertType();
063
064
065
066  /**
067   * Sets the "disabled-alert-type" property.
068   * <p>
069   * Specifies the names of the alert types that are disabled for this
070   * alert handler.
071   * <p>
072   * If there are any values for this attribute, then no alerts with
073   * any of the specified types are allowed. If there are no values for
074   * this attribute, then only alerts with a type included in the set
075   * of enabled alert types are allowed, or if there are no values for
076   * the enabled alert types option, then all alert types are allowed.
077   *
078   * @param values The values of the "disabled-alert-type" property.
079   * @throws PropertyException
080   *           If one or more of the new values are invalid.
081   */
082  void setDisabledAlertType(Collection<String> values) throws PropertyException;
083
084
085
086  /**
087   * Gets the "enabled" property.
088   * <p>
089   * Indicates whether the Alert Handler is enabled.
090   *
091   * @return Returns the value of the "enabled" property.
092   */
093  Boolean isEnabled();
094
095
096
097  /**
098   * Sets the "enabled" property.
099   * <p>
100   * Indicates whether the Alert Handler is enabled.
101   *
102   * @param value The value of the "enabled" property.
103   * @throws PropertyException
104   *           If the new value is invalid.
105   */
106  void setEnabled(boolean value) throws PropertyException;
107
108
109
110  /**
111   * Gets the "enabled-alert-type" property.
112   * <p>
113   * Specifies the names of the alert types that are enabled for this
114   * alert handler.
115   * <p>
116   * If there are any values for this attribute, then only alerts with
117   * one of the specified types are allowed (unless they are also
118   * included in the disabled alert types). If there are no values for
119   * this attribute, then any alert with a type not included in the
120   * list of disabled alert types is allowed.
121   *
122   * @return Returns the values of the "enabled-alert-type" property.
123   */
124  SortedSet<String> getEnabledAlertType();
125
126
127
128  /**
129   * Sets the "enabled-alert-type" property.
130   * <p>
131   * Specifies the names of the alert types that are enabled for this
132   * alert handler.
133   * <p>
134   * If there are any values for this attribute, then only alerts with
135   * one of the specified types are allowed (unless they are also
136   * included in the disabled alert types). If there are no values for
137   * this attribute, then any alert with a type not included in the
138   * list of disabled alert types is allowed.
139   *
140   * @param values The values of the "enabled-alert-type" property.
141   * @throws PropertyException
142   *           If one or more of the new values are invalid.
143   */
144  void setEnabledAlertType(Collection<String> values) throws PropertyException;
145
146
147
148  /**
149   * Gets the "java-class" property.
150   * <p>
151   * Specifies the fully-qualified name of the Java class that
152   * provides the Alert Handler implementation.
153   *
154   * @return Returns the value of the "java-class" property.
155   */
156  String getJavaClass();
157
158
159
160  /**
161   * Sets the "java-class" property.
162   * <p>
163   * Specifies the fully-qualified name of the Java class that
164   * provides the Alert Handler implementation.
165   *
166   * @param value The value of the "java-class" property.
167   * @throws PropertyException
168   *           If the new value is invalid.
169   */
170  void setJavaClass(String value) throws PropertyException;
171
172}