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