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