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