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