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