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.server;
017
018
019
020import java.util.SortedSet;
021import org.forgerock.opendj.config.server.ConfigurationChangeListener;
022import org.forgerock.opendj.ldap.DN;
023import org.forgerock.opendj.server.config.meta.FileBasedAccessLogPublisherCfgDefn.LogFormat;
024
025
026
027/**
028 * A server-side interface for querying File Based Access Log
029 * Publisher settings.
030 * <p>
031 * File Based Access Log Publishers publish access messages to the
032 * file system.
033 */
034public interface FileBasedAccessLogPublisherCfg extends AccessLogPublisherCfg {
035
036  /**
037   * Gets the configuration class associated with this File Based Access Log Publisher.
038   *
039   * @return Returns the configuration class associated with this File Based Access Log Publisher.
040   */
041  Class<? extends FileBasedAccessLogPublisherCfg> configurationClass();
042
043
044
045  /**
046   * Register to be notified when this File Based Access Log Publisher is changed.
047   *
048   * @param listener
049   *          The File Based Access Log Publisher configuration change listener.
050   */
051  void addFileBasedAccessChangeListener(ConfigurationChangeListener<FileBasedAccessLogPublisherCfg> listener);
052
053
054
055  /**
056   * Deregister an existing File Based Access Log Publisher configuration change listener.
057   *
058   * @param listener
059   *          The File Based Access Log Publisher configuration change listener.
060   */
061  void removeFileBasedAccessChangeListener(ConfigurationChangeListener<FileBasedAccessLogPublisherCfg> listener);
062
063
064
065  /**
066   * Gets the "append" property.
067   * <p>
068   * Specifies whether to append to existing log files.
069   *
070   * @return Returns the value of the "append" property.
071   */
072  boolean isAppend();
073
074
075
076  /**
077   * Gets the "asynchronous" property.
078   * <p>
079   * Indicates whether the File Based Access Log Publisher will
080   * publish records asynchronously.
081   *
082   * @return Returns the value of the "asynchronous" property.
083   */
084  boolean isAsynchronous();
085
086
087
088  /**
089   * Gets the "auto-flush" property.
090   * <p>
091   * Specifies whether to flush the writer after every log record.
092   * <p>
093   * If the asynchronous writes option is used, the writer is flushed
094   * after all the log records in the queue are written.
095   *
096   * @return Returns the value of the "auto-flush" property.
097   */
098  boolean isAutoFlush();
099
100
101
102  /**
103   * Gets the "buffer-size" property.
104   * <p>
105   * Specifies the log file buffer size.
106   *
107   * @return Returns the value of the "buffer-size" property.
108   */
109  long getBufferSize();
110
111
112
113  /**
114   * Gets the "java-class" property.
115   * <p>
116   * The fully-qualified name of the Java class that provides the File
117   * Based Access Log Publisher implementation.
118   *
119   * @return Returns the value of the "java-class" property.
120   */
121  String getJavaClass();
122
123
124
125  /**
126   * Gets the "log-control-oids" property.
127   * <p>
128   * Specifies whether control OIDs will be included in operation log
129   * records.
130   *
131   * @return Returns the value of the "log-control-oids" property.
132   */
133  boolean isLogControlOids();
134
135
136
137  /**
138   * Gets the "log-file" property.
139   * <p>
140   * The file name to use for the log files generated by the File
141   * Based Access Log Publisher. The path to the file is relative to
142   * the server root.
143   *
144   * @return Returns the value of the "log-file" property.
145   */
146  String getLogFile();
147
148
149
150  /**
151   * Gets the "log-file-permissions" property.
152   * <p>
153   * The UNIX permissions of the log files created by this File Based
154   * Access Log Publisher.
155   *
156   * @return Returns the value of the "log-file-permissions" property.
157   */
158  String getLogFilePermissions();
159
160
161
162  /**
163   * Gets the "log-format" property.
164   * <p>
165   * Specifies how log records should be formatted and written to the
166   * access log.
167   *
168   * @return Returns the value of the "log-format" property.
169   */
170  LogFormat getLogFormat();
171
172
173
174  /**
175   * Gets the "log-record-time-format" property.
176   * <p>
177   * Specifies the format string that is used to generate log record
178   * timestamps.
179   *
180   * @return Returns the value of the "log-record-time-format" property.
181   */
182  String getLogRecordTimeFormat();
183
184
185
186  /**
187   * Gets the "queue-size" property.
188   * <p>
189   * The maximum number of log records that can be stored in the
190   * asynchronous queue.
191   *
192   * @return Returns the value of the "queue-size" property.
193   */
194  int getQueueSize();
195
196
197
198  /**
199   * Gets the "retention-policy" property.
200   * <p>
201   * The retention policy to use for the File Based Access Log
202   * Publisher .
203   * <p>
204   * When multiple policies are used, log files are cleaned when any
205   * of the policy's conditions are met.
206   *
207   * @return Returns an unmodifiable set containing the values of the "retention-policy" property.
208   */
209  SortedSet<String> getRetentionPolicy();
210
211
212
213  /**
214   * Gets the "retention-policy" property as a set of DNs.
215   * <p>
216   * The retention policy to use for the File Based Access Log
217   * Publisher .
218   * <p>
219   * When multiple policies are used, log files are cleaned when any
220   * of the policy's conditions are met.
221   *
222   * @return Returns the DN values of the "retention-policy" property.
223   */
224  SortedSet<DN> getRetentionPolicyDNs();
225
226
227
228  /**
229   * Gets the "rotation-policy" property.
230   * <p>
231   * The rotation policy to use for the File Based Access Log
232   * Publisher .
233   * <p>
234   * When multiple policies are used, rotation will occur if any
235   * policy's conditions are met.
236   *
237   * @return Returns an unmodifiable set containing the values of the "rotation-policy" property.
238   */
239  SortedSet<String> getRotationPolicy();
240
241
242
243  /**
244   * Gets the "rotation-policy" property as a set of DNs.
245   * <p>
246   * The rotation policy to use for the File Based Access Log
247   * Publisher .
248   * <p>
249   * When multiple policies are used, rotation will occur if any
250   * policy's conditions are met.
251   *
252   * @return Returns the DN values of the "rotation-policy" property.
253   */
254  SortedSet<DN> getRotationPolicyDNs();
255
256
257
258  /**
259   * Gets the "time-interval" property.
260   * <p>
261   * Specifies the interval at which to check whether the log files
262   * need to be rotated.
263   *
264   * @return Returns the value of the "time-interval" property.
265   */
266  long getTimeInterval();
267
268}