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