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