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