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