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");
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.OTHER, INSTANCE, "queue-size"));
275      DefaultBehaviorProvider<Integer> provider = new DefinedDefaultBehaviorProvider<Integer>("5000");
276      builder.setDefaultBehaviorProvider(provider);
277      builder.setLowerLimit(0);
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   * <p>
534   * Setting the queue size to zero activates parallel log writer
535   * implementation which has no queue size limit and as such the
536   * parallel log writer should only be used on a very well tuned
537   * server configuration to avoid potential out of memory errors.
538   *
539   * @return Returns the "queue-size" property definition.
540   */
541  public IntegerPropertyDefinition getQueueSizePropertyDefinition() {
542    return PD_QUEUE_SIZE;
543  }
544
545
546
547  /**
548   * Get the "retention-policy" property definition.
549   * <p>
550   * The retention policy to use for the File Based HTTP Access Log
551   * Publisher .
552   * <p>
553   * When multiple policies are used, log files are cleaned when any
554   * of the policy's conditions are met.
555   *
556   * @return Returns the "retention-policy" property definition.
557   */
558  public AggregationPropertyDefinition<LogRetentionPolicyCfgClient, LogRetentionPolicyCfg> getRetentionPolicyPropertyDefinition() {
559    return PD_RETENTION_POLICY;
560  }
561
562
563
564  /**
565   * Get the "rotation-policy" property definition.
566   * <p>
567   * The rotation policy to use for the File Based HTTP Access Log
568   * Publisher .
569   * <p>
570   * When multiple policies are used, rotation will occur if any
571   * policy's conditions are met.
572   *
573   * @return Returns the "rotation-policy" property definition.
574   */
575  public AggregationPropertyDefinition<LogRotationPolicyCfgClient, LogRotationPolicyCfg> getRotationPolicyPropertyDefinition() {
576    return PD_ROTATION_POLICY;
577  }
578
579
580
581  /**
582   * Get the "time-interval" property definition.
583   * <p>
584   * Specifies the interval at which to check whether the log files
585   * need to be rotated.
586   *
587   * @return Returns the "time-interval" property definition.
588   */
589  public DurationPropertyDefinition getTimeIntervalPropertyDefinition() {
590    return PD_TIME_INTERVAL;
591  }
592
593
594
595  /**
596   * Managed object client implementation.
597   */
598  private static class FileBasedHTTPAccessLogPublisherCfgClientImpl implements
599    FileBasedHTTPAccessLogPublisherCfgClient {
600
601    // Private implementation.
602    private ManagedObject<? extends FileBasedHTTPAccessLogPublisherCfgClient> impl;
603
604
605
606    // Private constructor.
607    private FileBasedHTTPAccessLogPublisherCfgClientImpl(
608        ManagedObject<? extends FileBasedHTTPAccessLogPublisherCfgClient> impl) {
609      this.impl = impl;
610    }
611
612
613
614    /**
615     * {@inheritDoc}
616     */
617    public boolean isAppend() {
618      return impl.getPropertyValue(INSTANCE.getAppendPropertyDefinition());
619    }
620
621
622
623    /**
624     * {@inheritDoc}
625     */
626    public void setAppend(Boolean value) {
627      impl.setPropertyValue(INSTANCE.getAppendPropertyDefinition(), value);
628    }
629
630
631
632    /**
633     * {@inheritDoc}
634     */
635    public boolean isAsynchronous() {
636      return impl.getPropertyValue(INSTANCE.getAsynchronousPropertyDefinition());
637    }
638
639
640
641    /**
642     * {@inheritDoc}
643     */
644    public void setAsynchronous(boolean value) {
645      impl.setPropertyValue(INSTANCE.getAsynchronousPropertyDefinition(), value);
646    }
647
648
649
650    /**
651     * {@inheritDoc}
652     */
653    public boolean isAutoFlush() {
654      return impl.getPropertyValue(INSTANCE.getAutoFlushPropertyDefinition());
655    }
656
657
658
659    /**
660     * {@inheritDoc}
661     */
662    public void setAutoFlush(Boolean value) {
663      impl.setPropertyValue(INSTANCE.getAutoFlushPropertyDefinition(), value);
664    }
665
666
667
668    /**
669     * {@inheritDoc}
670     */
671    public long getBufferSize() {
672      return impl.getPropertyValue(INSTANCE.getBufferSizePropertyDefinition());
673    }
674
675
676
677    /**
678     * {@inheritDoc}
679     */
680    public void setBufferSize(Long value) {
681      impl.setPropertyValue(INSTANCE.getBufferSizePropertyDefinition(), value);
682    }
683
684
685
686    /**
687     * {@inheritDoc}
688     */
689    public Boolean isEnabled() {
690      return impl.getPropertyValue(INSTANCE.getEnabledPropertyDefinition());
691    }
692
693
694
695    /**
696     * {@inheritDoc}
697     */
698    public void setEnabled(boolean value) {
699      impl.setPropertyValue(INSTANCE.getEnabledPropertyDefinition(), value);
700    }
701
702
703
704    /**
705     * {@inheritDoc}
706     */
707    public String getJavaClass() {
708      return impl.getPropertyValue(INSTANCE.getJavaClassPropertyDefinition());
709    }
710
711
712
713    /**
714     * {@inheritDoc}
715     */
716    public void setJavaClass(String value) {
717      impl.setPropertyValue(INSTANCE.getJavaClassPropertyDefinition(), value);
718    }
719
720
721
722    /**
723     * {@inheritDoc}
724     */
725    public String getLogFile() {
726      return impl.getPropertyValue(INSTANCE.getLogFilePropertyDefinition());
727    }
728
729
730
731    /**
732     * {@inheritDoc}
733     */
734    public void setLogFile(String value) {
735      impl.setPropertyValue(INSTANCE.getLogFilePropertyDefinition(), value);
736    }
737
738
739
740    /**
741     * {@inheritDoc}
742     */
743    public String getLogFilePermissions() {
744      return impl.getPropertyValue(INSTANCE.getLogFilePermissionsPropertyDefinition());
745    }
746
747
748
749    /**
750     * {@inheritDoc}
751     */
752    public void setLogFilePermissions(String value) {
753      impl.setPropertyValue(INSTANCE.getLogFilePermissionsPropertyDefinition(), value);
754    }
755
756
757
758    /**
759     * {@inheritDoc}
760     */
761    public String getLogFormat() {
762      return impl.getPropertyValue(INSTANCE.getLogFormatPropertyDefinition());
763    }
764
765
766
767    /**
768     * {@inheritDoc}
769     */
770    public void setLogFormat(String value) {
771      impl.setPropertyValue(INSTANCE.getLogFormatPropertyDefinition(), value);
772    }
773
774
775
776    /**
777     * {@inheritDoc}
778     */
779    public String getLogRecordTimeFormat() {
780      return impl.getPropertyValue(INSTANCE.getLogRecordTimeFormatPropertyDefinition());
781    }
782
783
784
785    /**
786     * {@inheritDoc}
787     */
788    public void setLogRecordTimeFormat(String value) {
789      impl.setPropertyValue(INSTANCE.getLogRecordTimeFormatPropertyDefinition(), value);
790    }
791
792
793
794    /**
795     * {@inheritDoc}
796     */
797    public int getQueueSize() {
798      return impl.getPropertyValue(INSTANCE.getQueueSizePropertyDefinition());
799    }
800
801
802
803    /**
804     * {@inheritDoc}
805     */
806    public void setQueueSize(Integer value) {
807      impl.setPropertyValue(INSTANCE.getQueueSizePropertyDefinition(), value);
808    }
809
810
811
812    /**
813     * {@inheritDoc}
814     */
815    public SortedSet<String> getRetentionPolicy() {
816      return impl.getPropertyValues(INSTANCE.getRetentionPolicyPropertyDefinition());
817    }
818
819
820
821    /**
822     * {@inheritDoc}
823     */
824    public void setRetentionPolicy(Collection<String> values) {
825      impl.setPropertyValues(INSTANCE.getRetentionPolicyPropertyDefinition(), values);
826    }
827
828
829
830    /**
831     * {@inheritDoc}
832     */
833    public SortedSet<String> getRotationPolicy() {
834      return impl.getPropertyValues(INSTANCE.getRotationPolicyPropertyDefinition());
835    }
836
837
838
839    /**
840     * {@inheritDoc}
841     */
842    public void setRotationPolicy(Collection<String> values) {
843      impl.setPropertyValues(INSTANCE.getRotationPolicyPropertyDefinition(), values);
844    }
845
846
847
848    /**
849     * {@inheritDoc}
850     */
851    public long getTimeInterval() {
852      return impl.getPropertyValue(INSTANCE.getTimeIntervalPropertyDefinition());
853    }
854
855
856
857    /**
858     * {@inheritDoc}
859     */
860    public void setTimeInterval(Long value) {
861      impl.setPropertyValue(INSTANCE.getTimeIntervalPropertyDefinition(), value);
862    }
863
864
865
866    /**
867     * {@inheritDoc}
868     */
869    public ManagedObjectDefinition<? extends FileBasedHTTPAccessLogPublisherCfgClient, ? extends FileBasedHTTPAccessLogPublisherCfg> definition() {
870      return INSTANCE;
871    }
872
873
874
875    /**
876     * {@inheritDoc}
877     */
878    public PropertyProvider properties() {
879      return impl;
880    }
881
882
883
884    /**
885     * {@inheritDoc}
886     */
887    public void commit() throws ManagedObjectAlreadyExistsException,
888        MissingMandatoryPropertiesException, ConcurrentModificationException,
889        OperationRejectedException, AuthorizationException,
890        CommunicationException {
891      impl.commit();
892    }
893
894  }
895
896
897
898  /**
899   * Managed object server implementation.
900   */
901  private static class FileBasedHTTPAccessLogPublisherCfgServerImpl implements
902    FileBasedHTTPAccessLogPublisherCfg {
903
904    // Private implementation.
905    private ServerManagedObject<? extends FileBasedHTTPAccessLogPublisherCfg> impl;
906
907    // The value of the "append" property.
908    private final boolean pAppend;
909
910    // The value of the "asynchronous" property.
911    private final boolean pAsynchronous;
912
913    // The value of the "auto-flush" property.
914    private final boolean pAutoFlush;
915
916    // The value of the "buffer-size" property.
917    private final long pBufferSize;
918
919    // The value of the "enabled" property.
920    private final boolean pEnabled;
921
922    // The value of the "java-class" property.
923    private final String pJavaClass;
924
925    // The value of the "log-file" property.
926    private final String pLogFile;
927
928    // The value of the "log-file-permissions" property.
929    private final String pLogFilePermissions;
930
931    // The value of the "log-format" property.
932    private final String pLogFormat;
933
934    // The value of the "log-record-time-format" property.
935    private final String pLogRecordTimeFormat;
936
937    // The value of the "queue-size" property.
938    private final int pQueueSize;
939
940    // The value of the "retention-policy" property.
941    private final SortedSet<String> pRetentionPolicy;
942
943    // The value of the "rotation-policy" property.
944    private final SortedSet<String> pRotationPolicy;
945
946    // The value of the "time-interval" property.
947    private final long pTimeInterval;
948
949
950
951    // Private constructor.
952    private FileBasedHTTPAccessLogPublisherCfgServerImpl(ServerManagedObject<? extends FileBasedHTTPAccessLogPublisherCfg> impl) {
953      this.impl = impl;
954      this.pAppend = impl.getPropertyValue(INSTANCE.getAppendPropertyDefinition());
955      this.pAsynchronous = impl.getPropertyValue(INSTANCE.getAsynchronousPropertyDefinition());
956      this.pAutoFlush = impl.getPropertyValue(INSTANCE.getAutoFlushPropertyDefinition());
957      this.pBufferSize = impl.getPropertyValue(INSTANCE.getBufferSizePropertyDefinition());
958      this.pEnabled = impl.getPropertyValue(INSTANCE.getEnabledPropertyDefinition());
959      this.pJavaClass = impl.getPropertyValue(INSTANCE.getJavaClassPropertyDefinition());
960      this.pLogFile = impl.getPropertyValue(INSTANCE.getLogFilePropertyDefinition());
961      this.pLogFilePermissions = impl.getPropertyValue(INSTANCE.getLogFilePermissionsPropertyDefinition());
962      this.pLogFormat = impl.getPropertyValue(INSTANCE.getLogFormatPropertyDefinition());
963      this.pLogRecordTimeFormat = impl.getPropertyValue(INSTANCE.getLogRecordTimeFormatPropertyDefinition());
964      this.pQueueSize = impl.getPropertyValue(INSTANCE.getQueueSizePropertyDefinition());
965      this.pRetentionPolicy = impl.getPropertyValues(INSTANCE.getRetentionPolicyPropertyDefinition());
966      this.pRotationPolicy = impl.getPropertyValues(INSTANCE.getRotationPolicyPropertyDefinition());
967      this.pTimeInterval = impl.getPropertyValue(INSTANCE.getTimeIntervalPropertyDefinition());
968    }
969
970
971
972    /**
973     * {@inheritDoc}
974     */
975    public void addFileBasedHTTPAccessChangeListener(
976        ConfigurationChangeListener<FileBasedHTTPAccessLogPublisherCfg> listener) {
977      impl.registerChangeListener(listener);
978    }
979
980
981
982    /**
983     * {@inheritDoc}
984     */
985    public void removeFileBasedHTTPAccessChangeListener(
986        ConfigurationChangeListener<FileBasedHTTPAccessLogPublisherCfg> listener) {
987      impl.deregisterChangeListener(listener);
988    }
989    /**
990     * {@inheritDoc}
991     */
992    public void addHTTPAccessChangeListener(
993        ConfigurationChangeListener<HTTPAccessLogPublisherCfg> listener) {
994      impl.registerChangeListener(listener);
995    }
996
997
998
999    /**
1000     * {@inheritDoc}
1001     */
1002    public void removeHTTPAccessChangeListener(
1003        ConfigurationChangeListener<HTTPAccessLogPublisherCfg> listener) {
1004      impl.deregisterChangeListener(listener);
1005    }
1006    /**
1007     * {@inheritDoc}
1008     */
1009    public void addChangeListener(
1010        ConfigurationChangeListener<LogPublisherCfg> listener) {
1011      impl.registerChangeListener(listener);
1012    }
1013
1014
1015
1016    /**
1017     * {@inheritDoc}
1018     */
1019    public void removeChangeListener(
1020        ConfigurationChangeListener<LogPublisherCfg> listener) {
1021      impl.deregisterChangeListener(listener);
1022    }
1023
1024
1025
1026    /**
1027     * {@inheritDoc}
1028     */
1029    public boolean isAppend() {
1030      return pAppend;
1031    }
1032
1033
1034
1035    /**
1036     * {@inheritDoc}
1037     */
1038    public boolean isAsynchronous() {
1039      return pAsynchronous;
1040    }
1041
1042
1043
1044    /**
1045     * {@inheritDoc}
1046     */
1047    public boolean isAutoFlush() {
1048      return pAutoFlush;
1049    }
1050
1051
1052
1053    /**
1054     * {@inheritDoc}
1055     */
1056    public long getBufferSize() {
1057      return pBufferSize;
1058    }
1059
1060
1061
1062    /**
1063     * {@inheritDoc}
1064     */
1065    public boolean isEnabled() {
1066      return pEnabled;
1067    }
1068
1069
1070
1071    /**
1072     * {@inheritDoc}
1073     */
1074    public String getJavaClass() {
1075      return pJavaClass;
1076    }
1077
1078
1079
1080    /**
1081     * {@inheritDoc}
1082     */
1083    public String getLogFile() {
1084      return pLogFile;
1085    }
1086
1087
1088
1089    /**
1090     * {@inheritDoc}
1091     */
1092    public String getLogFilePermissions() {
1093      return pLogFilePermissions;
1094    }
1095
1096
1097
1098    /**
1099     * {@inheritDoc}
1100     */
1101    public String getLogFormat() {
1102      return pLogFormat;
1103    }
1104
1105
1106
1107    /**
1108     * {@inheritDoc}
1109     */
1110    public String getLogRecordTimeFormat() {
1111      return pLogRecordTimeFormat;
1112    }
1113
1114
1115
1116    /**
1117     * {@inheritDoc}
1118     */
1119    public int getQueueSize() {
1120      return pQueueSize;
1121    }
1122
1123
1124
1125    /**
1126     * {@inheritDoc}
1127     */
1128    public SortedSet<String> getRetentionPolicy() {
1129      return pRetentionPolicy;
1130    }
1131
1132
1133
1134    /**
1135     * {@inheritDoc}
1136     */
1137    public SortedSet<DN> getRetentionPolicyDNs() {
1138      SortedSet<String> values = getRetentionPolicy();
1139      SortedSet<DN> dnValues = new TreeSet<DN>();
1140      for (String value : values) {
1141        DN dn = INSTANCE.getRetentionPolicyPropertyDefinition().getChildDN(value);
1142        dnValues.add(dn);
1143      }
1144      return dnValues;
1145    }
1146
1147
1148
1149    /**
1150     * {@inheritDoc}
1151     */
1152    public SortedSet<String> getRotationPolicy() {
1153      return pRotationPolicy;
1154    }
1155
1156
1157
1158    /**
1159     * {@inheritDoc}
1160     */
1161    public SortedSet<DN> getRotationPolicyDNs() {
1162      SortedSet<String> values = getRotationPolicy();
1163      SortedSet<DN> dnValues = new TreeSet<DN>();
1164      for (String value : values) {
1165        DN dn = INSTANCE.getRotationPolicyPropertyDefinition().getChildDN(value);
1166        dnValues.add(dn);
1167      }
1168      return dnValues;
1169    }
1170
1171
1172
1173    /**
1174     * {@inheritDoc}
1175     */
1176    public long getTimeInterval() {
1177      return pTimeInterval;
1178    }
1179
1180
1181
1182    /**
1183     * {@inheritDoc}
1184     */
1185    public Class<? extends FileBasedHTTPAccessLogPublisherCfg> configurationClass() {
1186      return FileBasedHTTPAccessLogPublisherCfg.class;
1187    }
1188
1189
1190
1191    /**
1192     * {@inheritDoc}
1193     */
1194    public DN dn() {
1195      return impl.getDN();
1196    }
1197
1198  }
1199}