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
010 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
011 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
012 * See the License for the specific language governing permissions
013 * and limitations under the License.
014 *
015 * When distributing Covered Code, include this CDDL HEADER in each
016 * file and include the License file at
017 * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
018 * add the following below this CDDL HEADER, with the fields enclosed
019 * by brackets "[]" replaced with your own identifying information:
020 * Portions Copyright [yyyy] [name of copyright owner]
021 *
022 * CDDL HEADER END
023 *
024 *
025 * Copyright 2008 Sun Microsystems, Inc.
026 */
027 package org.opends.server.admin.std.meta;
028
029
030
031 import java.util.Collection;
032 import java.util.SortedSet;
033 import org.opends.server.admin.AdministratorAction;
034 import org.opends.server.admin.AliasDefaultBehaviorProvider;
035 import org.opends.server.admin.BooleanPropertyDefinition;
036 import org.opends.server.admin.ClassPropertyDefinition;
037 import org.opends.server.admin.client.AuthorizationException;
038 import org.opends.server.admin.client.CommunicationException;
039 import org.opends.server.admin.client.ConcurrentModificationException;
040 import org.opends.server.admin.client.IllegalManagedObjectNameException;
041 import org.opends.server.admin.client.ManagedObject;
042 import org.opends.server.admin.client.ManagedObjectDecodingException;
043 import org.opends.server.admin.client.MissingMandatoryPropertiesException;
044 import org.opends.server.admin.client.OperationRejectedException;
045 import org.opends.server.admin.DefaultBehaviorException;
046 import org.opends.server.admin.DefaultBehaviorProvider;
047 import org.opends.server.admin.DefinedDefaultBehaviorProvider;
048 import org.opends.server.admin.DefinitionDecodingException;
049 import org.opends.server.admin.EnumPropertyDefinition;
050 import org.opends.server.admin.InstantiableRelationDefinition;
051 import org.opends.server.admin.IntegerPropertyDefinition;
052 import org.opends.server.admin.ManagedObjectAlreadyExistsException;
053 import org.opends.server.admin.ManagedObjectDefinition;
054 import org.opends.server.admin.ManagedObjectNotFoundException;
055 import org.opends.server.admin.PropertyOption;
056 import org.opends.server.admin.PropertyProvider;
057 import org.opends.server.admin.server.ConfigurationAddListener;
058 import org.opends.server.admin.server.ConfigurationChangeListener;
059 import org.opends.server.admin.server.ConfigurationDeleteListener;
060 import org.opends.server.admin.server.ServerManagedObject;
061 import org.opends.server.admin.std.client.DebugLogPublisherCfgClient;
062 import org.opends.server.admin.std.client.DebugTargetCfgClient;
063 import org.opends.server.admin.std.server.DebugLogPublisherCfg;
064 import org.opends.server.admin.std.server.DebugTargetCfg;
065 import org.opends.server.admin.std.server.LogPublisherCfg;
066 import org.opends.server.admin.Tag;
067 import org.opends.server.admin.UndefinedDefaultBehaviorProvider;
068 import org.opends.server.config.ConfigException;
069 import org.opends.server.types.DN;
070
071
072
073 /**
074 * An interface for querying the Debug Log Publisher managed object
075 * definition meta information.
076 * <p>
077 * Debug Log Publishers are responsible for distributing debug log
078 * messages from the debug logger to a destination.
079 */
080 public final class DebugLogPublisherCfgDefn extends ManagedObjectDefinition<DebugLogPublisherCfgClient, DebugLogPublisherCfg> {
081
082 // The singleton configuration definition instance.
083 private static final DebugLogPublisherCfgDefn INSTANCE = new DebugLogPublisherCfgDefn();
084
085
086
087 /**
088 * Defines the set of permissable values for the "default-debug-category" property.
089 * <p>
090 * The debug message categories to be logged when none of the
091 * defined targets match the message.
092 */
093 public static enum DefaultDebugCategory {
094
095 /**
096 * Exception caught.
097 */
098 CAUGHT("caught"),
099
100
101
102 /**
103 * Constructor entry.
104 */
105 CONSTRUCTOR("constructor"),
106
107
108
109 /**
110 * Raw data dump.
111 */
112 DATA("data"),
113
114
115
116 /**
117 * Access to a backend database.
118 */
119 DATABASE_ACCESS("database-access"),
120
121
122
123 /**
124 * Method entry.
125 */
126 ENTER("enter"),
127
128
129
130 /**
131 * Method exit.
132 */
133 EXIT("exit"),
134
135
136
137 /**
138 * Arbitrary debug message.
139 */
140 MESSAGE("message"),
141
142
143
144 /**
145 * Protocol element dump.
146 */
147 PROTOCOL("protocol"),
148
149
150
151 /**
152 * Exception throw from method.
153 */
154 THROWN("thrown");
155
156
157
158 // String representation of the value.
159 private final String name;
160
161
162
163 // Private constructor.
164 private DefaultDebugCategory(String name) { this.name = name; }
165
166
167
168 /**
169 * {@inheritDoc}
170 */
171 public String toString() { return name; }
172
173 }
174
175
176
177 /**
178 * Defines the set of permissable values for the "default-debug-level" property.
179 * <p>
180 * The lowest severity level of debug messages to log when none of
181 * the defined targets match the message.
182 */
183 public static enum DefaultDebugLevel {
184
185 /**
186 * Messages with any severity level will be logged.
187 */
188 ALL("all"),
189
190
191
192 /**
193 * No messages will be logged.
194 */
195 DISABLED("disabled"),
196
197
198
199 /**
200 * Messages with severity level of ERROR or higher will be logged.
201 */
202 ERROR("error"),
203
204
205
206 /**
207 * Messages with severity level of INFO or higher will be logged.
208 */
209 INFO("info"),
210
211
212
213 /**
214 * Messages with severity level of VERBOSE or higher will be
215 * logged.
216 */
217 VERBOSE("verbose"),
218
219
220
221 /**
222 * Messages with severity level of WARNING or higher will be
223 * logged.
224 */
225 WARNING("warning");
226
227
228
229 // String representation of the value.
230 private final String name;
231
232
233
234 // Private constructor.
235 private DefaultDebugLevel(String name) { this.name = name; }
236
237
238
239 /**
240 * {@inheritDoc}
241 */
242 public String toString() { return name; }
243
244 }
245
246
247
248 // The "default-debug-category" property definition.
249 private static final EnumPropertyDefinition<DefaultDebugCategory> PD_DEFAULT_DEBUG_CATEGORY;
250
251
252
253 // The "default-debug-level" property definition.
254 private static final EnumPropertyDefinition<DefaultDebugLevel> PD_DEFAULT_DEBUG_LEVEL;
255
256
257
258 // The "default-include-throwable-cause" property definition.
259 private static final BooleanPropertyDefinition PD_DEFAULT_INCLUDE_THROWABLE_CAUSE;
260
261
262
263 // The "default-omit-method-entry-arguments" property definition.
264 private static final BooleanPropertyDefinition PD_DEFAULT_OMIT_METHOD_ENTRY_ARGUMENTS;
265
266
267
268 // The "default-omit-method-return-value" property definition.
269 private static final BooleanPropertyDefinition PD_DEFAULT_OMIT_METHOD_RETURN_VALUE;
270
271
272
273 // The "default-throwable-stack-frames" property definition.
274 private static final IntegerPropertyDefinition PD_DEFAULT_THROWABLE_STACK_FRAMES;
275
276
277
278 // The "java-class" property definition.
279 private static final ClassPropertyDefinition PD_JAVA_CLASS;
280
281
282
283 // The "debug-targets" relation definition.
284 private static final InstantiableRelationDefinition<DebugTargetCfgClient, DebugTargetCfg> RD_DEBUG_TARGETS;
285
286
287
288 // Build the "default-debug-category" property definition.
289 static {
290 EnumPropertyDefinition.Builder<DefaultDebugCategory> builder = EnumPropertyDefinition.createBuilder(INSTANCE, "default-debug-category");
291 builder.setOption(PropertyOption.MULTI_VALUED);
292 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "default-debug-category"));
293 builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<DefaultDebugCategory>(INSTANCE, "default-debug-category"));
294 builder.setEnumClass(DefaultDebugCategory.class);
295 PD_DEFAULT_DEBUG_CATEGORY = builder.getInstance();
296 INSTANCE.registerPropertyDefinition(PD_DEFAULT_DEBUG_CATEGORY);
297 }
298
299
300
301 // Build the "default-debug-level" property definition.
302 static {
303 EnumPropertyDefinition.Builder<DefaultDebugLevel> builder = EnumPropertyDefinition.createBuilder(INSTANCE, "default-debug-level");
304 builder.setOption(PropertyOption.MANDATORY);
305 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "default-debug-level"));
306 DefaultBehaviorProvider<DefaultDebugLevel> provider = new DefinedDefaultBehaviorProvider<DefaultDebugLevel>("error");
307 builder.setDefaultBehaviorProvider(provider);
308 builder.setEnumClass(DefaultDebugLevel.class);
309 PD_DEFAULT_DEBUG_LEVEL = builder.getInstance();
310 INSTANCE.registerPropertyDefinition(PD_DEFAULT_DEBUG_LEVEL);
311 }
312
313
314
315 // Build the "default-include-throwable-cause" property definition.
316 static {
317 BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "default-include-throwable-cause");
318 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "default-include-throwable-cause"));
319 DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("false");
320 builder.setDefaultBehaviorProvider(provider);
321 PD_DEFAULT_INCLUDE_THROWABLE_CAUSE = builder.getInstance();
322 INSTANCE.registerPropertyDefinition(PD_DEFAULT_INCLUDE_THROWABLE_CAUSE);
323 }
324
325
326
327 // Build the "default-omit-method-entry-arguments" property definition.
328 static {
329 BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "default-omit-method-entry-arguments");
330 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "default-omit-method-entry-arguments"));
331 DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("false");
332 builder.setDefaultBehaviorProvider(provider);
333 PD_DEFAULT_OMIT_METHOD_ENTRY_ARGUMENTS = builder.getInstance();
334 INSTANCE.registerPropertyDefinition(PD_DEFAULT_OMIT_METHOD_ENTRY_ARGUMENTS);
335 }
336
337
338
339 // Build the "default-omit-method-return-value" property definition.
340 static {
341 BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "default-omit-method-return-value");
342 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "default-omit-method-return-value"));
343 DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("false");
344 builder.setDefaultBehaviorProvider(provider);
345 PD_DEFAULT_OMIT_METHOD_RETURN_VALUE = builder.getInstance();
346 INSTANCE.registerPropertyDefinition(PD_DEFAULT_OMIT_METHOD_RETURN_VALUE);
347 }
348
349
350
351 // Build the "default-throwable-stack-frames" property definition.
352 static {
353 IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "default-throwable-stack-frames");
354 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "default-throwable-stack-frames"));
355 DefaultBehaviorProvider<Integer> provider = new DefinedDefaultBehaviorProvider<Integer>("0");
356 builder.setDefaultBehaviorProvider(provider);
357 builder.setLowerLimit(0);
358 PD_DEFAULT_THROWABLE_STACK_FRAMES = builder.getInstance();
359 INSTANCE.registerPropertyDefinition(PD_DEFAULT_THROWABLE_STACK_FRAMES);
360 }
361
362
363
364 // Build the "java-class" property definition.
365 static {
366 ClassPropertyDefinition.Builder builder = ClassPropertyDefinition.createBuilder(INSTANCE, "java-class");
367 builder.setOption(PropertyOption.MANDATORY);
368 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "java-class"));
369 builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
370 builder.addInstanceOf("org.opends.server.api.DebugLogPublisher");
371 PD_JAVA_CLASS = builder.getInstance();
372 INSTANCE.registerPropertyDefinition(PD_JAVA_CLASS);
373 }
374
375
376
377 // Build the "debug-targets" relation definition.
378 static {
379 InstantiableRelationDefinition.Builder<DebugTargetCfgClient, DebugTargetCfg> builder =
380 new InstantiableRelationDefinition.Builder<DebugTargetCfgClient, DebugTargetCfg>(INSTANCE, "debug-target", "debug-targets", DebugTargetCfgDefn.getInstance());
381 builder.setNamingProperty(DebugTargetCfgDefn.getInstance().getDebugScopePropertyDefinition());
382 RD_DEBUG_TARGETS = builder.getInstance();
383 INSTANCE.registerRelationDefinition(RD_DEBUG_TARGETS);
384 }
385
386
387
388 // Register the tags associated with this managed object definition.
389 static {
390 INSTANCE.registerTag(Tag.valueOf("logging"));
391 }
392
393
394
395 /**
396 * Get the Debug Log Publisher configuration definition singleton.
397 *
398 * @return Returns the Debug Log Publisher configuration definition
399 * singleton.
400 */
401 public static DebugLogPublisherCfgDefn getInstance() {
402 return INSTANCE;
403 }
404
405
406
407 /**
408 * Private constructor.
409 */
410 private DebugLogPublisherCfgDefn() {
411 super("debug-log-publisher", LogPublisherCfgDefn.getInstance());
412 }
413
414
415
416 /**
417 * {@inheritDoc}
418 */
419 public DebugLogPublisherCfgClient createClientConfiguration(
420 ManagedObject<? extends DebugLogPublisherCfgClient> impl) {
421 return new DebugLogPublisherCfgClientImpl(impl);
422 }
423
424
425
426 /**
427 * {@inheritDoc}
428 */
429 public DebugLogPublisherCfg createServerConfiguration(
430 ServerManagedObject<? extends DebugLogPublisherCfg> impl) {
431 return new DebugLogPublisherCfgServerImpl(impl);
432 }
433
434
435
436 /**
437 * {@inheritDoc}
438 */
439 public Class<DebugLogPublisherCfg> getServerConfigurationClass() {
440 return DebugLogPublisherCfg.class;
441 }
442
443
444
445 /**
446 * Get the "default-debug-category" property definition.
447 * <p>
448 * The debug message categories to be logged when none of the
449 * defined targets match the message.
450 *
451 * @return Returns the "default-debug-category" property definition.
452 */
453 public EnumPropertyDefinition<DefaultDebugCategory> getDefaultDebugCategoryPropertyDefinition() {
454 return PD_DEFAULT_DEBUG_CATEGORY;
455 }
456
457
458
459 /**
460 * Get the "default-debug-level" property definition.
461 * <p>
462 * The lowest severity level of debug messages to log when none of
463 * the defined targets match the message.
464 *
465 * @return Returns the "default-debug-level" property definition.
466 */
467 public EnumPropertyDefinition<DefaultDebugLevel> getDefaultDebugLevelPropertyDefinition() {
468 return PD_DEFAULT_DEBUG_LEVEL;
469 }
470
471
472
473 /**
474 * Get the "default-include-throwable-cause" property definition.
475 * <p>
476 * Indicates whether to include the cause of exceptions in exception
477 * thrown and caught messages logged by default.
478 *
479 * @return Returns the "default-include-throwable-cause" property definition.
480 */
481 public BooleanPropertyDefinition getDefaultIncludeThrowableCausePropertyDefinition() {
482 return PD_DEFAULT_INCLUDE_THROWABLE_CAUSE;
483 }
484
485
486
487 /**
488 * Get the "default-omit-method-entry-arguments" property definition.
489 * <p>
490 * Indicates whether to include method arguments in debug messages
491 * logged by default.
492 *
493 * @return Returns the "default-omit-method-entry-arguments" property definition.
494 */
495 public BooleanPropertyDefinition getDefaultOmitMethodEntryArgumentsPropertyDefinition() {
496 return PD_DEFAULT_OMIT_METHOD_ENTRY_ARGUMENTS;
497 }
498
499
500
501 /**
502 * Get the "default-omit-method-return-value" property definition.
503 * <p>
504 * Indicates whether to include the return value in debug messages
505 * logged by default.
506 *
507 * @return Returns the "default-omit-method-return-value" property definition.
508 */
509 public BooleanPropertyDefinition getDefaultOmitMethodReturnValuePropertyDefinition() {
510 return PD_DEFAULT_OMIT_METHOD_RETURN_VALUE;
511 }
512
513
514
515 /**
516 * Get the "default-throwable-stack-frames" property definition.
517 * <p>
518 * Indicates the number of stack frames to include in the stack
519 * trace for method entry and exception thrown messages.
520 *
521 * @return Returns the "default-throwable-stack-frames" property definition.
522 */
523 public IntegerPropertyDefinition getDefaultThrowableStackFramesPropertyDefinition() {
524 return PD_DEFAULT_THROWABLE_STACK_FRAMES;
525 }
526
527
528
529 /**
530 * Get the "enabled" property definition.
531 * <p>
532 * Indicates whether the Debug Log Publisher is enabled for use.
533 *
534 * @return Returns the "enabled" property definition.
535 */
536 public BooleanPropertyDefinition getEnabledPropertyDefinition() {
537 return LogPublisherCfgDefn.getInstance().getEnabledPropertyDefinition();
538 }
539
540
541
542 /**
543 * Get the "java-class" property definition.
544 * <p>
545 * The fully-qualified name of the Java class that provides the
546 * Debug Log Publisher implementation.
547 *
548 * @return Returns the "java-class" property definition.
549 */
550 public ClassPropertyDefinition getJavaClassPropertyDefinition() {
551 return PD_JAVA_CLASS;
552 }
553
554
555
556 /**
557 * Get the "debug-targets" relation definition.
558 *
559 * @return Returns the "debug-targets" relation definition.
560 */
561 public InstantiableRelationDefinition<DebugTargetCfgClient,DebugTargetCfg> getDebugTargetsRelationDefinition() {
562 return RD_DEBUG_TARGETS;
563 }
564
565
566
567 /**
568 * Managed object client implementation.
569 */
570 private static class DebugLogPublisherCfgClientImpl implements
571 DebugLogPublisherCfgClient {
572
573 // Private implementation.
574 private ManagedObject<? extends DebugLogPublisherCfgClient> impl;
575
576
577
578 // Private constructor.
579 private DebugLogPublisherCfgClientImpl(
580 ManagedObject<? extends DebugLogPublisherCfgClient> impl) {
581 this.impl = impl;
582 }
583
584
585
586 /**
587 * {@inheritDoc}
588 */
589 public SortedSet<DefaultDebugCategory> getDefaultDebugCategory() {
590 return impl.getPropertyValues(INSTANCE.getDefaultDebugCategoryPropertyDefinition());
591 }
592
593
594
595 /**
596 * {@inheritDoc}
597 */
598 public void setDefaultDebugCategory(Collection<DefaultDebugCategory> values) {
599 impl.setPropertyValues(INSTANCE.getDefaultDebugCategoryPropertyDefinition(), values);
600 }
601
602
603
604 /**
605 * {@inheritDoc}
606 */
607 public DefaultDebugLevel getDefaultDebugLevel() {
608 return impl.getPropertyValue(INSTANCE.getDefaultDebugLevelPropertyDefinition());
609 }
610
611
612
613 /**
614 * {@inheritDoc}
615 */
616 public void setDefaultDebugLevel(DefaultDebugLevel value) {
617 impl.setPropertyValue(INSTANCE.getDefaultDebugLevelPropertyDefinition(), value);
618 }
619
620
621
622 /**
623 * {@inheritDoc}
624 */
625 public boolean isDefaultIncludeThrowableCause() {
626 return impl.getPropertyValue(INSTANCE.getDefaultIncludeThrowableCausePropertyDefinition());
627 }
628
629
630
631 /**
632 * {@inheritDoc}
633 */
634 public void setDefaultIncludeThrowableCause(Boolean value) {
635 impl.setPropertyValue(INSTANCE.getDefaultIncludeThrowableCausePropertyDefinition(), value);
636 }
637
638
639
640 /**
641 * {@inheritDoc}
642 */
643 public boolean isDefaultOmitMethodEntryArguments() {
644 return impl.getPropertyValue(INSTANCE.getDefaultOmitMethodEntryArgumentsPropertyDefinition());
645 }
646
647
648
649 /**
650 * {@inheritDoc}
651 */
652 public void setDefaultOmitMethodEntryArguments(Boolean value) {
653 impl.setPropertyValue(INSTANCE.getDefaultOmitMethodEntryArgumentsPropertyDefinition(), value);
654 }
655
656
657
658 /**
659 * {@inheritDoc}
660 */
661 public boolean isDefaultOmitMethodReturnValue() {
662 return impl.getPropertyValue(INSTANCE.getDefaultOmitMethodReturnValuePropertyDefinition());
663 }
664
665
666
667 /**
668 * {@inheritDoc}
669 */
670 public void setDefaultOmitMethodReturnValue(Boolean value) {
671 impl.setPropertyValue(INSTANCE.getDefaultOmitMethodReturnValuePropertyDefinition(), value);
672 }
673
674
675
676 /**
677 * {@inheritDoc}
678 */
679 public int getDefaultThrowableStackFrames() {
680 return impl.getPropertyValue(INSTANCE.getDefaultThrowableStackFramesPropertyDefinition());
681 }
682
683
684
685 /**
686 * {@inheritDoc}
687 */
688 public void setDefaultThrowableStackFrames(Integer value) {
689 impl.setPropertyValue(INSTANCE.getDefaultThrowableStackFramesPropertyDefinition(), value);
690 }
691
692
693
694 /**
695 * {@inheritDoc}
696 */
697 public Boolean isEnabled() {
698 return impl.getPropertyValue(INSTANCE.getEnabledPropertyDefinition());
699 }
700
701
702
703 /**
704 * {@inheritDoc}
705 */
706 public void setEnabled(boolean value) {
707 impl.setPropertyValue(INSTANCE.getEnabledPropertyDefinition(), value);
708 }
709
710
711
712 /**
713 * {@inheritDoc}
714 */
715 public String getJavaClass() {
716 return impl.getPropertyValue(INSTANCE.getJavaClassPropertyDefinition());
717 }
718
719
720
721 /**
722 * {@inheritDoc}
723 */
724 public void setJavaClass(String value) {
725 impl.setPropertyValue(INSTANCE.getJavaClassPropertyDefinition(), value);
726 }
727
728
729
730 /**
731 * {@inheritDoc}
732 */
733 public String[] listDebugTargets() throws ConcurrentModificationException,
734 AuthorizationException, CommunicationException {
735 return impl.listChildren(INSTANCE.getDebugTargetsRelationDefinition());
736 }
737
738
739
740 /**
741 * {@inheritDoc}
742 */
743 public DebugTargetCfgClient getDebugTarget(String name)
744 throws DefinitionDecodingException, ManagedObjectDecodingException,
745 ManagedObjectNotFoundException, ConcurrentModificationException,
746 AuthorizationException, CommunicationException {
747 return impl.getChild(INSTANCE.getDebugTargetsRelationDefinition(), name).getConfiguration();
748 }
749
750
751
752 /**
753 * {@inheritDoc}
754 */
755 public <M extends DebugTargetCfgClient> M createDebugTarget(
756 ManagedObjectDefinition<M, ? extends DebugTargetCfg> d, String name, Collection<DefaultBehaviorException> exceptions) throws IllegalManagedObjectNameException {
757 return impl.createChild(INSTANCE.getDebugTargetsRelationDefinition(), d, name, exceptions).getConfiguration();
758 }
759
760
761
762 /**
763 * {@inheritDoc}
764 */
765 public void removeDebugTarget(String name)
766 throws ManagedObjectNotFoundException, ConcurrentModificationException,
767 OperationRejectedException, AuthorizationException, CommunicationException {
768 impl.removeChild(INSTANCE.getDebugTargetsRelationDefinition(), name);
769 }
770
771
772
773 /**
774 * {@inheritDoc}
775 */
776 public ManagedObjectDefinition<? extends DebugLogPublisherCfgClient, ? extends DebugLogPublisherCfg> definition() {
777 return INSTANCE;
778 }
779
780
781
782 /**
783 * {@inheritDoc}
784 */
785 public PropertyProvider properties() {
786 return impl;
787 }
788
789
790
791 /**
792 * {@inheritDoc}
793 */
794 public void commit() throws ManagedObjectAlreadyExistsException,
795 MissingMandatoryPropertiesException, ConcurrentModificationException,
796 OperationRejectedException, AuthorizationException,
797 CommunicationException {
798 impl.commit();
799 }
800
801 }
802
803
804
805 /**
806 * Managed object server implementation.
807 */
808 private static class DebugLogPublisherCfgServerImpl implements
809 DebugLogPublisherCfg {
810
811 // Private implementation.
812 private ServerManagedObject<? extends DebugLogPublisherCfg> impl;
813
814 // The value of the "default-debug-category" property.
815 private final SortedSet<DefaultDebugCategory> pDefaultDebugCategory;
816
817 // The value of the "default-debug-level" property.
818 private final DefaultDebugLevel pDefaultDebugLevel;
819
820 // The value of the "default-include-throwable-cause" property.
821 private final boolean pDefaultIncludeThrowableCause;
822
823 // The value of the "default-omit-method-entry-arguments" property.
824 private final boolean pDefaultOmitMethodEntryArguments;
825
826 // The value of the "default-omit-method-return-value" property.
827 private final boolean pDefaultOmitMethodReturnValue;
828
829 // The value of the "default-throwable-stack-frames" property.
830 private final int pDefaultThrowableStackFrames;
831
832 // The value of the "enabled" property.
833 private final boolean pEnabled;
834
835 // The value of the "java-class" property.
836 private final String pJavaClass;
837
838
839
840 // Private constructor.
841 private DebugLogPublisherCfgServerImpl(ServerManagedObject<? extends DebugLogPublisherCfg> impl) {
842 this.impl = impl;
843 this.pDefaultDebugCategory = impl.getPropertyValues(INSTANCE.getDefaultDebugCategoryPropertyDefinition());
844 this.pDefaultDebugLevel = impl.getPropertyValue(INSTANCE.getDefaultDebugLevelPropertyDefinition());
845 this.pDefaultIncludeThrowableCause = impl.getPropertyValue(INSTANCE.getDefaultIncludeThrowableCausePropertyDefinition());
846 this.pDefaultOmitMethodEntryArguments = impl.getPropertyValue(INSTANCE.getDefaultOmitMethodEntryArgumentsPropertyDefinition());
847 this.pDefaultOmitMethodReturnValue = impl.getPropertyValue(INSTANCE.getDefaultOmitMethodReturnValuePropertyDefinition());
848 this.pDefaultThrowableStackFrames = impl.getPropertyValue(INSTANCE.getDefaultThrowableStackFramesPropertyDefinition());
849 this.pEnabled = impl.getPropertyValue(INSTANCE.getEnabledPropertyDefinition());
850 this.pJavaClass = impl.getPropertyValue(INSTANCE.getJavaClassPropertyDefinition());
851 }
852
853
854
855 /**
856 * {@inheritDoc}
857 */
858 public void addDebugChangeListener(
859 ConfigurationChangeListener<DebugLogPublisherCfg> listener) {
860 impl.registerChangeListener(listener);
861 }
862
863
864
865 /**
866 * {@inheritDoc}
867 */
868 public void removeDebugChangeListener(
869 ConfigurationChangeListener<DebugLogPublisherCfg> listener) {
870 impl.deregisterChangeListener(listener);
871 }
872 /**
873 * {@inheritDoc}
874 */
875 public void addChangeListener(
876 ConfigurationChangeListener<LogPublisherCfg> listener) {
877 impl.registerChangeListener(listener);
878 }
879
880
881
882 /**
883 * {@inheritDoc}
884 */
885 public void removeChangeListener(
886 ConfigurationChangeListener<LogPublisherCfg> listener) {
887 impl.deregisterChangeListener(listener);
888 }
889
890
891
892 /**
893 * {@inheritDoc}
894 */
895 public SortedSet<DefaultDebugCategory> getDefaultDebugCategory() {
896 return pDefaultDebugCategory;
897 }
898
899
900
901 /**
902 * {@inheritDoc}
903 */
904 public DefaultDebugLevel getDefaultDebugLevel() {
905 return pDefaultDebugLevel;
906 }
907
908
909
910 /**
911 * {@inheritDoc}
912 */
913 public boolean isDefaultIncludeThrowableCause() {
914 return pDefaultIncludeThrowableCause;
915 }
916
917
918
919 /**
920 * {@inheritDoc}
921 */
922 public boolean isDefaultOmitMethodEntryArguments() {
923 return pDefaultOmitMethodEntryArguments;
924 }
925
926
927
928 /**
929 * {@inheritDoc}
930 */
931 public boolean isDefaultOmitMethodReturnValue() {
932 return pDefaultOmitMethodReturnValue;
933 }
934
935
936
937 /**
938 * {@inheritDoc}
939 */
940 public int getDefaultThrowableStackFrames() {
941 return pDefaultThrowableStackFrames;
942 }
943
944
945
946 /**
947 * {@inheritDoc}
948 */
949 public boolean isEnabled() {
950 return pEnabled;
951 }
952
953
954
955 /**
956 * {@inheritDoc}
957 */
958 public String getJavaClass() {
959 return pJavaClass;
960 }
961
962
963
964 /**
965 * {@inheritDoc}
966 */
967 public String[] listDebugTargets() {
968 return impl.listChildren(INSTANCE.getDebugTargetsRelationDefinition());
969 }
970
971
972
973 /**
974 * {@inheritDoc}
975 */
976 public DebugTargetCfg getDebugTarget(String name) throws ConfigException {
977 return impl.getChild(INSTANCE.getDebugTargetsRelationDefinition(), name).getConfiguration();
978 }
979
980
981
982 /**
983 * {@inheritDoc}
984 */
985 public void addDebugTargetAddListener(
986 ConfigurationAddListener<DebugTargetCfg> listener) throws ConfigException {
987 impl.registerAddListener(INSTANCE.getDebugTargetsRelationDefinition(), listener);
988 }
989
990
991
992 /**
993 * {@inheritDoc}
994 */
995 public void removeDebugTargetAddListener(
996 ConfigurationAddListener<DebugTargetCfg> listener) {
997 impl.deregisterAddListener(INSTANCE.getDebugTargetsRelationDefinition(), listener);
998 }
999
1000
1001
1002 /**
1003 * {@inheritDoc}
1004 */
1005 public void addDebugTargetDeleteListener(
1006 ConfigurationDeleteListener<DebugTargetCfg> listener) throws ConfigException {
1007 impl.registerDeleteListener(INSTANCE.getDebugTargetsRelationDefinition(), listener);
1008 }
1009
1010
1011
1012 /**
1013 * {@inheritDoc}
1014 */
1015 public void removeDebugTargetDeleteListener(
1016 ConfigurationDeleteListener<DebugTargetCfg> listener) {
1017 impl.deregisterDeleteListener(INSTANCE.getDebugTargetsRelationDefinition(), listener);
1018 }
1019
1020
1021
1022 /**
1023 * {@inheritDoc}
1024 */
1025 public Class<? extends DebugLogPublisherCfg> configurationClass() {
1026 return DebugLogPublisherCfg.class;
1027 }
1028
1029
1030
1031 /**
1032 * {@inheritDoc}
1033 */
1034 public DN dn() {
1035 return impl.getDN();
1036 }
1037
1038 }
1039 }