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