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 */
026package org.opends.server.admin.std.client;
027
028
029
030import java.util.Collection;
031import org.opends.server.admin.client.AuthorizationException;
032import org.opends.server.admin.client.CommunicationException;
033import org.opends.server.admin.client.ConcurrentModificationException;
034import org.opends.server.admin.client.IllegalManagedObjectNameException;
035import org.opends.server.admin.client.ManagedObjectDecodingException;
036import org.opends.server.admin.client.OperationRejectedException;
037import org.opends.server.admin.DefinitionDecodingException;
038import org.opends.server.admin.ManagedObjectDefinition;
039import org.opends.server.admin.ManagedObjectNotFoundException;
040import org.opends.server.admin.PropertyException;
041import org.opends.server.admin.std.meta.AccessLogPublisherCfgDefn.FilteringPolicy;
042import org.opends.server.admin.std.server.AccessLogFilteringCriteriaCfg;
043import org.opends.server.admin.std.server.AccessLogPublisherCfg;
044
045
046
047/**
048 * A client-side interface for reading and modifying Access Log
049 * Publisher settings.
050 * <p>
051 * Access Log Publishers are responsible for distributing access log
052 * messages from the access logger to a destination.
053 */
054public interface AccessLogPublisherCfgClient extends LogPublisherCfgClient {
055
056  /**
057   * Get the configuration definition associated with this Access Log Publisher.
058   *
059   * @return Returns the configuration definition associated with this Access Log Publisher.
060   */
061  ManagedObjectDefinition<? extends AccessLogPublisherCfgClient, ? extends AccessLogPublisherCfg> definition();
062
063
064
065  /**
066   * Gets the "filtering-policy" property.
067   * <p>
068   * Specifies how filtering criteria should be applied to log
069   * records.
070   *
071   * @return Returns the value of the "filtering-policy" property.
072   */
073  FilteringPolicy getFilteringPolicy();
074
075
076
077  /**
078   * Sets the "filtering-policy" property.
079   * <p>
080   * Specifies how filtering criteria should be applied to log
081   * records.
082   *
083   * @param value The value of the "filtering-policy" property.
084   * @throws PropertyException
085   *           If the new value is invalid.
086   */
087  void setFilteringPolicy(FilteringPolicy value) throws PropertyException;
088
089
090
091  /**
092   * Gets the "java-class" property.
093   * <p>
094   * The fully-qualified name of the Java class that provides the
095   * Access Log Publisher implementation.
096   *
097   * @return Returns the value of the "java-class" property.
098   */
099  String getJavaClass();
100
101
102
103  /**
104   * Sets the "java-class" property.
105   * <p>
106   * The fully-qualified name of the Java class that provides the
107   * Access Log Publisher implementation.
108   *
109   * @param value The value of the "java-class" property.
110   * @throws PropertyException
111   *           If the new value is invalid.
112   */
113  void setJavaClass(String value) throws PropertyException;
114
115
116
117  /**
118   * Gets the "suppress-internal-operations" property.
119   * <p>
120   * Indicates whether internal operations (for example, operations
121   * that are initiated by plugins) should be logged along with the
122   * operations that are requested by users.
123   *
124   * @return Returns the value of the "suppress-internal-operations" property.
125   */
126  boolean isSuppressInternalOperations();
127
128
129
130  /**
131   * Sets the "suppress-internal-operations" property.
132   * <p>
133   * Indicates whether internal operations (for example, operations
134   * that are initiated by plugins) should be logged along with the
135   * operations that are requested by users.
136   *
137   * @param value The value of the "suppress-internal-operations" property.
138   * @throws PropertyException
139   *           If the new value is invalid.
140   */
141  void setSuppressInternalOperations(Boolean value) throws PropertyException;
142
143
144
145  /**
146   * Gets the "suppress-synchronization-operations" property.
147   * <p>
148   * Indicates whether access messages that are generated by
149   * synchronization operations should be suppressed.
150   *
151   * @return Returns the value of the "suppress-synchronization-operations" property.
152   */
153  boolean isSuppressSynchronizationOperations();
154
155
156
157  /**
158   * Sets the "suppress-synchronization-operations" property.
159   * <p>
160   * Indicates whether access messages that are generated by
161   * synchronization operations should be suppressed.
162   *
163   * @param value The value of the "suppress-synchronization-operations" property.
164   * @throws PropertyException
165   *           If the new value is invalid.
166   */
167  void setSuppressSynchronizationOperations(Boolean value) throws PropertyException;
168
169
170
171  /**
172   * Lists the Access Log Filtering Criteria.
173   *
174   * @return Returns an array containing the names of the Access Log
175   *         Filtering Criteria.
176   * @throws ConcurrentModificationException
177   *           If this Access Log Publisher has been removed from the
178   *           server by another client.
179   * @throws AuthorizationException
180   *           If the server refuses to list the Access Log Filtering
181   *           Criteria because the client does not have the correct
182   *           privileges.
183   * @throws CommunicationException
184   *           If the client cannot contact the server due to an
185   *           underlying communication problem.
186   */
187  String[] listAccessLogFilteringCriteria() throws ConcurrentModificationException,
188      AuthorizationException, CommunicationException;
189
190
191
192  /**
193   * Gets the named Access Log Filtering Criteria.
194   *
195   * @param name
196   *           The name of the Access Log Filtering Criteria to
197   *           retrieve.
198   * @return Returns the named Access Log Filtering Criteria.
199   * @throws DefinitionDecodingException
200   *           If the named Access Log Filtering Criteria was found
201   *           but its type could not be determined.
202   * @throws ManagedObjectDecodingException
203   *           If the named Access Log Filtering Criteria was found
204   *           but one or more of its properties could not be decoded.
205   * @throws ManagedObjectNotFoundException
206   *           If the named Access Log Filtering Criteria was not
207   *           found on the server.
208   * @throws ConcurrentModificationException
209   *           If this Access Log Publisher has been removed from the
210   *           server by another client.
211   * @throws AuthorizationException
212   *           If the server refuses to retrieve the named Access Log
213   *           Filtering Criteria because the client does not have the
214   *           correct privileges.
215   * @throws CommunicationException
216   *           If the client cannot contact the server due to an
217   *           underlying communication problem.
218   */
219  AccessLogFilteringCriteriaCfgClient getAccessLogFilteringCriteria(String name)
220      throws DefinitionDecodingException, ManagedObjectDecodingException,
221      ManagedObjectNotFoundException, ConcurrentModificationException,
222      AuthorizationException, CommunicationException;
223
224
225
226  /**
227   * Creates a new Access Log Filtering Criteria. The new Access Log
228   * Filtering Criteria will initially not contain any property values
229   * (including mandatory properties). Once the Access Log Filtering
230   * Criteria has been configured it can be added to the server using
231   * the {@link #commit()} method.
232   *
233   * @param <C>
234   *          The type of the Access Log Filtering Criteria being
235   *          created.
236   * @param d
237   *          The definition of the Access Log Filtering Criteria to
238   *          be created.
239   * @param name
240   *          The name of the new Access Log Filtering Criteria.
241   * @param exceptions
242   *          An optional collection in which to place any {@link
243   *          PropertyException}s that occurred whilst attempting to
244   *          determine the default values of the Access Log Filtering
245   *          Criteria. This argument can be <code>null<code>.
246   * @return Returns a new Access Log Filtering Criteria configuration
247   *         instance.
248   * @throws IllegalManagedObjectNameException
249   *          If the name of the new Access Log Filtering Criteria is
250   *          invalid.
251   */
252  <C extends AccessLogFilteringCriteriaCfgClient> C createAccessLogFilteringCriteria(
253      ManagedObjectDefinition<C, ? extends AccessLogFilteringCriteriaCfg> d, String name, Collection<PropertyException> exceptions) throws IllegalManagedObjectNameException;
254
255
256
257  /**
258   * Removes the named Access Log Filtering Criteria.
259   *
260   * @param name
261   *          The name of the Access Log Filtering Criteria to remove.
262   * @throws ManagedObjectNotFoundException
263   *           If the Access Log Filtering Criteria does not exist.
264   * @throws OperationRejectedException
265   *           If the server refuses to remove the Access Log
266   *           Filtering Criteria due to some server-side constraint
267   *           which cannot be satisfied (for example, if it is
268   *           referenced by another managed object).
269   * @throws ConcurrentModificationException
270   *           If this Access Log Publisher has been removed from the
271   *           server by another client.
272   * @throws AuthorizationException
273   *           If the server refuses to remove the Access Log
274   *           Filtering Criteria because the client does not have the
275   *           correct privileges.
276   * @throws CommunicationException
277   *           If the client cannot contact the server due to an
278   *           underlying communication problem.
279   */
280  void removeAccessLogFilteringCriteria(String name)
281      throws ManagedObjectNotFoundException, OperationRejectedException,
282      ConcurrentModificationException, AuthorizationException,
283      CommunicationException;
284
285}