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.meta;
027
028
029
030import java.util.Collection;
031import java.util.SortedSet;
032import java.util.TreeSet;
033import org.forgerock.opendj.config.AdministratorAction;
034import org.forgerock.opendj.config.AggregationPropertyDefinition;
035import org.forgerock.opendj.config.AliasDefaultBehaviorProvider;
036import org.forgerock.opendj.config.BooleanPropertyDefinition;
037import org.forgerock.opendj.config.ClassPropertyDefinition;
038import org.forgerock.opendj.config.client.ConcurrentModificationException;
039import org.forgerock.opendj.config.client.IllegalManagedObjectNameException;
040import org.forgerock.opendj.config.client.ManagedObject;
041import org.forgerock.opendj.config.client.ManagedObjectDecodingException;
042import org.forgerock.opendj.config.client.MissingMandatoryPropertiesException;
043import org.forgerock.opendj.config.client.OperationRejectedException;
044import org.forgerock.opendj.config.DefaultBehaviorProvider;
045import org.forgerock.opendj.config.DefinedDefaultBehaviorProvider;
046import org.forgerock.opendj.config.DefinitionDecodingException;
047import org.forgerock.opendj.config.DurationPropertyDefinition;
048import org.forgerock.opendj.config.EnumPropertyDefinition;
049import org.forgerock.opendj.config.InstantiableRelationDefinition;
050import org.forgerock.opendj.config.IntegerPropertyDefinition;
051import org.forgerock.opendj.config.ManagedObjectAlreadyExistsException;
052import org.forgerock.opendj.config.ManagedObjectDefinition;
053import org.forgerock.opendj.config.ManagedObjectNotFoundException;
054import org.forgerock.opendj.config.PropertyException;
055import org.forgerock.opendj.config.PropertyOption;
056import org.forgerock.opendj.config.PropertyProvider;
057import org.forgerock.opendj.config.server.ConfigException;
058import org.forgerock.opendj.config.server.ConfigurationAddListener;
059import org.forgerock.opendj.config.server.ConfigurationChangeListener;
060import org.forgerock.opendj.config.server.ConfigurationDeleteListener;
061import org.forgerock.opendj.config.server.ServerManagedObject;
062import org.forgerock.opendj.config.SizePropertyDefinition;
063import org.forgerock.opendj.config.StringPropertyDefinition;
064import org.forgerock.opendj.config.Tag;
065import org.forgerock.opendj.config.UndefinedDefaultBehaviorProvider;
066import org.forgerock.opendj.ldap.DN;
067import org.forgerock.opendj.ldap.LdapException;
068import org.forgerock.opendj.server.config.client.AccessLogFilteringCriteriaCfgClient;
069import org.forgerock.opendj.server.config.client.FileBasedAuditLogPublisherCfgClient;
070import org.forgerock.opendj.server.config.client.LogRetentionPolicyCfgClient;
071import org.forgerock.opendj.server.config.client.LogRotationPolicyCfgClient;
072import org.forgerock.opendj.server.config.meta.AccessLogPublisherCfgDefn.FilteringPolicy;
073import org.forgerock.opendj.server.config.server.AccessLogFilteringCriteriaCfg;
074import org.forgerock.opendj.server.config.server.AccessLogPublisherCfg;
075import org.forgerock.opendj.server.config.server.FileBasedAuditLogPublisherCfg;
076import org.forgerock.opendj.server.config.server.LogPublisherCfg;
077import org.forgerock.opendj.server.config.server.LogRetentionPolicyCfg;
078import org.forgerock.opendj.server.config.server.LogRotationPolicyCfg;
079
080
081
082/**
083 * An interface for querying the File Based Audit Log Publisher
084 * managed object definition meta information.
085 * <p>
086 * File Based Audit Log Publishers publish access messages to the file
087 * system.
088 */
089public final class FileBasedAuditLogPublisherCfgDefn extends ManagedObjectDefinition<FileBasedAuditLogPublisherCfgClient, FileBasedAuditLogPublisherCfg> {
090
091  // The singleton configuration definition instance.
092  private static final FileBasedAuditLogPublisherCfgDefn INSTANCE = new FileBasedAuditLogPublisherCfgDefn();
093
094
095
096  // The "append" property definition.
097  private static final BooleanPropertyDefinition PD_APPEND;
098
099
100
101  // The "asynchronous" property definition.
102  private static final BooleanPropertyDefinition PD_ASYNCHRONOUS;
103
104
105
106  // The "auto-flush" property definition.
107  private static final BooleanPropertyDefinition PD_AUTO_FLUSH;
108
109
110
111  // The "buffer-size" property definition.
112  private static final SizePropertyDefinition PD_BUFFER_SIZE;
113
114
115
116  // The "java-class" property definition.
117  private static final ClassPropertyDefinition PD_JAVA_CLASS;
118
119
120
121  // The "log-file" property definition.
122  private static final StringPropertyDefinition PD_LOG_FILE;
123
124
125
126  // The "log-file-permissions" property definition.
127  private static final StringPropertyDefinition PD_LOG_FILE_PERMISSIONS;
128
129
130
131  // The "queue-size" property definition.
132  private static final IntegerPropertyDefinition PD_QUEUE_SIZE;
133
134
135
136  // The "retention-policy" property definition.
137  private static final AggregationPropertyDefinition<LogRetentionPolicyCfgClient, LogRetentionPolicyCfg> PD_RETENTION_POLICY;
138
139
140
141  // The "rotation-policy" property definition.
142  private static final AggregationPropertyDefinition<LogRotationPolicyCfgClient, LogRotationPolicyCfg> PD_ROTATION_POLICY;
143
144
145
146  // The "time-interval" property definition.
147  private static final DurationPropertyDefinition PD_TIME_INTERVAL;
148
149
150
151  // Build the "append" property definition.
152  static {
153      BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "append");
154      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "append"));
155      DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("true");
156      builder.setDefaultBehaviorProvider(provider);
157      PD_APPEND = builder.getInstance();
158      INSTANCE.registerPropertyDefinition(PD_APPEND);
159  }
160
161
162
163  // Build the "asynchronous" property definition.
164  static {
165      BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "asynchronous");
166      builder.setOption(PropertyOption.MANDATORY);
167      builder.setOption(PropertyOption.ADVANCED);
168      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "asynchronous"));
169      DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("true");
170      builder.setDefaultBehaviorProvider(provider);
171      PD_ASYNCHRONOUS = builder.getInstance();
172      INSTANCE.registerPropertyDefinition(PD_ASYNCHRONOUS);
173  }
174
175
176
177  // Build the "auto-flush" property definition.
178  static {
179      BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "auto-flush");
180      builder.setOption(PropertyOption.ADVANCED);
181      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "auto-flush"));
182      DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("true");
183      builder.setDefaultBehaviorProvider(provider);
184      PD_AUTO_FLUSH = builder.getInstance();
185      INSTANCE.registerPropertyDefinition(PD_AUTO_FLUSH);
186  }
187
188
189
190  // Build the "buffer-size" property definition.
191  static {
192      SizePropertyDefinition.Builder builder = SizePropertyDefinition.createBuilder(INSTANCE, "buffer-size");
193      builder.setOption(PropertyOption.ADVANCED);
194      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "buffer-size"));
195      DefaultBehaviorProvider<Long> provider = new DefinedDefaultBehaviorProvider<Long>("64kb");
196      builder.setDefaultBehaviorProvider(provider);
197      builder.setLowerLimit("1");
198      PD_BUFFER_SIZE = builder.getInstance();
199      INSTANCE.registerPropertyDefinition(PD_BUFFER_SIZE);
200  }
201
202
203
204  // Build the "java-class" property definition.
205  static {
206      ClassPropertyDefinition.Builder builder = ClassPropertyDefinition.createBuilder(INSTANCE, "java-class");
207      builder.setOption(PropertyOption.MANDATORY);
208      builder.setOption(PropertyOption.ADVANCED);
209      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "java-class"));
210      DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("org.opends.server.loggers.TextAuditLogPublisher");
211      builder.setDefaultBehaviorProvider(provider);
212      builder.addInstanceOf("org.opends.server.loggers.LogPublisher");
213      PD_JAVA_CLASS = builder.getInstance();
214      INSTANCE.registerPropertyDefinition(PD_JAVA_CLASS);
215  }
216
217
218
219  // Build the "log-file" property definition.
220  static {
221      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "log-file");
222      builder.setOption(PropertyOption.MANDATORY);
223      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "log-file"));
224      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
225      builder.setPattern(".*", "FILE");
226      PD_LOG_FILE = builder.getInstance();
227      INSTANCE.registerPropertyDefinition(PD_LOG_FILE);
228  }
229
230
231
232  // Build the "log-file-permissions" property definition.
233  static {
234      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "log-file-permissions");
235      builder.setOption(PropertyOption.MANDATORY);
236      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "log-file-permissions"));
237      DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("640");
238      builder.setDefaultBehaviorProvider(provider);
239      builder.setPattern("^([0-7][0-7][0-7])$", "MODE");
240      PD_LOG_FILE_PERMISSIONS = builder.getInstance();
241      INSTANCE.registerPropertyDefinition(PD_LOG_FILE_PERMISSIONS);
242  }
243
244
245
246  // Build the "queue-size" property definition.
247  static {
248      IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "queue-size");
249      builder.setOption(PropertyOption.ADVANCED);
250      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.OTHER, INSTANCE, "queue-size"));
251      DefaultBehaviorProvider<Integer> provider = new DefinedDefaultBehaviorProvider<Integer>("5000");
252      builder.setDefaultBehaviorProvider(provider);
253      builder.setLowerLimit(0);
254      PD_QUEUE_SIZE = builder.getInstance();
255      INSTANCE.registerPropertyDefinition(PD_QUEUE_SIZE);
256  }
257
258
259
260  // Build the "retention-policy" property definition.
261  static {
262      AggregationPropertyDefinition.Builder<LogRetentionPolicyCfgClient, LogRetentionPolicyCfg> builder = AggregationPropertyDefinition.createBuilder(INSTANCE, "retention-policy");
263      builder.setOption(PropertyOption.MULTI_VALUED);
264      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "retention-policy"));
265      builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "retention-policy"));
266      builder.setParentPath("/");
267      builder.setRelationDefinition("log-retention-policy");
268      PD_RETENTION_POLICY = builder.getInstance();
269      INSTANCE.registerPropertyDefinition(PD_RETENTION_POLICY);
270      INSTANCE.registerConstraint(PD_RETENTION_POLICY.getSourceConstraint());
271  }
272
273
274
275  // Build the "rotation-policy" property definition.
276  static {
277      AggregationPropertyDefinition.Builder<LogRotationPolicyCfgClient, LogRotationPolicyCfg> builder = AggregationPropertyDefinition.createBuilder(INSTANCE, "rotation-policy");
278      builder.setOption(PropertyOption.MULTI_VALUED);
279      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "rotation-policy"));
280      builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "rotation-policy"));
281      builder.setParentPath("/");
282      builder.setRelationDefinition("log-rotation-policy");
283      PD_ROTATION_POLICY = builder.getInstance();
284      INSTANCE.registerPropertyDefinition(PD_ROTATION_POLICY);
285      INSTANCE.registerConstraint(PD_ROTATION_POLICY.getSourceConstraint());
286  }
287
288
289
290  // Build the "time-interval" property definition.
291  static {
292      DurationPropertyDefinition.Builder builder = DurationPropertyDefinition.createBuilder(INSTANCE, "time-interval");
293      builder.setOption(PropertyOption.ADVANCED);
294      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "time-interval"));
295      DefaultBehaviorProvider<Long> provider = new DefinedDefaultBehaviorProvider<Long>("5s");
296      builder.setDefaultBehaviorProvider(provider);
297      builder.setBaseUnit("ms");
298      builder.setLowerLimit("1");
299      PD_TIME_INTERVAL = builder.getInstance();
300      INSTANCE.registerPropertyDefinition(PD_TIME_INTERVAL);
301  }
302
303
304
305  // Register the tags associated with this managed object definition.
306  static {
307    INSTANCE.registerTag(Tag.valueOf("logging"));
308  }
309
310
311
312  /**
313   * Get the File Based Audit Log Publisher configuration definition
314   * singleton.
315   *
316   * @return Returns the File Based Audit Log Publisher configuration
317   *         definition singleton.
318   */
319  public static FileBasedAuditLogPublisherCfgDefn getInstance() {
320    return INSTANCE;
321  }
322
323
324
325  /**
326   * Private constructor.
327   */
328  private FileBasedAuditLogPublisherCfgDefn() {
329    super("file-based-audit-log-publisher", AccessLogPublisherCfgDefn.getInstance());
330  }
331
332
333
334  /**
335   * {@inheritDoc}
336   */
337  public FileBasedAuditLogPublisherCfgClient createClientConfiguration(
338      ManagedObject<? extends FileBasedAuditLogPublisherCfgClient> impl) {
339    return new FileBasedAuditLogPublisherCfgClientImpl(impl);
340  }
341
342
343
344  /**
345   * {@inheritDoc}
346   */
347  public FileBasedAuditLogPublisherCfg createServerConfiguration(
348      ServerManagedObject<? extends FileBasedAuditLogPublisherCfg> impl) {
349    return new FileBasedAuditLogPublisherCfgServerImpl(impl);
350  }
351
352
353
354  /**
355   * {@inheritDoc}
356   */
357  public Class<FileBasedAuditLogPublisherCfg> getServerConfigurationClass() {
358    return FileBasedAuditLogPublisherCfg.class;
359  }
360
361
362
363  /**
364   * Get the "append" property definition.
365   * <p>
366   * Specifies whether to append to existing log files.
367   *
368   * @return Returns the "append" property definition.
369   */
370  public BooleanPropertyDefinition getAppendPropertyDefinition() {
371    return PD_APPEND;
372  }
373
374
375
376  /**
377   * Get the "asynchronous" property definition.
378   * <p>
379   * Indicates whether the File Based Audit Log Publisher will publish
380   * records asynchronously.
381   *
382   * @return Returns the "asynchronous" property definition.
383   */
384  public BooleanPropertyDefinition getAsynchronousPropertyDefinition() {
385    return PD_ASYNCHRONOUS;
386  }
387
388
389
390  /**
391   * Get the "auto-flush" property definition.
392   * <p>
393   * Specifies whether to flush the writer after every log record.
394   * <p>
395   * If the asynchronous writes option is used, the writer is flushed
396   * after all the log records in the queue are written.
397   *
398   * @return Returns the "auto-flush" property definition.
399   */
400  public BooleanPropertyDefinition getAutoFlushPropertyDefinition() {
401    return PD_AUTO_FLUSH;
402  }
403
404
405
406  /**
407   * Get the "buffer-size" property definition.
408   * <p>
409   * Specifies the log file buffer size.
410   *
411   * @return Returns the "buffer-size" property definition.
412   */
413  public SizePropertyDefinition getBufferSizePropertyDefinition() {
414    return PD_BUFFER_SIZE;
415  }
416
417
418
419  /**
420   * Get the "enabled" property definition.
421   * <p>
422   * Indicates whether the File Based Audit Log Publisher is enabled
423   * for use.
424   *
425   * @return Returns the "enabled" property definition.
426   */
427  public BooleanPropertyDefinition getEnabledPropertyDefinition() {
428    return AccessLogPublisherCfgDefn.getInstance().getEnabledPropertyDefinition();
429  }
430
431
432
433  /**
434   * Get the "filtering-policy" property definition.
435   * <p>
436   * Specifies how filtering criteria should be applied to log
437   * records.
438   *
439   * @return Returns the "filtering-policy" property definition.
440   */
441  public EnumPropertyDefinition<FilteringPolicy> getFilteringPolicyPropertyDefinition() {
442    return AccessLogPublisherCfgDefn.getInstance().getFilteringPolicyPropertyDefinition();
443  }
444
445
446
447  /**
448   * Get the "java-class" property definition.
449   * <p>
450   * The fully-qualified name of the Java class that provides the File
451   * Based Audit Log Publisher implementation.
452   *
453   * @return Returns the "java-class" property definition.
454   */
455  public ClassPropertyDefinition getJavaClassPropertyDefinition() {
456    return PD_JAVA_CLASS;
457  }
458
459
460
461  /**
462   * Get the "log-file" property definition.
463   * <p>
464   * The file name to use for the log files generated by the File
465   * Based Audit Log Publisher. The path to the file is relative to the
466   * server root.
467   *
468   * @return Returns the "log-file" property definition.
469   */
470  public StringPropertyDefinition getLogFilePropertyDefinition() {
471    return PD_LOG_FILE;
472  }
473
474
475
476  /**
477   * Get the "log-file-permissions" property definition.
478   * <p>
479   * The UNIX permissions of the log files created by this File Based
480   * Audit Log Publisher.
481   *
482   * @return Returns the "log-file-permissions" property definition.
483   */
484  public StringPropertyDefinition getLogFilePermissionsPropertyDefinition() {
485    return PD_LOG_FILE_PERMISSIONS;
486  }
487
488
489
490  /**
491   * Get the "queue-size" property definition.
492   * <p>
493   * The maximum number of log records that can be stored in the
494   * asynchronous queue.
495   * <p>
496   * Setting the queue size to zero activates parallel log writer
497   * implementation which has no queue size limit and as such the
498   * parallel log writer should only be used on a very well tuned
499   * server configuration to avoid potential out of memory errors.
500   *
501   * @return Returns the "queue-size" property definition.
502   */
503  public IntegerPropertyDefinition getQueueSizePropertyDefinition() {
504    return PD_QUEUE_SIZE;
505  }
506
507
508
509  /**
510   * Get the "retention-policy" property definition.
511   * <p>
512   * The retention policy to use for the File Based Audit Log
513   * Publisher .
514   * <p>
515   * When multiple policies are used, log files are cleaned when any
516   * of the policy's conditions are met.
517   *
518   * @return Returns the "retention-policy" property definition.
519   */
520  public AggregationPropertyDefinition<LogRetentionPolicyCfgClient, LogRetentionPolicyCfg> getRetentionPolicyPropertyDefinition() {
521    return PD_RETENTION_POLICY;
522  }
523
524
525
526  /**
527   * Get the "rotation-policy" property definition.
528   * <p>
529   * The rotation policy to use for the File Based Audit Log Publisher
530   * .
531   * <p>
532   * When multiple policies are used, rotation will occur if any
533   * policy's conditions are met.
534   *
535   * @return Returns the "rotation-policy" property definition.
536   */
537  public AggregationPropertyDefinition<LogRotationPolicyCfgClient, LogRotationPolicyCfg> getRotationPolicyPropertyDefinition() {
538    return PD_ROTATION_POLICY;
539  }
540
541
542
543  /**
544   * Get the "suppress-internal-operations" property definition.
545   * <p>
546   * Indicates whether internal operations (for example, operations
547   * that are initiated by plugins) should be logged along with the
548   * operations that are requested by users.
549   *
550   * @return Returns the "suppress-internal-operations" property definition.
551   */
552  public BooleanPropertyDefinition getSuppressInternalOperationsPropertyDefinition() {
553    return AccessLogPublisherCfgDefn.getInstance().getSuppressInternalOperationsPropertyDefinition();
554  }
555
556
557
558  /**
559   * Get the "suppress-synchronization-operations" property definition.
560   * <p>
561   * Indicates whether access messages that are generated by
562   * synchronization operations should be suppressed.
563   *
564   * @return Returns the "suppress-synchronization-operations" property definition.
565   */
566  public BooleanPropertyDefinition getSuppressSynchronizationOperationsPropertyDefinition() {
567    return AccessLogPublisherCfgDefn.getInstance().getSuppressSynchronizationOperationsPropertyDefinition();
568  }
569
570
571
572  /**
573   * Get the "time-interval" property definition.
574   * <p>
575   * Specifies the interval at which to check whether the log files
576   * need to be rotated.
577   *
578   * @return Returns the "time-interval" property definition.
579   */
580  public DurationPropertyDefinition getTimeIntervalPropertyDefinition() {
581    return PD_TIME_INTERVAL;
582  }
583
584
585
586  /**
587   * Get the "access-log-filtering-criteria" relation definition.
588   *
589   * @return Returns the "access-log-filtering-criteria" relation definition.
590   */
591  public InstantiableRelationDefinition<AccessLogFilteringCriteriaCfgClient,AccessLogFilteringCriteriaCfg> getAccessLogFilteringCriteriaRelationDefinition() {
592    return AccessLogPublisherCfgDefn.getInstance().getAccessLogFilteringCriteriaRelationDefinition();
593  }
594
595
596
597  /**
598   * Managed object client implementation.
599   */
600  private static class FileBasedAuditLogPublisherCfgClientImpl implements
601    FileBasedAuditLogPublisherCfgClient {
602
603    // Private implementation.
604    private ManagedObject<? extends FileBasedAuditLogPublisherCfgClient> impl;
605
606
607
608    // Private constructor.
609    private FileBasedAuditLogPublisherCfgClientImpl(
610        ManagedObject<? extends FileBasedAuditLogPublisherCfgClient> impl) {
611      this.impl = impl;
612    }
613
614
615
616    /**
617     * {@inheritDoc}
618     */
619    public boolean isAppend() {
620      return impl.getPropertyValue(INSTANCE.getAppendPropertyDefinition());
621    }
622
623
624
625    /**
626     * {@inheritDoc}
627     */
628    public void setAppend(Boolean value) {
629      impl.setPropertyValue(INSTANCE.getAppendPropertyDefinition(), value);
630    }
631
632
633
634    /**
635     * {@inheritDoc}
636     */
637    public boolean isAsynchronous() {
638      return impl.getPropertyValue(INSTANCE.getAsynchronousPropertyDefinition());
639    }
640
641
642
643    /**
644     * {@inheritDoc}
645     */
646    public void setAsynchronous(boolean value) {
647      impl.setPropertyValue(INSTANCE.getAsynchronousPropertyDefinition(), value);
648    }
649
650
651
652    /**
653     * {@inheritDoc}
654     */
655    public boolean isAutoFlush() {
656      return impl.getPropertyValue(INSTANCE.getAutoFlushPropertyDefinition());
657    }
658
659
660
661    /**
662     * {@inheritDoc}
663     */
664    public void setAutoFlush(Boolean value) {
665      impl.setPropertyValue(INSTANCE.getAutoFlushPropertyDefinition(), value);
666    }
667
668
669
670    /**
671     * {@inheritDoc}
672     */
673    public long getBufferSize() {
674      return impl.getPropertyValue(INSTANCE.getBufferSizePropertyDefinition());
675    }
676
677
678
679    /**
680     * {@inheritDoc}
681     */
682    public void setBufferSize(Long value) {
683      impl.setPropertyValue(INSTANCE.getBufferSizePropertyDefinition(), value);
684    }
685
686
687
688    /**
689     * {@inheritDoc}
690     */
691    public Boolean isEnabled() {
692      return impl.getPropertyValue(INSTANCE.getEnabledPropertyDefinition());
693    }
694
695
696
697    /**
698     * {@inheritDoc}
699     */
700    public void setEnabled(boolean value) {
701      impl.setPropertyValue(INSTANCE.getEnabledPropertyDefinition(), value);
702    }
703
704
705
706    /**
707     * {@inheritDoc}
708     */
709    public FilteringPolicy getFilteringPolicy() {
710      return impl.getPropertyValue(INSTANCE.getFilteringPolicyPropertyDefinition());
711    }
712
713
714
715    /**
716     * {@inheritDoc}
717     */
718    public void setFilteringPolicy(FilteringPolicy value) {
719      impl.setPropertyValue(INSTANCE.getFilteringPolicyPropertyDefinition(), value);
720    }
721
722
723
724    /**
725     * {@inheritDoc}
726     */
727    public String getJavaClass() {
728      return impl.getPropertyValue(INSTANCE.getJavaClassPropertyDefinition());
729    }
730
731
732
733    /**
734     * {@inheritDoc}
735     */
736    public void setJavaClass(String value) {
737      impl.setPropertyValue(INSTANCE.getJavaClassPropertyDefinition(), value);
738    }
739
740
741
742    /**
743     * {@inheritDoc}
744     */
745    public String getLogFile() {
746      return impl.getPropertyValue(INSTANCE.getLogFilePropertyDefinition());
747    }
748
749
750
751    /**
752     * {@inheritDoc}
753     */
754    public void setLogFile(String value) {
755      impl.setPropertyValue(INSTANCE.getLogFilePropertyDefinition(), value);
756    }
757
758
759
760    /**
761     * {@inheritDoc}
762     */
763    public String getLogFilePermissions() {
764      return impl.getPropertyValue(INSTANCE.getLogFilePermissionsPropertyDefinition());
765    }
766
767
768
769    /**
770     * {@inheritDoc}
771     */
772    public void setLogFilePermissions(String value) {
773      impl.setPropertyValue(INSTANCE.getLogFilePermissionsPropertyDefinition(), value);
774    }
775
776
777
778    /**
779     * {@inheritDoc}
780     */
781    public int getQueueSize() {
782      return impl.getPropertyValue(INSTANCE.getQueueSizePropertyDefinition());
783    }
784
785
786
787    /**
788     * {@inheritDoc}
789     */
790    public void setQueueSize(Integer value) {
791      impl.setPropertyValue(INSTANCE.getQueueSizePropertyDefinition(), value);
792    }
793
794
795
796    /**
797     * {@inheritDoc}
798     */
799    public SortedSet<String> getRetentionPolicy() {
800      return impl.getPropertyValues(INSTANCE.getRetentionPolicyPropertyDefinition());
801    }
802
803
804
805    /**
806     * {@inheritDoc}
807     */
808    public void setRetentionPolicy(Collection<String> values) {
809      impl.setPropertyValues(INSTANCE.getRetentionPolicyPropertyDefinition(), values);
810    }
811
812
813
814    /**
815     * {@inheritDoc}
816     */
817    public SortedSet<String> getRotationPolicy() {
818      return impl.getPropertyValues(INSTANCE.getRotationPolicyPropertyDefinition());
819    }
820
821
822
823    /**
824     * {@inheritDoc}
825     */
826    public void setRotationPolicy(Collection<String> values) {
827      impl.setPropertyValues(INSTANCE.getRotationPolicyPropertyDefinition(), values);
828    }
829
830
831
832    /**
833     * {@inheritDoc}
834     */
835    public boolean isSuppressInternalOperations() {
836      return impl.getPropertyValue(INSTANCE.getSuppressInternalOperationsPropertyDefinition());
837    }
838
839
840
841    /**
842     * {@inheritDoc}
843     */
844    public void setSuppressInternalOperations(Boolean value) {
845      impl.setPropertyValue(INSTANCE.getSuppressInternalOperationsPropertyDefinition(), value);
846    }
847
848
849
850    /**
851     * {@inheritDoc}
852     */
853    public boolean isSuppressSynchronizationOperations() {
854      return impl.getPropertyValue(INSTANCE.getSuppressSynchronizationOperationsPropertyDefinition());
855    }
856
857
858
859    /**
860     * {@inheritDoc}
861     */
862    public void setSuppressSynchronizationOperations(Boolean value) {
863      impl.setPropertyValue(INSTANCE.getSuppressSynchronizationOperationsPropertyDefinition(), value);
864    }
865
866
867
868    /**
869     * {@inheritDoc}
870     */
871    public long getTimeInterval() {
872      return impl.getPropertyValue(INSTANCE.getTimeIntervalPropertyDefinition());
873    }
874
875
876
877    /**
878     * {@inheritDoc}
879     */
880    public void setTimeInterval(Long value) {
881      impl.setPropertyValue(INSTANCE.getTimeIntervalPropertyDefinition(), value);
882    }
883
884
885
886    /**
887     * {@inheritDoc}
888     */
889    public String[] listAccessLogFilteringCriteria() throws ConcurrentModificationException,
890        LdapException {
891      return impl.listChildren(INSTANCE.getAccessLogFilteringCriteriaRelationDefinition());
892    }
893
894
895
896    /**
897     * {@inheritDoc}
898     */
899    public AccessLogFilteringCriteriaCfgClient getAccessLogFilteringCriteria(String name)
900        throws DefinitionDecodingException, ManagedObjectDecodingException,
901        ManagedObjectNotFoundException, ConcurrentModificationException,
902        LdapException {
903      return impl.getChild(INSTANCE.getAccessLogFilteringCriteriaRelationDefinition(), name).getConfiguration();
904    }
905
906
907
908    /**
909     * {@inheritDoc}
910     */
911    public <M extends AccessLogFilteringCriteriaCfgClient> M createAccessLogFilteringCriteria(
912        ManagedObjectDefinition<M, ? extends AccessLogFilteringCriteriaCfg> d, String name, Collection<PropertyException> exceptions) throws IllegalManagedObjectNameException {
913      return impl.createChild(INSTANCE.getAccessLogFilteringCriteriaRelationDefinition(), d, name, exceptions).getConfiguration();
914    }
915
916
917
918    /**
919     * {@inheritDoc}
920     */
921    public void removeAccessLogFilteringCriteria(String name)
922        throws ManagedObjectNotFoundException, ConcurrentModificationException,
923        OperationRejectedException, LdapException {
924      impl.removeChild(INSTANCE.getAccessLogFilteringCriteriaRelationDefinition(), name);
925    }
926
927
928
929    /**
930     * {@inheritDoc}
931     */
932    public ManagedObjectDefinition<? extends FileBasedAuditLogPublisherCfgClient, ? extends FileBasedAuditLogPublisherCfg> definition() {
933      return INSTANCE;
934    }
935
936
937
938    /**
939     * {@inheritDoc}
940     */
941    public PropertyProvider properties() {
942      return impl;
943    }
944
945
946
947    /**
948     * {@inheritDoc}
949     */
950    public void commit() throws ManagedObjectAlreadyExistsException,
951        MissingMandatoryPropertiesException, ConcurrentModificationException,
952        OperationRejectedException, LdapException {
953      impl.commit();
954    }
955
956  }
957
958
959
960  /**
961   * Managed object server implementation.
962   */
963  private static class FileBasedAuditLogPublisherCfgServerImpl implements
964    FileBasedAuditLogPublisherCfg {
965
966    // Private implementation.
967    private ServerManagedObject<? extends FileBasedAuditLogPublisherCfg> impl;
968
969    // The value of the "append" property.
970    private final boolean pAppend;
971
972    // The value of the "asynchronous" property.
973    private final boolean pAsynchronous;
974
975    // The value of the "auto-flush" property.
976    private final boolean pAutoFlush;
977
978    // The value of the "buffer-size" property.
979    private final long pBufferSize;
980
981    // The value of the "enabled" property.
982    private final boolean pEnabled;
983
984    // The value of the "filtering-policy" property.
985    private final FilteringPolicy pFilteringPolicy;
986
987    // The value of the "java-class" property.
988    private final String pJavaClass;
989
990    // The value of the "log-file" property.
991    private final String pLogFile;
992
993    // The value of the "log-file-permissions" property.
994    private final String pLogFilePermissions;
995
996    // The value of the "queue-size" property.
997    private final int pQueueSize;
998
999    // The value of the "retention-policy" property.
1000    private final SortedSet<String> pRetentionPolicy;
1001
1002    // The value of the "rotation-policy" property.
1003    private final SortedSet<String> pRotationPolicy;
1004
1005    // The value of the "suppress-internal-operations" property.
1006    private final boolean pSuppressInternalOperations;
1007
1008    // The value of the "suppress-synchronization-operations" property.
1009    private final boolean pSuppressSynchronizationOperations;
1010
1011    // The value of the "time-interval" property.
1012    private final long pTimeInterval;
1013
1014
1015
1016    // Private constructor.
1017    private FileBasedAuditLogPublisherCfgServerImpl(ServerManagedObject<? extends FileBasedAuditLogPublisherCfg> impl) {
1018      this.impl = impl;
1019      this.pAppend = impl.getPropertyValue(INSTANCE.getAppendPropertyDefinition());
1020      this.pAsynchronous = impl.getPropertyValue(INSTANCE.getAsynchronousPropertyDefinition());
1021      this.pAutoFlush = impl.getPropertyValue(INSTANCE.getAutoFlushPropertyDefinition());
1022      this.pBufferSize = impl.getPropertyValue(INSTANCE.getBufferSizePropertyDefinition());
1023      this.pEnabled = impl.getPropertyValue(INSTANCE.getEnabledPropertyDefinition());
1024      this.pFilteringPolicy = impl.getPropertyValue(INSTANCE.getFilteringPolicyPropertyDefinition());
1025      this.pJavaClass = impl.getPropertyValue(INSTANCE.getJavaClassPropertyDefinition());
1026      this.pLogFile = impl.getPropertyValue(INSTANCE.getLogFilePropertyDefinition());
1027      this.pLogFilePermissions = impl.getPropertyValue(INSTANCE.getLogFilePermissionsPropertyDefinition());
1028      this.pQueueSize = impl.getPropertyValue(INSTANCE.getQueueSizePropertyDefinition());
1029      this.pRetentionPolicy = impl.getPropertyValues(INSTANCE.getRetentionPolicyPropertyDefinition());
1030      this.pRotationPolicy = impl.getPropertyValues(INSTANCE.getRotationPolicyPropertyDefinition());
1031      this.pSuppressInternalOperations = impl.getPropertyValue(INSTANCE.getSuppressInternalOperationsPropertyDefinition());
1032      this.pSuppressSynchronizationOperations = impl.getPropertyValue(INSTANCE.getSuppressSynchronizationOperationsPropertyDefinition());
1033      this.pTimeInterval = impl.getPropertyValue(INSTANCE.getTimeIntervalPropertyDefinition());
1034    }
1035
1036
1037
1038    /**
1039     * {@inheritDoc}
1040     */
1041    public void addFileBasedAuditChangeListener(
1042        ConfigurationChangeListener<FileBasedAuditLogPublisherCfg> listener) {
1043      impl.registerChangeListener(listener);
1044    }
1045
1046
1047
1048    /**
1049     * {@inheritDoc}
1050     */
1051    public void removeFileBasedAuditChangeListener(
1052        ConfigurationChangeListener<FileBasedAuditLogPublisherCfg> listener) {
1053      impl.deregisterChangeListener(listener);
1054    }
1055    /**
1056     * {@inheritDoc}
1057     */
1058    public void addAccessChangeListener(
1059        ConfigurationChangeListener<AccessLogPublisherCfg> listener) {
1060      impl.registerChangeListener(listener);
1061    }
1062
1063
1064
1065    /**
1066     * {@inheritDoc}
1067     */
1068    public void removeAccessChangeListener(
1069        ConfigurationChangeListener<AccessLogPublisherCfg> listener) {
1070      impl.deregisterChangeListener(listener);
1071    }
1072    /**
1073     * {@inheritDoc}
1074     */
1075    public void addChangeListener(
1076        ConfigurationChangeListener<LogPublisherCfg> listener) {
1077      impl.registerChangeListener(listener);
1078    }
1079
1080
1081
1082    /**
1083     * {@inheritDoc}
1084     */
1085    public void removeChangeListener(
1086        ConfigurationChangeListener<LogPublisherCfg> listener) {
1087      impl.deregisterChangeListener(listener);
1088    }
1089
1090
1091
1092    /**
1093     * {@inheritDoc}
1094     */
1095    public boolean isAppend() {
1096      return pAppend;
1097    }
1098
1099
1100
1101    /**
1102     * {@inheritDoc}
1103     */
1104    public boolean isAsynchronous() {
1105      return pAsynchronous;
1106    }
1107
1108
1109
1110    /**
1111     * {@inheritDoc}
1112     */
1113    public boolean isAutoFlush() {
1114      return pAutoFlush;
1115    }
1116
1117
1118
1119    /**
1120     * {@inheritDoc}
1121     */
1122    public long getBufferSize() {
1123      return pBufferSize;
1124    }
1125
1126
1127
1128    /**
1129     * {@inheritDoc}
1130     */
1131    public boolean isEnabled() {
1132      return pEnabled;
1133    }
1134
1135
1136
1137    /**
1138     * {@inheritDoc}
1139     */
1140    public FilteringPolicy getFilteringPolicy() {
1141      return pFilteringPolicy;
1142    }
1143
1144
1145
1146    /**
1147     * {@inheritDoc}
1148     */
1149    public String getJavaClass() {
1150      return pJavaClass;
1151    }
1152
1153
1154
1155    /**
1156     * {@inheritDoc}
1157     */
1158    public String getLogFile() {
1159      return pLogFile;
1160    }
1161
1162
1163
1164    /**
1165     * {@inheritDoc}
1166     */
1167    public String getLogFilePermissions() {
1168      return pLogFilePermissions;
1169    }
1170
1171
1172
1173    /**
1174     * {@inheritDoc}
1175     */
1176    public int getQueueSize() {
1177      return pQueueSize;
1178    }
1179
1180
1181
1182    /**
1183     * {@inheritDoc}
1184     */
1185    public SortedSet<String> getRetentionPolicy() {
1186      return pRetentionPolicy;
1187    }
1188
1189
1190
1191    /**
1192     * {@inheritDoc}
1193     */
1194    public SortedSet<DN> getRetentionPolicyDNs() {
1195      SortedSet<String> values = getRetentionPolicy();
1196      SortedSet<DN> dnValues = new TreeSet<DN>();
1197      for (String value : values) {
1198        DN dn = INSTANCE.getRetentionPolicyPropertyDefinition().getChildDN(value);
1199        dnValues.add(dn);
1200      }
1201      return dnValues;
1202    }
1203
1204
1205
1206    /**
1207     * {@inheritDoc}
1208     */
1209    public SortedSet<String> getRotationPolicy() {
1210      return pRotationPolicy;
1211    }
1212
1213
1214
1215    /**
1216     * {@inheritDoc}
1217     */
1218    public SortedSet<DN> getRotationPolicyDNs() {
1219      SortedSet<String> values = getRotationPolicy();
1220      SortedSet<DN> dnValues = new TreeSet<DN>();
1221      for (String value : values) {
1222        DN dn = INSTANCE.getRotationPolicyPropertyDefinition().getChildDN(value);
1223        dnValues.add(dn);
1224      }
1225      return dnValues;
1226    }
1227
1228
1229
1230    /**
1231     * {@inheritDoc}
1232     */
1233    public boolean isSuppressInternalOperations() {
1234      return pSuppressInternalOperations;
1235    }
1236
1237
1238
1239    /**
1240     * {@inheritDoc}
1241     */
1242    public boolean isSuppressSynchronizationOperations() {
1243      return pSuppressSynchronizationOperations;
1244    }
1245
1246
1247
1248    /**
1249     * {@inheritDoc}
1250     */
1251    public long getTimeInterval() {
1252      return pTimeInterval;
1253    }
1254
1255
1256
1257    /**
1258     * {@inheritDoc}
1259     */
1260    public String[] listAccessLogFilteringCriteria() {
1261      return impl.listChildren(INSTANCE.getAccessLogFilteringCriteriaRelationDefinition());
1262    }
1263
1264
1265
1266    /**
1267     * {@inheritDoc}
1268     */
1269    public AccessLogFilteringCriteriaCfg getAccessLogFilteringCriteria(String name) throws ConfigException {
1270      return impl.getChild(INSTANCE.getAccessLogFilteringCriteriaRelationDefinition(), name).getConfiguration();
1271    }
1272
1273
1274
1275    /**
1276     * {@inheritDoc}
1277     */
1278    public void addAccessLogFilteringCriteriaAddListener(
1279        ConfigurationAddListener<AccessLogFilteringCriteriaCfg> listener) throws ConfigException {
1280      impl.registerAddListener(INSTANCE.getAccessLogFilteringCriteriaRelationDefinition(), listener);
1281    }
1282
1283
1284
1285    /**
1286     * {@inheritDoc}
1287     */
1288    public void removeAccessLogFilteringCriteriaAddListener(
1289        ConfigurationAddListener<AccessLogFilteringCriteriaCfg> listener) {
1290      impl.deregisterAddListener(INSTANCE.getAccessLogFilteringCriteriaRelationDefinition(), listener);
1291    }
1292
1293
1294
1295    /**
1296     * {@inheritDoc}
1297     */
1298    public void addAccessLogFilteringCriteriaDeleteListener(
1299        ConfigurationDeleteListener<AccessLogFilteringCriteriaCfg> listener) throws ConfigException {
1300      impl.registerDeleteListener(INSTANCE.getAccessLogFilteringCriteriaRelationDefinition(), listener);
1301    }
1302
1303
1304
1305    /**
1306     * {@inheritDoc}
1307     */
1308    public void removeAccessLogFilteringCriteriaDeleteListener(
1309        ConfigurationDeleteListener<AccessLogFilteringCriteriaCfg> listener) {
1310      impl.deregisterDeleteListener(INSTANCE.getAccessLogFilteringCriteriaRelationDefinition(), listener);
1311    }
1312
1313
1314
1315    /**
1316     * {@inheritDoc}
1317     */
1318    public Class<? extends FileBasedAuditLogPublisherCfg> configurationClass() {
1319      return FileBasedAuditLogPublisherCfg.class;
1320    }
1321
1322
1323
1324    /**
1325     * {@inheritDoc}
1326     */
1327    public DN dn() {
1328      return impl.getDN();
1329    }
1330
1331  }
1332}