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.ManagedObject;
040import org.forgerock.opendj.config.client.MissingMandatoryPropertiesException;
041import org.forgerock.opendj.config.client.OperationRejectedException;
042import org.forgerock.opendj.config.DefaultBehaviorProvider;
043import org.forgerock.opendj.config.DefinedDefaultBehaviorProvider;
044import org.forgerock.opendj.config.DurationPropertyDefinition;
045import org.forgerock.opendj.config.ManagedObjectAlreadyExistsException;
046import org.forgerock.opendj.config.ManagedObjectDefinition;
047import org.forgerock.opendj.config.PropertyOption;
048import org.forgerock.opendj.config.PropertyProvider;
049import org.forgerock.opendj.config.server.ConfigurationChangeListener;
050import org.forgerock.opendj.config.server.ServerManagedObject;
051import org.forgerock.opendj.config.StringPropertyDefinition;
052import org.forgerock.opendj.config.Tag;
053import org.forgerock.opendj.config.UndefinedDefaultBehaviorProvider;
054import org.forgerock.opendj.ldap.DN;
055import org.forgerock.opendj.ldap.LdapException;
056import org.forgerock.opendj.server.config.client.CsvFileHTTPAccessLogPublisherCfgClient;
057import org.forgerock.opendj.server.config.client.LogRetentionPolicyCfgClient;
058import org.forgerock.opendj.server.config.client.LogRotationPolicyCfgClient;
059import org.forgerock.opendj.server.config.server.CsvFileHTTPAccessLogPublisherCfg;
060import org.forgerock.opendj.server.config.server.HTTPAccessLogPublisherCfg;
061import org.forgerock.opendj.server.config.server.LogPublisherCfg;
062import org.forgerock.opendj.server.config.server.LogRetentionPolicyCfg;
063import org.forgerock.opendj.server.config.server.LogRotationPolicyCfg;
064
065
066
067/**
068 * An interface for querying the Csv File HTTP Access Log Publisher
069 * managed object definition meta information.
070 * <p>
071 * Csv File HTTP Access Log Publishers publish HTTP access messages to
072 * CSV files.
073 */
074public final class CsvFileHTTPAccessLogPublisherCfgDefn extends ManagedObjectDefinition<CsvFileHTTPAccessLogPublisherCfgClient, CsvFileHTTPAccessLogPublisherCfg> {
075
076  /** The singleton configuration definition instance. */
077  private static final CsvFileHTTPAccessLogPublisherCfgDefn INSTANCE = new CsvFileHTTPAccessLogPublisherCfgDefn();
078
079
080
081  /** The "asynchronous" property definition. */
082  private static final BooleanPropertyDefinition PD_ASYNCHRONOUS;
083
084
085
086  /** The "auto-flush" property definition. */
087  private static final BooleanPropertyDefinition PD_AUTO_FLUSH;
088
089
090
091  /** The "csv-delimiter-char" property definition. */
092  private static final StringPropertyDefinition PD_CSV_DELIMITER_CHAR;
093
094
095
096  /** The "csv-eol-symbols" property definition. */
097  private static final StringPropertyDefinition PD_CSV_EOL_SYMBOLS;
098
099
100
101  /** The "csv-quote-char" property definition. */
102  private static final StringPropertyDefinition PD_CSV_QUOTE_CHAR;
103
104
105
106  /** The "java-class" property definition. */
107  private static final ClassPropertyDefinition PD_JAVA_CLASS;
108
109
110
111  /** The "key-store-file" property definition. */
112  private static final StringPropertyDefinition PD_KEY_STORE_FILE;
113
114
115
116  /** The "key-store-pin-file" property definition. */
117  private static final StringPropertyDefinition PD_KEY_STORE_PIN_FILE;
118
119
120
121  /** The "log-directory" property definition. */
122  private static final StringPropertyDefinition PD_LOG_DIRECTORY;
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 "signature-time-interval" property definition. */
137  private static final DurationPropertyDefinition PD_SIGNATURE_TIME_INTERVAL;
138
139
140
141  /** The "tamper-evident" property definition. */
142  private static final BooleanPropertyDefinition PD_TAMPER_EVIDENT;
143
144
145
146  /** Build the "asynchronous" property definition. */
147  static {
148      BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "asynchronous");
149      builder.setOption(PropertyOption.MANDATORY);
150      builder.setOption(PropertyOption.ADVANCED);
151      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "asynchronous"));
152      DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("true");
153      builder.setDefaultBehaviorProvider(provider);
154      PD_ASYNCHRONOUS = builder.getInstance();
155      INSTANCE.registerPropertyDefinition(PD_ASYNCHRONOUS);
156  }
157
158
159
160  /** Build the "auto-flush" property definition. */
161  static {
162      BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "auto-flush");
163      builder.setOption(PropertyOption.ADVANCED);
164      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "auto-flush"));
165      DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("true");
166      builder.setDefaultBehaviorProvider(provider);
167      PD_AUTO_FLUSH = builder.getInstance();
168      INSTANCE.registerPropertyDefinition(PD_AUTO_FLUSH);
169  }
170
171
172
173  /** Build the "csv-delimiter-char" property definition. */
174  static {
175      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "csv-delimiter-char");
176      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "csv-delimiter-char"));
177      DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>(",");
178      builder.setDefaultBehaviorProvider(provider);
179      builder.setPattern(".*", "DELIMITER CHARACTER");
180      PD_CSV_DELIMITER_CHAR = builder.getInstance();
181      INSTANCE.registerPropertyDefinition(PD_CSV_DELIMITER_CHAR);
182  }
183
184
185
186  /** Build the "csv-eol-symbols" property definition. */
187  static {
188      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "csv-eol-symbols");
189      builder.setOption(PropertyOption.ADVANCED);
190      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "csv-eol-symbols"));
191      builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "csv-eol-symbols"));
192      builder.setPattern(".*", "EOL SYMBOLS");
193      PD_CSV_EOL_SYMBOLS = builder.getInstance();
194      INSTANCE.registerPropertyDefinition(PD_CSV_EOL_SYMBOLS);
195  }
196
197
198
199  /** Build the "csv-quote-char" property definition. */
200  static {
201      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "csv-quote-char");
202      builder.setOption(PropertyOption.ADVANCED);
203      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "csv-quote-char"));
204      DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("\"");
205      builder.setDefaultBehaviorProvider(provider);
206      builder.setPattern(".*", "QUOTE CHARACTER");
207      PD_CSV_QUOTE_CHAR = builder.getInstance();
208      INSTANCE.registerPropertyDefinition(PD_CSV_QUOTE_CHAR);
209  }
210
211
212
213  /** Build the "java-class" property definition. */
214  static {
215      ClassPropertyDefinition.Builder builder = ClassPropertyDefinition.createBuilder(INSTANCE, "java-class");
216      builder.setOption(PropertyOption.MANDATORY);
217      builder.setOption(PropertyOption.ADVANCED);
218      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "java-class"));
219      DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("org.opends.server.loggers.CommonAuditHTTPAccessLogPublisher");
220      builder.setDefaultBehaviorProvider(provider);
221      builder.addInstanceOf("org.opends.server.loggers.LogPublisher");
222      PD_JAVA_CLASS = builder.getInstance();
223      INSTANCE.registerPropertyDefinition(PD_JAVA_CLASS);
224  }
225
226
227
228  /** Build the "key-store-file" property definition. */
229  static {
230      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "key-store-file");
231      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "key-store-file"));
232      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
233      builder.setPattern(".*", "FILE");
234      PD_KEY_STORE_FILE = builder.getInstance();
235      INSTANCE.registerPropertyDefinition(PD_KEY_STORE_FILE);
236  }
237
238
239
240  /** Build the "key-store-pin-file" property definition. */
241  static {
242      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "key-store-pin-file");
243      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "key-store-pin-file"));
244      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
245      builder.setPattern(".*", "FILE");
246      PD_KEY_STORE_PIN_FILE = builder.getInstance();
247      INSTANCE.registerPropertyDefinition(PD_KEY_STORE_PIN_FILE);
248  }
249
250
251
252  /** Build the "log-directory" property definition. */
253  static {
254      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "log-directory");
255      builder.setOption(PropertyOption.MANDATORY);
256      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "log-directory"));
257      DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("logs");
258      builder.setDefaultBehaviorProvider(provider);
259      builder.setPattern(".*", "DIRECTORY");
260      PD_LOG_DIRECTORY = builder.getInstance();
261      INSTANCE.registerPropertyDefinition(PD_LOG_DIRECTORY);
262  }
263
264
265
266  /** Build the "retention-policy" property definition. */
267  static {
268      AggregationPropertyDefinition.Builder<LogRetentionPolicyCfgClient, LogRetentionPolicyCfg> builder = AggregationPropertyDefinition.createBuilder(INSTANCE, "retention-policy");
269      builder.setOption(PropertyOption.MULTI_VALUED);
270      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "retention-policy"));
271      builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "retention-policy"));
272      builder.setParentPath("/");
273      builder.setRelationDefinition("log-retention-policy");
274      PD_RETENTION_POLICY = builder.getInstance();
275      INSTANCE.registerPropertyDefinition(PD_RETENTION_POLICY);
276      INSTANCE.registerConstraint(PD_RETENTION_POLICY.getSourceConstraint());
277  }
278
279
280
281  /** Build the "rotation-policy" property definition. */
282  static {
283      AggregationPropertyDefinition.Builder<LogRotationPolicyCfgClient, LogRotationPolicyCfg> builder = AggregationPropertyDefinition.createBuilder(INSTANCE, "rotation-policy");
284      builder.setOption(PropertyOption.MULTI_VALUED);
285      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "rotation-policy"));
286      builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "rotation-policy"));
287      builder.setParentPath("/");
288      builder.setRelationDefinition("log-rotation-policy");
289      PD_ROTATION_POLICY = builder.getInstance();
290      INSTANCE.registerPropertyDefinition(PD_ROTATION_POLICY);
291      INSTANCE.registerConstraint(PD_ROTATION_POLICY.getSourceConstraint());
292  }
293
294
295
296  /** Build the "signature-time-interval" property definition. */
297  static {
298      DurationPropertyDefinition.Builder builder = DurationPropertyDefinition.createBuilder(INSTANCE, "signature-time-interval");
299      builder.setOption(PropertyOption.ADVANCED);
300      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "signature-time-interval"));
301      DefaultBehaviorProvider<Long> provider = new DefinedDefaultBehaviorProvider<Long>("3s");
302      builder.setDefaultBehaviorProvider(provider);
303      builder.setBaseUnit("ms");
304      builder.setLowerLimit("1");
305      PD_SIGNATURE_TIME_INTERVAL = builder.getInstance();
306      INSTANCE.registerPropertyDefinition(PD_SIGNATURE_TIME_INTERVAL);
307  }
308
309
310
311  /** Build the "tamper-evident" property definition. */
312  static {
313      BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "tamper-evident");
314      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "tamper-evident"));
315      DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("false");
316      builder.setDefaultBehaviorProvider(provider);
317      PD_TAMPER_EVIDENT = builder.getInstance();
318      INSTANCE.registerPropertyDefinition(PD_TAMPER_EVIDENT);
319  }
320
321
322
323  // Register the tags associated with this managed object definition.
324  static {
325    INSTANCE.registerTag(Tag.valueOf("logging"));
326  }
327
328
329
330  /**
331   * Get the Csv File HTTP Access Log Publisher configuration
332   * definition singleton.
333   *
334   * @return Returns the Csv File HTTP Access Log Publisher
335   *         configuration definition singleton.
336   */
337  public static CsvFileHTTPAccessLogPublisherCfgDefn getInstance() {
338    return INSTANCE;
339  }
340
341
342
343  /**
344   * Private constructor.
345   */
346  private CsvFileHTTPAccessLogPublisherCfgDefn() {
347    super("csv-file-http-access-log-publisher", HTTPAccessLogPublisherCfgDefn.getInstance());
348  }
349
350
351
352  /** {@inheritDoc} */
353  public CsvFileHTTPAccessLogPublisherCfgClient createClientConfiguration(
354      ManagedObject<? extends CsvFileHTTPAccessLogPublisherCfgClient> impl) {
355    return new CsvFileHTTPAccessLogPublisherCfgClientImpl(impl);
356  }
357
358
359
360  /** {@inheritDoc} */
361  public CsvFileHTTPAccessLogPublisherCfg createServerConfiguration(
362      ServerManagedObject<? extends CsvFileHTTPAccessLogPublisherCfg> impl) {
363    return new CsvFileHTTPAccessLogPublisherCfgServerImpl(impl);
364  }
365
366
367
368  /** {@inheritDoc} */
369  public Class<CsvFileHTTPAccessLogPublisherCfg> getServerConfigurationClass() {
370    return CsvFileHTTPAccessLogPublisherCfg.class;
371  }
372
373
374
375  /**
376   * Get the "asynchronous" property definition.
377   * <p>
378   * Indicates whether the Csv File HTTP Access Log Publisher will
379   * publish records asynchronously.
380   *
381   * @return Returns the "asynchronous" property definition.
382   */
383  public BooleanPropertyDefinition getAsynchronousPropertyDefinition() {
384    return PD_ASYNCHRONOUS;
385  }
386
387
388
389  /**
390   * Get the "auto-flush" property definition.
391   * <p>
392   * Specifies whether to flush the writer after every log record.
393   * <p>
394   * If the asynchronous writes option is used, the writer is flushed
395   * after all the log records in the queue are written.
396   *
397   * @return Returns the "auto-flush" property definition.
398   */
399  public BooleanPropertyDefinition getAutoFlushPropertyDefinition() {
400    return PD_AUTO_FLUSH;
401  }
402
403
404
405  /**
406   * Get the "csv-delimiter-char" property definition.
407   * <p>
408   * The delimiter character to use when writing in CSV format.
409   *
410   * @return Returns the "csv-delimiter-char" property definition.
411   */
412  public StringPropertyDefinition getCsvDelimiterCharPropertyDefinition() {
413    return PD_CSV_DELIMITER_CHAR;
414  }
415
416
417
418  /**
419   * Get the "csv-eol-symbols" property definition.
420   * <p>
421   * The string that marks the end of a line.
422   *
423   * @return Returns the "csv-eol-symbols" property definition.
424   */
425  public StringPropertyDefinition getCsvEolSymbolsPropertyDefinition() {
426    return PD_CSV_EOL_SYMBOLS;
427  }
428
429
430
431  /**
432   * Get the "csv-quote-char" property definition.
433   * <p>
434   * The character to append and prepend to a CSV field when writing
435   * in CSV format.
436   *
437   * @return Returns the "csv-quote-char" property definition.
438   */
439  public StringPropertyDefinition getCsvQuoteCharPropertyDefinition() {
440    return PD_CSV_QUOTE_CHAR;
441  }
442
443
444
445  /**
446   * Get the "enabled" property definition.
447   * <p>
448   * Indicates whether the Csv File HTTP Access Log Publisher is
449   * enabled for use.
450   *
451   * @return Returns the "enabled" property definition.
452   */
453  public BooleanPropertyDefinition getEnabledPropertyDefinition() {
454    return HTTPAccessLogPublisherCfgDefn.getInstance().getEnabledPropertyDefinition();
455  }
456
457
458
459  /**
460   * Get the "java-class" property definition.
461   * <p>
462   * The fully-qualified name of the Java class that provides the Csv
463   * File HTTP Access Log Publisher implementation.
464   *
465   * @return Returns the "java-class" property definition.
466   */
467  public ClassPropertyDefinition getJavaClassPropertyDefinition() {
468    return PD_JAVA_CLASS;
469  }
470
471
472
473  /**
474   * Get the "key-store-file" property definition.
475   * <p>
476   * Specifies the path to the file that contains the private key
477   * information. This may be an absolute path, or a path that is
478   * relative to the OpenDJ instance root.
479   * <p>
480   * Changes to this property will take effect the next time that the
481   * key store is accessed.
482   *
483   * @return Returns the "key-store-file" property definition.
484   */
485  public StringPropertyDefinition getKeyStoreFilePropertyDefinition() {
486    return PD_KEY_STORE_FILE;
487  }
488
489
490
491  /**
492   * Get the "key-store-pin-file" property definition.
493   * <p>
494   * Specifies the path to the text file whose only contents should be
495   * a single line containing the clear-text PIN needed to access the
496   * Csv File HTTP Access Log Publisher .
497   *
498   * @return Returns the "key-store-pin-file" property definition.
499   */
500  public StringPropertyDefinition getKeyStorePinFilePropertyDefinition() {
501    return PD_KEY_STORE_PIN_FILE;
502  }
503
504
505
506  /**
507   * Get the "log-directory" property definition.
508   * <p>
509   * The directory to use for the log files generated by the Csv File
510   * HTTP Access Log Publisher. The path to the directory is relative
511   * to the server root.
512   *
513   * @return Returns the "log-directory" property definition.
514   */
515  public StringPropertyDefinition getLogDirectoryPropertyDefinition() {
516    return PD_LOG_DIRECTORY;
517  }
518
519
520
521  /**
522   * Get the "retention-policy" property definition.
523   * <p>
524   * The retention policy to use for the Csv File HTTP Access Log
525   * Publisher .
526   * <p>
527   * When multiple policies are used, log files are cleaned when any
528   * of the policy's conditions are met.
529   *
530   * @return Returns the "retention-policy" property definition.
531   */
532  public AggregationPropertyDefinition<LogRetentionPolicyCfgClient, LogRetentionPolicyCfg> getRetentionPolicyPropertyDefinition() {
533    return PD_RETENTION_POLICY;
534  }
535
536
537
538  /**
539   * Get the "rotation-policy" property definition.
540   * <p>
541   * The rotation policy to use for the Csv File HTTP Access Log
542   * Publisher .
543   * <p>
544   * When multiple policies are used, rotation will occur if any
545   * policy's conditions are met.
546   *
547   * @return Returns the "rotation-policy" property definition.
548   */
549  public AggregationPropertyDefinition<LogRotationPolicyCfgClient, LogRotationPolicyCfg> getRotationPolicyPropertyDefinition() {
550    return PD_ROTATION_POLICY;
551  }
552
553
554
555  /**
556   * Get the "signature-time-interval" property definition.
557   * <p>
558   * Specifies the interval at which to sign the log file when secure
559   * option is enabled.
560   *
561   * @return Returns the "signature-time-interval" property definition.
562   */
563  public DurationPropertyDefinition getSignatureTimeIntervalPropertyDefinition() {
564    return PD_SIGNATURE_TIME_INTERVAL;
565  }
566
567
568
569  /**
570   * Get the "tamper-evident" property definition.
571   * <p>
572   * Specifies whether the log should be signed in order to detect
573   * tampering.
574   * <p>
575   * Every log record will be signed, making it possible to verify
576   * that the log has not been tampered with. This feature has a
577   * significative impact on performance of the server.
578   *
579   * @return Returns the "tamper-evident" property definition.
580   */
581  public BooleanPropertyDefinition getTamperEvidentPropertyDefinition() {
582    return PD_TAMPER_EVIDENT;
583  }
584
585
586
587  /**
588   * Managed object client implementation.
589   */
590  private static class CsvFileHTTPAccessLogPublisherCfgClientImpl implements
591    CsvFileHTTPAccessLogPublisherCfgClient {
592
593    /** Private implementation. */
594    private ManagedObject<? extends CsvFileHTTPAccessLogPublisherCfgClient> impl;
595
596
597
598    /** Private constructor. */
599    private CsvFileHTTPAccessLogPublisherCfgClientImpl(
600        ManagedObject<? extends CsvFileHTTPAccessLogPublisherCfgClient> impl) {
601      this.impl = impl;
602    }
603
604
605
606    /** {@inheritDoc} */
607    public boolean isAsynchronous() {
608      return impl.getPropertyValue(INSTANCE.getAsynchronousPropertyDefinition());
609    }
610
611
612
613    /** {@inheritDoc} */
614    public void setAsynchronous(boolean value) {
615      impl.setPropertyValue(INSTANCE.getAsynchronousPropertyDefinition(), value);
616    }
617
618
619
620    /** {@inheritDoc} */
621    public boolean isAutoFlush() {
622      return impl.getPropertyValue(INSTANCE.getAutoFlushPropertyDefinition());
623    }
624
625
626
627    /** {@inheritDoc} */
628    public void setAutoFlush(Boolean value) {
629      impl.setPropertyValue(INSTANCE.getAutoFlushPropertyDefinition(), value);
630    }
631
632
633
634    /** {@inheritDoc} */
635    public String getCsvDelimiterChar() {
636      return impl.getPropertyValue(INSTANCE.getCsvDelimiterCharPropertyDefinition());
637    }
638
639
640
641    /** {@inheritDoc} */
642    public void setCsvDelimiterChar(String value) {
643      impl.setPropertyValue(INSTANCE.getCsvDelimiterCharPropertyDefinition(), value);
644    }
645
646
647
648    /** {@inheritDoc} */
649    public String getCsvEolSymbols() {
650      return impl.getPropertyValue(INSTANCE.getCsvEolSymbolsPropertyDefinition());
651    }
652
653
654
655    /** {@inheritDoc} */
656    public void setCsvEolSymbols(String value) {
657      impl.setPropertyValue(INSTANCE.getCsvEolSymbolsPropertyDefinition(), value);
658    }
659
660
661
662    /** {@inheritDoc} */
663    public String getCsvQuoteChar() {
664      return impl.getPropertyValue(INSTANCE.getCsvQuoteCharPropertyDefinition());
665    }
666
667
668
669    /** {@inheritDoc} */
670    public void setCsvQuoteChar(String value) {
671      impl.setPropertyValue(INSTANCE.getCsvQuoteCharPropertyDefinition(), value);
672    }
673
674
675
676    /** {@inheritDoc} */
677    public Boolean isEnabled() {
678      return impl.getPropertyValue(INSTANCE.getEnabledPropertyDefinition());
679    }
680
681
682
683    /** {@inheritDoc} */
684    public void setEnabled(boolean value) {
685      impl.setPropertyValue(INSTANCE.getEnabledPropertyDefinition(), value);
686    }
687
688
689
690    /** {@inheritDoc} */
691    public String getJavaClass() {
692      return impl.getPropertyValue(INSTANCE.getJavaClassPropertyDefinition());
693    }
694
695
696
697    /** {@inheritDoc} */
698    public void setJavaClass(String value) {
699      impl.setPropertyValue(INSTANCE.getJavaClassPropertyDefinition(), value);
700    }
701
702
703
704    /** {@inheritDoc} */
705    public String getKeyStoreFile() {
706      return impl.getPropertyValue(INSTANCE.getKeyStoreFilePropertyDefinition());
707    }
708
709
710
711    /** {@inheritDoc} */
712    public void setKeyStoreFile(String value) {
713      impl.setPropertyValue(INSTANCE.getKeyStoreFilePropertyDefinition(), value);
714    }
715
716
717
718    /** {@inheritDoc} */
719    public String getKeyStorePinFile() {
720      return impl.getPropertyValue(INSTANCE.getKeyStorePinFilePropertyDefinition());
721    }
722
723
724
725    /** {@inheritDoc} */
726    public void setKeyStorePinFile(String value) {
727      impl.setPropertyValue(INSTANCE.getKeyStorePinFilePropertyDefinition(), value);
728    }
729
730
731
732    /** {@inheritDoc} */
733    public String getLogDirectory() {
734      return impl.getPropertyValue(INSTANCE.getLogDirectoryPropertyDefinition());
735    }
736
737
738
739    /** {@inheritDoc} */
740    public void setLogDirectory(String value) {
741      impl.setPropertyValue(INSTANCE.getLogDirectoryPropertyDefinition(), value);
742    }
743
744
745
746    /** {@inheritDoc} */
747    public SortedSet<String> getRetentionPolicy() {
748      return impl.getPropertyValues(INSTANCE.getRetentionPolicyPropertyDefinition());
749    }
750
751
752
753    /** {@inheritDoc} */
754    public void setRetentionPolicy(Collection<String> values) {
755      impl.setPropertyValues(INSTANCE.getRetentionPolicyPropertyDefinition(), values);
756    }
757
758
759
760    /** {@inheritDoc} */
761    public SortedSet<String> getRotationPolicy() {
762      return impl.getPropertyValues(INSTANCE.getRotationPolicyPropertyDefinition());
763    }
764
765
766
767    /** {@inheritDoc} */
768    public void setRotationPolicy(Collection<String> values) {
769      impl.setPropertyValues(INSTANCE.getRotationPolicyPropertyDefinition(), values);
770    }
771
772
773
774    /** {@inheritDoc} */
775    public long getSignatureTimeInterval() {
776      return impl.getPropertyValue(INSTANCE.getSignatureTimeIntervalPropertyDefinition());
777    }
778
779
780
781    /** {@inheritDoc} */
782    public void setSignatureTimeInterval(Long value) {
783      impl.setPropertyValue(INSTANCE.getSignatureTimeIntervalPropertyDefinition(), value);
784    }
785
786
787
788    /** {@inheritDoc} */
789    public boolean isTamperEvident() {
790      return impl.getPropertyValue(INSTANCE.getTamperEvidentPropertyDefinition());
791    }
792
793
794
795    /** {@inheritDoc} */
796    public void setTamperEvident(Boolean value) {
797      impl.setPropertyValue(INSTANCE.getTamperEvidentPropertyDefinition(), value);
798    }
799
800
801
802    /** {@inheritDoc} */
803    public ManagedObjectDefinition<? extends CsvFileHTTPAccessLogPublisherCfgClient, ? extends CsvFileHTTPAccessLogPublisherCfg> definition() {
804      return INSTANCE;
805    }
806
807
808
809    /** {@inheritDoc} */
810    public PropertyProvider properties() {
811      return impl;
812    }
813
814
815
816    /** {@inheritDoc} */
817    public void commit() throws ManagedObjectAlreadyExistsException,
818        MissingMandatoryPropertiesException, ConcurrentModificationException,
819        OperationRejectedException, LdapException {
820      impl.commit();
821    }
822
823
824
825    /** {@inheritDoc} */
826    public String toString() {
827      return impl.toString();
828    }
829  }
830
831
832
833  /**
834   * Managed object server implementation.
835   */
836  private static class CsvFileHTTPAccessLogPublisherCfgServerImpl implements
837    CsvFileHTTPAccessLogPublisherCfg {
838
839    /** Private implementation. */
840    private ServerManagedObject<? extends CsvFileHTTPAccessLogPublisherCfg> impl;
841
842    /** The value of the "asynchronous" property. */
843    private final boolean pAsynchronous;
844
845    /** The value of the "auto-flush" property. */
846    private final boolean pAutoFlush;
847
848    /** The value of the "csv-delimiter-char" property. */
849    private final String pCsvDelimiterChar;
850
851    /** The value of the "csv-eol-symbols" property. */
852    private final String pCsvEolSymbols;
853
854    /** The value of the "csv-quote-char" property. */
855    private final String pCsvQuoteChar;
856
857    /** The value of the "enabled" property. */
858    private final boolean pEnabled;
859
860    /** The value of the "java-class" property. */
861    private final String pJavaClass;
862
863    /** The value of the "key-store-file" property. */
864    private final String pKeyStoreFile;
865
866    /** The value of the "key-store-pin-file" property. */
867    private final String pKeyStorePinFile;
868
869    /** The value of the "log-directory" property. */
870    private final String pLogDirectory;
871
872    /** The value of the "retention-policy" property. */
873    private final SortedSet<String> pRetentionPolicy;
874
875    /** The value of the "rotation-policy" property. */
876    private final SortedSet<String> pRotationPolicy;
877
878    /** The value of the "signature-time-interval" property. */
879    private final long pSignatureTimeInterval;
880
881    /** The value of the "tamper-evident" property. */
882    private final boolean pTamperEvident;
883
884
885
886    /** Private constructor. */
887    private CsvFileHTTPAccessLogPublisherCfgServerImpl(ServerManagedObject<? extends CsvFileHTTPAccessLogPublisherCfg> impl) {
888      this.impl = impl;
889      this.pAsynchronous = impl.getPropertyValue(INSTANCE.getAsynchronousPropertyDefinition());
890      this.pAutoFlush = impl.getPropertyValue(INSTANCE.getAutoFlushPropertyDefinition());
891      this.pCsvDelimiterChar = impl.getPropertyValue(INSTANCE.getCsvDelimiterCharPropertyDefinition());
892      this.pCsvEolSymbols = impl.getPropertyValue(INSTANCE.getCsvEolSymbolsPropertyDefinition());
893      this.pCsvQuoteChar = impl.getPropertyValue(INSTANCE.getCsvQuoteCharPropertyDefinition());
894      this.pEnabled = impl.getPropertyValue(INSTANCE.getEnabledPropertyDefinition());
895      this.pJavaClass = impl.getPropertyValue(INSTANCE.getJavaClassPropertyDefinition());
896      this.pKeyStoreFile = impl.getPropertyValue(INSTANCE.getKeyStoreFilePropertyDefinition());
897      this.pKeyStorePinFile = impl.getPropertyValue(INSTANCE.getKeyStorePinFilePropertyDefinition());
898      this.pLogDirectory = impl.getPropertyValue(INSTANCE.getLogDirectoryPropertyDefinition());
899      this.pRetentionPolicy = impl.getPropertyValues(INSTANCE.getRetentionPolicyPropertyDefinition());
900      this.pRotationPolicy = impl.getPropertyValues(INSTANCE.getRotationPolicyPropertyDefinition());
901      this.pSignatureTimeInterval = impl.getPropertyValue(INSTANCE.getSignatureTimeIntervalPropertyDefinition());
902      this.pTamperEvident = impl.getPropertyValue(INSTANCE.getTamperEvidentPropertyDefinition());
903    }
904
905
906
907    /** {@inheritDoc} */
908    public void addCsvFileHTTPAccessChangeListener(
909        ConfigurationChangeListener<CsvFileHTTPAccessLogPublisherCfg> listener) {
910      impl.registerChangeListener(listener);
911    }
912
913
914
915    /** {@inheritDoc} */
916    public void removeCsvFileHTTPAccessChangeListener(
917        ConfigurationChangeListener<CsvFileHTTPAccessLogPublisherCfg> listener) {
918      impl.deregisterChangeListener(listener);
919    }
920    /** {@inheritDoc} */
921    public void addHTTPAccessChangeListener(
922        ConfigurationChangeListener<HTTPAccessLogPublisherCfg> listener) {
923      impl.registerChangeListener(listener);
924    }
925
926
927
928    /** {@inheritDoc} */
929    public void removeHTTPAccessChangeListener(
930        ConfigurationChangeListener<HTTPAccessLogPublisherCfg> listener) {
931      impl.deregisterChangeListener(listener);
932    }
933    /** {@inheritDoc} */
934    public void addChangeListener(
935        ConfigurationChangeListener<LogPublisherCfg> listener) {
936      impl.registerChangeListener(listener);
937    }
938
939
940
941    /** {@inheritDoc} */
942    public void removeChangeListener(
943        ConfigurationChangeListener<LogPublisherCfg> listener) {
944      impl.deregisterChangeListener(listener);
945    }
946
947
948
949    /** {@inheritDoc} */
950    public boolean isAsynchronous() {
951      return pAsynchronous;
952    }
953
954
955
956    /** {@inheritDoc} */
957    public boolean isAutoFlush() {
958      return pAutoFlush;
959    }
960
961
962
963    /** {@inheritDoc} */
964    public String getCsvDelimiterChar() {
965      return pCsvDelimiterChar;
966    }
967
968
969
970    /** {@inheritDoc} */
971    public String getCsvEolSymbols() {
972      return pCsvEolSymbols;
973    }
974
975
976
977    /** {@inheritDoc} */
978    public String getCsvQuoteChar() {
979      return pCsvQuoteChar;
980    }
981
982
983
984    /** {@inheritDoc} */
985    public boolean isEnabled() {
986      return pEnabled;
987    }
988
989
990
991    /** {@inheritDoc} */
992    public String getJavaClass() {
993      return pJavaClass;
994    }
995
996
997
998    /** {@inheritDoc} */
999    public String getKeyStoreFile() {
1000      return pKeyStoreFile;
1001    }
1002
1003
1004
1005    /** {@inheritDoc} */
1006    public String getKeyStorePinFile() {
1007      return pKeyStorePinFile;
1008    }
1009
1010
1011
1012    /** {@inheritDoc} */
1013    public String getLogDirectory() {
1014      return pLogDirectory;
1015    }
1016
1017
1018
1019    /** {@inheritDoc} */
1020    public SortedSet<String> getRetentionPolicy() {
1021      return pRetentionPolicy;
1022    }
1023
1024
1025
1026    /**
1027     * {@inheritDoc}
1028     */
1029    public SortedSet<DN> getRetentionPolicyDNs() {
1030      SortedSet<String> values = getRetentionPolicy();
1031      SortedSet<DN> dnValues = new TreeSet<DN>();
1032      for (String value : values) {
1033        DN dn = INSTANCE.getRetentionPolicyPropertyDefinition().getChildDN(value);
1034        dnValues.add(dn);
1035      }
1036      return dnValues;
1037    }
1038
1039
1040
1041    /** {@inheritDoc} */
1042    public SortedSet<String> getRotationPolicy() {
1043      return pRotationPolicy;
1044    }
1045
1046
1047
1048    /**
1049     * {@inheritDoc}
1050     */
1051    public SortedSet<DN> getRotationPolicyDNs() {
1052      SortedSet<String> values = getRotationPolicy();
1053      SortedSet<DN> dnValues = new TreeSet<DN>();
1054      for (String value : values) {
1055        DN dn = INSTANCE.getRotationPolicyPropertyDefinition().getChildDN(value);
1056        dnValues.add(dn);
1057      }
1058      return dnValues;
1059    }
1060
1061
1062
1063    /** {@inheritDoc} */
1064    public long getSignatureTimeInterval() {
1065      return pSignatureTimeInterval;
1066    }
1067
1068
1069
1070    /** {@inheritDoc} */
1071    public boolean isTamperEvident() {
1072      return pTamperEvident;
1073    }
1074
1075
1076
1077    /** {@inheritDoc} */
1078    public Class<? extends CsvFileHTTPAccessLogPublisherCfg> configurationClass() {
1079      return CsvFileHTTPAccessLogPublisherCfg.class;
1080    }
1081
1082
1083
1084    /** {@inheritDoc} */
1085    public DN dn() {
1086      return impl.getDN();
1087    }
1088
1089
1090
1091    /** {@inheritDoc} */
1092    public String toString() {
1093      return impl.toString();
1094    }
1095  }
1096}