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.forgerock.opendj.server.config.meta; 017 018 019 020import java.util.Collection; 021import java.util.SortedSet; 022import java.util.TreeSet; 023import org.forgerock.opendj.config.AdministratorAction; 024import org.forgerock.opendj.config.AggregationPropertyDefinition; 025import org.forgerock.opendj.config.AliasDefaultBehaviorProvider; 026import org.forgerock.opendj.config.BooleanPropertyDefinition; 027import org.forgerock.opendj.config.ClassPropertyDefinition; 028import org.forgerock.opendj.config.client.ConcurrentModificationException; 029import org.forgerock.opendj.config.client.ManagedObject; 030import org.forgerock.opendj.config.client.MissingMandatoryPropertiesException; 031import org.forgerock.opendj.config.client.OperationRejectedException; 032import org.forgerock.opendj.config.DefaultBehaviorProvider; 033import org.forgerock.opendj.config.DefinedDefaultBehaviorProvider; 034import org.forgerock.opendj.config.DurationPropertyDefinition; 035import org.forgerock.opendj.config.ManagedObjectAlreadyExistsException; 036import org.forgerock.opendj.config.ManagedObjectDefinition; 037import org.forgerock.opendj.config.PropertyOption; 038import org.forgerock.opendj.config.PropertyProvider; 039import org.forgerock.opendj.config.server.ConfigurationChangeListener; 040import org.forgerock.opendj.config.server.ServerManagedObject; 041import org.forgerock.opendj.config.StringPropertyDefinition; 042import org.forgerock.opendj.config.Tag; 043import org.forgerock.opendj.config.UndefinedDefaultBehaviorProvider; 044import org.forgerock.opendj.ldap.DN; 045import org.forgerock.opendj.ldap.LdapException; 046import org.forgerock.opendj.server.config.client.CsvFileHTTPAccessLogPublisherCfgClient; 047import org.forgerock.opendj.server.config.client.LogRetentionPolicyCfgClient; 048import org.forgerock.opendj.server.config.client.LogRotationPolicyCfgClient; 049import org.forgerock.opendj.server.config.server.CsvFileHTTPAccessLogPublisherCfg; 050import org.forgerock.opendj.server.config.server.HTTPAccessLogPublisherCfg; 051import org.forgerock.opendj.server.config.server.LogPublisherCfg; 052import org.forgerock.opendj.server.config.server.LogRetentionPolicyCfg; 053import org.forgerock.opendj.server.config.server.LogRotationPolicyCfg; 054 055 056 057/** 058 * An interface for querying the Csv File HTTP Access Log Publisher 059 * managed object definition meta information. 060 * <p> 061 * Csv File HTTP Access Log Publishers publish HTTP access messages to 062 * CSV files. 063 */ 064public final class CsvFileHTTPAccessLogPublisherCfgDefn extends ManagedObjectDefinition<CsvFileHTTPAccessLogPublisherCfgClient, CsvFileHTTPAccessLogPublisherCfg> { 065 066 /** The singleton configuration definition instance. */ 067 private static final CsvFileHTTPAccessLogPublisherCfgDefn INSTANCE = new CsvFileHTTPAccessLogPublisherCfgDefn(); 068 069 070 071 /** The "asynchronous" property definition. */ 072 private static final BooleanPropertyDefinition PD_ASYNCHRONOUS; 073 074 075 076 /** The "auto-flush" property definition. */ 077 private static final BooleanPropertyDefinition PD_AUTO_FLUSH; 078 079 080 081 /** The "csv-delimiter-char" property definition. */ 082 private static final StringPropertyDefinition PD_CSV_DELIMITER_CHAR; 083 084 085 086 /** The "csv-eol-symbols" property definition. */ 087 private static final StringPropertyDefinition PD_CSV_EOL_SYMBOLS; 088 089 090 091 /** The "csv-quote-char" property definition. */ 092 private static final StringPropertyDefinition PD_CSV_QUOTE_CHAR; 093 094 095 096 /** The "java-class" property definition. */ 097 private static final ClassPropertyDefinition PD_JAVA_CLASS; 098 099 100 101 /** The "key-store-file" property definition. */ 102 private static final StringPropertyDefinition PD_KEY_STORE_FILE; 103 104 105 106 /** The "key-store-pin-file" property definition. */ 107 private static final StringPropertyDefinition PD_KEY_STORE_PIN_FILE; 108 109 110 111 /** The "log-directory" property definition. */ 112 private static final StringPropertyDefinition PD_LOG_DIRECTORY; 113 114 115 116 /** The "retention-policy" property definition. */ 117 private static final AggregationPropertyDefinition<LogRetentionPolicyCfgClient, LogRetentionPolicyCfg> PD_RETENTION_POLICY; 118 119 120 121 /** The "rotation-policy" property definition. */ 122 private static final AggregationPropertyDefinition<LogRotationPolicyCfgClient, LogRotationPolicyCfg> PD_ROTATION_POLICY; 123 124 125 126 /** The "signature-time-interval" property definition. */ 127 private static final DurationPropertyDefinition PD_SIGNATURE_TIME_INTERVAL; 128 129 130 131 /** The "tamper-evident" property definition. */ 132 private static final BooleanPropertyDefinition PD_TAMPER_EVIDENT; 133 134 135 136 /** Build the "asynchronous" property definition. */ 137 static { 138 BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "asynchronous"); 139 builder.setOption(PropertyOption.MANDATORY); 140 builder.setOption(PropertyOption.ADVANCED); 141 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "asynchronous")); 142 DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("true"); 143 builder.setDefaultBehaviorProvider(provider); 144 PD_ASYNCHRONOUS = builder.getInstance(); 145 INSTANCE.registerPropertyDefinition(PD_ASYNCHRONOUS); 146 } 147 148 149 150 /** Build the "auto-flush" property definition. */ 151 static { 152 BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "auto-flush"); 153 builder.setOption(PropertyOption.ADVANCED); 154 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "auto-flush")); 155 DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("true"); 156 builder.setDefaultBehaviorProvider(provider); 157 PD_AUTO_FLUSH = builder.getInstance(); 158 INSTANCE.registerPropertyDefinition(PD_AUTO_FLUSH); 159 } 160 161 162 163 /** Build the "csv-delimiter-char" property definition. */ 164 static { 165 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "csv-delimiter-char"); 166 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "csv-delimiter-char")); 167 DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>(","); 168 builder.setDefaultBehaviorProvider(provider); 169 builder.setPattern(".*", "DELIMITER CHARACTER"); 170 PD_CSV_DELIMITER_CHAR = builder.getInstance(); 171 INSTANCE.registerPropertyDefinition(PD_CSV_DELIMITER_CHAR); 172 } 173 174 175 176 /** Build the "csv-eol-symbols" property definition. */ 177 static { 178 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "csv-eol-symbols"); 179 builder.setOption(PropertyOption.ADVANCED); 180 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "csv-eol-symbols")); 181 builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "csv-eol-symbols")); 182 builder.setPattern(".*", "EOL SYMBOLS"); 183 PD_CSV_EOL_SYMBOLS = builder.getInstance(); 184 INSTANCE.registerPropertyDefinition(PD_CSV_EOL_SYMBOLS); 185 } 186 187 188 189 /** Build the "csv-quote-char" property definition. */ 190 static { 191 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "csv-quote-char"); 192 builder.setOption(PropertyOption.ADVANCED); 193 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "csv-quote-char")); 194 DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("\""); 195 builder.setDefaultBehaviorProvider(provider); 196 builder.setPattern(".*", "QUOTE CHARACTER"); 197 PD_CSV_QUOTE_CHAR = builder.getInstance(); 198 INSTANCE.registerPropertyDefinition(PD_CSV_QUOTE_CHAR); 199 } 200 201 202 203 /** Build the "java-class" property definition. */ 204 static { 205 ClassPropertyDefinition.Builder builder = ClassPropertyDefinition.createBuilder(INSTANCE, "java-class"); 206 builder.setOption(PropertyOption.MANDATORY); 207 builder.setOption(PropertyOption.ADVANCED); 208 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "java-class")); 209 DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("org.opends.server.loggers.CommonAuditHTTPAccessLogPublisher"); 210 builder.setDefaultBehaviorProvider(provider); 211 builder.addInstanceOf("org.opends.server.loggers.LogPublisher"); 212 PD_JAVA_CLASS = builder.getInstance(); 213 INSTANCE.registerPropertyDefinition(PD_JAVA_CLASS); 214 } 215 216 217 218 /** Build the "key-store-file" property definition. */ 219 static { 220 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "key-store-file"); 221 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "key-store-file")); 222 builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>()); 223 builder.setPattern(".*", "FILE"); 224 PD_KEY_STORE_FILE = builder.getInstance(); 225 INSTANCE.registerPropertyDefinition(PD_KEY_STORE_FILE); 226 } 227 228 229 230 /** Build the "key-store-pin-file" property definition. */ 231 static { 232 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "key-store-pin-file"); 233 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "key-store-pin-file")); 234 builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>()); 235 builder.setPattern(".*", "FILE"); 236 PD_KEY_STORE_PIN_FILE = builder.getInstance(); 237 INSTANCE.registerPropertyDefinition(PD_KEY_STORE_PIN_FILE); 238 } 239 240 241 242 /** Build the "log-directory" property definition. */ 243 static { 244 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "log-directory"); 245 builder.setOption(PropertyOption.MANDATORY); 246 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "log-directory")); 247 DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("logs"); 248 builder.setDefaultBehaviorProvider(provider); 249 builder.setPattern(".*", "DIRECTORY"); 250 PD_LOG_DIRECTORY = builder.getInstance(); 251 INSTANCE.registerPropertyDefinition(PD_LOG_DIRECTORY); 252 } 253 254 255 256 /** Build the "retention-policy" property definition. */ 257 static { 258 AggregationPropertyDefinition.Builder<LogRetentionPolicyCfgClient, LogRetentionPolicyCfg> builder = AggregationPropertyDefinition.createBuilder(INSTANCE, "retention-policy"); 259 builder.setOption(PropertyOption.MULTI_VALUED); 260 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "retention-policy")); 261 builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "retention-policy")); 262 builder.setParentPath("/"); 263 builder.setRelationDefinition("log-retention-policy"); 264 PD_RETENTION_POLICY = builder.getInstance(); 265 INSTANCE.registerPropertyDefinition(PD_RETENTION_POLICY); 266 INSTANCE.registerConstraint(PD_RETENTION_POLICY.getSourceConstraint()); 267 } 268 269 270 271 /** Build the "rotation-policy" property definition. */ 272 static { 273 AggregationPropertyDefinition.Builder<LogRotationPolicyCfgClient, LogRotationPolicyCfg> builder = AggregationPropertyDefinition.createBuilder(INSTANCE, "rotation-policy"); 274 builder.setOption(PropertyOption.MULTI_VALUED); 275 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "rotation-policy")); 276 builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "rotation-policy")); 277 builder.setParentPath("/"); 278 builder.setRelationDefinition("log-rotation-policy"); 279 PD_ROTATION_POLICY = builder.getInstance(); 280 INSTANCE.registerPropertyDefinition(PD_ROTATION_POLICY); 281 INSTANCE.registerConstraint(PD_ROTATION_POLICY.getSourceConstraint()); 282 } 283 284 285 286 /** Build the "signature-time-interval" property definition. */ 287 static { 288 DurationPropertyDefinition.Builder builder = DurationPropertyDefinition.createBuilder(INSTANCE, "signature-time-interval"); 289 builder.setOption(PropertyOption.ADVANCED); 290 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "signature-time-interval")); 291 DefaultBehaviorProvider<Long> provider = new DefinedDefaultBehaviorProvider<Long>("3s"); 292 builder.setDefaultBehaviorProvider(provider); 293 builder.setBaseUnit("ms"); 294 builder.setLowerLimit("1"); 295 PD_SIGNATURE_TIME_INTERVAL = builder.getInstance(); 296 INSTANCE.registerPropertyDefinition(PD_SIGNATURE_TIME_INTERVAL); 297 } 298 299 300 301 /** Build the "tamper-evident" property definition. */ 302 static { 303 BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "tamper-evident"); 304 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "tamper-evident")); 305 DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("false"); 306 builder.setDefaultBehaviorProvider(provider); 307 PD_TAMPER_EVIDENT = builder.getInstance(); 308 INSTANCE.registerPropertyDefinition(PD_TAMPER_EVIDENT); 309 } 310 311 312 313 // Register the tags associated with this managed object definition. 314 static { 315 INSTANCE.registerTag(Tag.valueOf("logging")); 316 } 317 318 319 320 /** 321 * Get the Csv File HTTP Access Log Publisher configuration 322 * definition singleton. 323 * 324 * @return Returns the Csv File HTTP Access Log Publisher 325 * configuration definition singleton. 326 */ 327 public static CsvFileHTTPAccessLogPublisherCfgDefn getInstance() { 328 return INSTANCE; 329 } 330 331 332 333 /** 334 * Private constructor. 335 */ 336 private CsvFileHTTPAccessLogPublisherCfgDefn() { 337 super("csv-file-http-access-log-publisher", HTTPAccessLogPublisherCfgDefn.getInstance()); 338 } 339 340 341 342 /** {@inheritDoc} */ 343 public CsvFileHTTPAccessLogPublisherCfgClient createClientConfiguration( 344 ManagedObject<? extends CsvFileHTTPAccessLogPublisherCfgClient> impl) { 345 return new CsvFileHTTPAccessLogPublisherCfgClientImpl(impl); 346 } 347 348 349 350 /** {@inheritDoc} */ 351 public CsvFileHTTPAccessLogPublisherCfg createServerConfiguration( 352 ServerManagedObject<? extends CsvFileHTTPAccessLogPublisherCfg> impl) { 353 return new CsvFileHTTPAccessLogPublisherCfgServerImpl(impl); 354 } 355 356 357 358 /** {@inheritDoc} */ 359 public Class<CsvFileHTTPAccessLogPublisherCfg> getServerConfigurationClass() { 360 return CsvFileHTTPAccessLogPublisherCfg.class; 361 } 362 363 364 365 /** 366 * Get the "asynchronous" property definition. 367 * <p> 368 * Indicates whether the Csv File HTTP 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 "csv-delimiter-char" property definition. 397 * <p> 398 * The delimiter character to use when writing in CSV format. 399 * 400 * @return Returns the "csv-delimiter-char" property definition. 401 */ 402 public StringPropertyDefinition getCsvDelimiterCharPropertyDefinition() { 403 return PD_CSV_DELIMITER_CHAR; 404 } 405 406 407 408 /** 409 * Get the "csv-eol-symbols" property definition. 410 * <p> 411 * The string that marks the end of a line. 412 * 413 * @return Returns the "csv-eol-symbols" property definition. 414 */ 415 public StringPropertyDefinition getCsvEolSymbolsPropertyDefinition() { 416 return PD_CSV_EOL_SYMBOLS; 417 } 418 419 420 421 /** 422 * Get the "csv-quote-char" property definition. 423 * <p> 424 * The character to append and prepend to a CSV field when writing 425 * in CSV format. 426 * 427 * @return Returns the "csv-quote-char" property definition. 428 */ 429 public StringPropertyDefinition getCsvQuoteCharPropertyDefinition() { 430 return PD_CSV_QUOTE_CHAR; 431 } 432 433 434 435 /** 436 * Get the "enabled" property definition. 437 * <p> 438 * Indicates whether the Csv File HTTP Access Log Publisher is 439 * enabled for use. 440 * 441 * @return Returns the "enabled" property definition. 442 */ 443 public BooleanPropertyDefinition getEnabledPropertyDefinition() { 444 return HTTPAccessLogPublisherCfgDefn.getInstance().getEnabledPropertyDefinition(); 445 } 446 447 448 449 /** 450 * Get the "java-class" property definition. 451 * <p> 452 * The fully-qualified name of the Java class that provides the Csv 453 * File HTTP Access Log Publisher implementation. 454 * 455 * @return Returns the "java-class" property definition. 456 */ 457 public ClassPropertyDefinition getJavaClassPropertyDefinition() { 458 return PD_JAVA_CLASS; 459 } 460 461 462 463 /** 464 * Get the "key-store-file" property definition. 465 * <p> 466 * Specifies the path to the file that contains the private key 467 * information. This may be an absolute path, or a path that is 468 * relative to the OpenDJ instance root. 469 * <p> 470 * Changes to this property will take effect the next time that the 471 * key store is accessed. 472 * 473 * @return Returns the "key-store-file" property definition. 474 */ 475 public StringPropertyDefinition getKeyStoreFilePropertyDefinition() { 476 return PD_KEY_STORE_FILE; 477 } 478 479 480 481 /** 482 * Get the "key-store-pin-file" property definition. 483 * <p> 484 * Specifies the path to the text file whose only contents should be 485 * a single line containing the clear-text PIN needed to access the 486 * Csv File HTTP Access Log Publisher . 487 * 488 * @return Returns the "key-store-pin-file" property definition. 489 */ 490 public StringPropertyDefinition getKeyStorePinFilePropertyDefinition() { 491 return PD_KEY_STORE_PIN_FILE; 492 } 493 494 495 496 /** 497 * Get the "log-directory" property definition. 498 * <p> 499 * The directory to use for the log files generated by the Csv File 500 * HTTP Access Log Publisher. The path to the directory is relative 501 * to the server root. 502 * 503 * @return Returns the "log-directory" property definition. 504 */ 505 public StringPropertyDefinition getLogDirectoryPropertyDefinition() { 506 return PD_LOG_DIRECTORY; 507 } 508 509 510 511 /** 512 * Get the "retention-policy" property definition. 513 * <p> 514 * The retention policy to use for the Csv File HTTP Access Log 515 * Publisher . 516 * <p> 517 * When multiple policies are used, log files are cleaned when any 518 * of the policy's conditions are met. 519 * 520 * @return Returns the "retention-policy" property definition. 521 */ 522 public AggregationPropertyDefinition<LogRetentionPolicyCfgClient, LogRetentionPolicyCfg> getRetentionPolicyPropertyDefinition() { 523 return PD_RETENTION_POLICY; 524 } 525 526 527 528 /** 529 * Get the "rotation-policy" property definition. 530 * <p> 531 * The rotation policy to use for the Csv File HTTP Access Log 532 * Publisher . 533 * <p> 534 * When multiple policies are used, rotation will occur if any 535 * policy's conditions are met. 536 * 537 * @return Returns the "rotation-policy" property definition. 538 */ 539 public AggregationPropertyDefinition<LogRotationPolicyCfgClient, LogRotationPolicyCfg> getRotationPolicyPropertyDefinition() { 540 return PD_ROTATION_POLICY; 541 } 542 543 544 545 /** 546 * Get the "signature-time-interval" property definition. 547 * <p> 548 * Specifies the interval at which to sign the log file when secure 549 * option is enabled. 550 * 551 * @return Returns the "signature-time-interval" property definition. 552 */ 553 public DurationPropertyDefinition getSignatureTimeIntervalPropertyDefinition() { 554 return PD_SIGNATURE_TIME_INTERVAL; 555 } 556 557 558 559 /** 560 * Get the "tamper-evident" property definition. 561 * <p> 562 * Specifies whether the log should be signed in order to detect 563 * tampering. 564 * <p> 565 * Every log record will be signed, making it possible to verify 566 * that the log has not been tampered with. This feature has a 567 * significative impact on performance of the server. 568 * 569 * @return Returns the "tamper-evident" property definition. 570 */ 571 public BooleanPropertyDefinition getTamperEvidentPropertyDefinition() { 572 return PD_TAMPER_EVIDENT; 573 } 574 575 576 577 /** 578 * Managed object client implementation. 579 */ 580 private static class CsvFileHTTPAccessLogPublisherCfgClientImpl implements 581 CsvFileHTTPAccessLogPublisherCfgClient { 582 583 /** Private implementation. */ 584 private ManagedObject<? extends CsvFileHTTPAccessLogPublisherCfgClient> impl; 585 586 587 588 /** Private constructor. */ 589 private CsvFileHTTPAccessLogPublisherCfgClientImpl( 590 ManagedObject<? extends CsvFileHTTPAccessLogPublisherCfgClient> impl) { 591 this.impl = impl; 592 } 593 594 595 596 /** {@inheritDoc} */ 597 public boolean isAsynchronous() { 598 return impl.getPropertyValue(INSTANCE.getAsynchronousPropertyDefinition()); 599 } 600 601 602 603 /** {@inheritDoc} */ 604 public void setAsynchronous(boolean value) { 605 impl.setPropertyValue(INSTANCE.getAsynchronousPropertyDefinition(), value); 606 } 607 608 609 610 /** {@inheritDoc} */ 611 public boolean isAutoFlush() { 612 return impl.getPropertyValue(INSTANCE.getAutoFlushPropertyDefinition()); 613 } 614 615 616 617 /** {@inheritDoc} */ 618 public void setAutoFlush(Boolean value) { 619 impl.setPropertyValue(INSTANCE.getAutoFlushPropertyDefinition(), value); 620 } 621 622 623 624 /** {@inheritDoc} */ 625 public String getCsvDelimiterChar() { 626 return impl.getPropertyValue(INSTANCE.getCsvDelimiterCharPropertyDefinition()); 627 } 628 629 630 631 /** {@inheritDoc} */ 632 public void setCsvDelimiterChar(String value) { 633 impl.setPropertyValue(INSTANCE.getCsvDelimiterCharPropertyDefinition(), value); 634 } 635 636 637 638 /** {@inheritDoc} */ 639 public String getCsvEolSymbols() { 640 return impl.getPropertyValue(INSTANCE.getCsvEolSymbolsPropertyDefinition()); 641 } 642 643 644 645 /** {@inheritDoc} */ 646 public void setCsvEolSymbols(String value) { 647 impl.setPropertyValue(INSTANCE.getCsvEolSymbolsPropertyDefinition(), value); 648 } 649 650 651 652 /** {@inheritDoc} */ 653 public String getCsvQuoteChar() { 654 return impl.getPropertyValue(INSTANCE.getCsvQuoteCharPropertyDefinition()); 655 } 656 657 658 659 /** {@inheritDoc} */ 660 public void setCsvQuoteChar(String value) { 661 impl.setPropertyValue(INSTANCE.getCsvQuoteCharPropertyDefinition(), value); 662 } 663 664 665 666 /** {@inheritDoc} */ 667 public Boolean isEnabled() { 668 return impl.getPropertyValue(INSTANCE.getEnabledPropertyDefinition()); 669 } 670 671 672 673 /** {@inheritDoc} */ 674 public void setEnabled(boolean value) { 675 impl.setPropertyValue(INSTANCE.getEnabledPropertyDefinition(), value); 676 } 677 678 679 680 /** {@inheritDoc} */ 681 public String getJavaClass() { 682 return impl.getPropertyValue(INSTANCE.getJavaClassPropertyDefinition()); 683 } 684 685 686 687 /** {@inheritDoc} */ 688 public void setJavaClass(String value) { 689 impl.setPropertyValue(INSTANCE.getJavaClassPropertyDefinition(), value); 690 } 691 692 693 694 /** {@inheritDoc} */ 695 public String getKeyStoreFile() { 696 return impl.getPropertyValue(INSTANCE.getKeyStoreFilePropertyDefinition()); 697 } 698 699 700 701 /** {@inheritDoc} */ 702 public void setKeyStoreFile(String value) { 703 impl.setPropertyValue(INSTANCE.getKeyStoreFilePropertyDefinition(), value); 704 } 705 706 707 708 /** {@inheritDoc} */ 709 public String getKeyStorePinFile() { 710 return impl.getPropertyValue(INSTANCE.getKeyStorePinFilePropertyDefinition()); 711 } 712 713 714 715 /** {@inheritDoc} */ 716 public void setKeyStorePinFile(String value) { 717 impl.setPropertyValue(INSTANCE.getKeyStorePinFilePropertyDefinition(), value); 718 } 719 720 721 722 /** {@inheritDoc} */ 723 public String getLogDirectory() { 724 return impl.getPropertyValue(INSTANCE.getLogDirectoryPropertyDefinition()); 725 } 726 727 728 729 /** {@inheritDoc} */ 730 public void setLogDirectory(String value) { 731 impl.setPropertyValue(INSTANCE.getLogDirectoryPropertyDefinition(), value); 732 } 733 734 735 736 /** {@inheritDoc} */ 737 public SortedSet<String> getRetentionPolicy() { 738 return impl.getPropertyValues(INSTANCE.getRetentionPolicyPropertyDefinition()); 739 } 740 741 742 743 /** {@inheritDoc} */ 744 public void setRetentionPolicy(Collection<String> values) { 745 impl.setPropertyValues(INSTANCE.getRetentionPolicyPropertyDefinition(), values); 746 } 747 748 749 750 /** {@inheritDoc} */ 751 public SortedSet<String> getRotationPolicy() { 752 return impl.getPropertyValues(INSTANCE.getRotationPolicyPropertyDefinition()); 753 } 754 755 756 757 /** {@inheritDoc} */ 758 public void setRotationPolicy(Collection<String> values) { 759 impl.setPropertyValues(INSTANCE.getRotationPolicyPropertyDefinition(), values); 760 } 761 762 763 764 /** {@inheritDoc} */ 765 public long getSignatureTimeInterval() { 766 return impl.getPropertyValue(INSTANCE.getSignatureTimeIntervalPropertyDefinition()); 767 } 768 769 770 771 /** {@inheritDoc} */ 772 public void setSignatureTimeInterval(Long value) { 773 impl.setPropertyValue(INSTANCE.getSignatureTimeIntervalPropertyDefinition(), value); 774 } 775 776 777 778 /** {@inheritDoc} */ 779 public boolean isTamperEvident() { 780 return impl.getPropertyValue(INSTANCE.getTamperEvidentPropertyDefinition()); 781 } 782 783 784 785 /** {@inheritDoc} */ 786 public void setTamperEvident(Boolean value) { 787 impl.setPropertyValue(INSTANCE.getTamperEvidentPropertyDefinition(), value); 788 } 789 790 791 792 /** {@inheritDoc} */ 793 public ManagedObjectDefinition<? extends CsvFileHTTPAccessLogPublisherCfgClient, ? extends CsvFileHTTPAccessLogPublisherCfg> definition() { 794 return INSTANCE; 795 } 796 797 798 799 /** {@inheritDoc} */ 800 public PropertyProvider properties() { 801 return impl; 802 } 803 804 805 806 /** {@inheritDoc} */ 807 public void commit() throws ManagedObjectAlreadyExistsException, 808 MissingMandatoryPropertiesException, ConcurrentModificationException, 809 OperationRejectedException, LdapException { 810 impl.commit(); 811 } 812 813 814 815 /** {@inheritDoc} */ 816 public String toString() { 817 return impl.toString(); 818 } 819 } 820 821 822 823 /** 824 * Managed object server implementation. 825 */ 826 private static class CsvFileHTTPAccessLogPublisherCfgServerImpl implements 827 CsvFileHTTPAccessLogPublisherCfg { 828 829 /** Private implementation. */ 830 private ServerManagedObject<? extends CsvFileHTTPAccessLogPublisherCfg> impl; 831 832 /** The value of the "asynchronous" property. */ 833 private final boolean pAsynchronous; 834 835 /** The value of the "auto-flush" property. */ 836 private final boolean pAutoFlush; 837 838 /** The value of the "csv-delimiter-char" property. */ 839 private final String pCsvDelimiterChar; 840 841 /** The value of the "csv-eol-symbols" property. */ 842 private final String pCsvEolSymbols; 843 844 /** The value of the "csv-quote-char" property. */ 845 private final String pCsvQuoteChar; 846 847 /** The value of the "enabled" property. */ 848 private final boolean pEnabled; 849 850 /** The value of the "java-class" property. */ 851 private final String pJavaClass; 852 853 /** The value of the "key-store-file" property. */ 854 private final String pKeyStoreFile; 855 856 /** The value of the "key-store-pin-file" property. */ 857 private final String pKeyStorePinFile; 858 859 /** The value of the "log-directory" property. */ 860 private final String pLogDirectory; 861 862 /** The value of the "retention-policy" property. */ 863 private final SortedSet<String> pRetentionPolicy; 864 865 /** The value of the "rotation-policy" property. */ 866 private final SortedSet<String> pRotationPolicy; 867 868 /** The value of the "signature-time-interval" property. */ 869 private final long pSignatureTimeInterval; 870 871 /** The value of the "tamper-evident" property. */ 872 private final boolean pTamperEvident; 873 874 875 876 /** Private constructor. */ 877 private CsvFileHTTPAccessLogPublisherCfgServerImpl(ServerManagedObject<? extends CsvFileHTTPAccessLogPublisherCfg> impl) { 878 this.impl = impl; 879 this.pAsynchronous = impl.getPropertyValue(INSTANCE.getAsynchronousPropertyDefinition()); 880 this.pAutoFlush = impl.getPropertyValue(INSTANCE.getAutoFlushPropertyDefinition()); 881 this.pCsvDelimiterChar = impl.getPropertyValue(INSTANCE.getCsvDelimiterCharPropertyDefinition()); 882 this.pCsvEolSymbols = impl.getPropertyValue(INSTANCE.getCsvEolSymbolsPropertyDefinition()); 883 this.pCsvQuoteChar = impl.getPropertyValue(INSTANCE.getCsvQuoteCharPropertyDefinition()); 884 this.pEnabled = impl.getPropertyValue(INSTANCE.getEnabledPropertyDefinition()); 885 this.pJavaClass = impl.getPropertyValue(INSTANCE.getJavaClassPropertyDefinition()); 886 this.pKeyStoreFile = impl.getPropertyValue(INSTANCE.getKeyStoreFilePropertyDefinition()); 887 this.pKeyStorePinFile = impl.getPropertyValue(INSTANCE.getKeyStorePinFilePropertyDefinition()); 888 this.pLogDirectory = impl.getPropertyValue(INSTANCE.getLogDirectoryPropertyDefinition()); 889 this.pRetentionPolicy = impl.getPropertyValues(INSTANCE.getRetentionPolicyPropertyDefinition()); 890 this.pRotationPolicy = impl.getPropertyValues(INSTANCE.getRotationPolicyPropertyDefinition()); 891 this.pSignatureTimeInterval = impl.getPropertyValue(INSTANCE.getSignatureTimeIntervalPropertyDefinition()); 892 this.pTamperEvident = impl.getPropertyValue(INSTANCE.getTamperEvidentPropertyDefinition()); 893 } 894 895 896 897 /** {@inheritDoc} */ 898 public void addCsvFileHTTPAccessChangeListener( 899 ConfigurationChangeListener<CsvFileHTTPAccessLogPublisherCfg> listener) { 900 impl.registerChangeListener(listener); 901 } 902 903 904 905 /** {@inheritDoc} */ 906 public void removeCsvFileHTTPAccessChangeListener( 907 ConfigurationChangeListener<CsvFileHTTPAccessLogPublisherCfg> listener) { 908 impl.deregisterChangeListener(listener); 909 } 910 /** {@inheritDoc} */ 911 public void addHTTPAccessChangeListener( 912 ConfigurationChangeListener<HTTPAccessLogPublisherCfg> listener) { 913 impl.registerChangeListener(listener); 914 } 915 916 917 918 /** {@inheritDoc} */ 919 public void removeHTTPAccessChangeListener( 920 ConfigurationChangeListener<HTTPAccessLogPublisherCfg> listener) { 921 impl.deregisterChangeListener(listener); 922 } 923 /** {@inheritDoc} */ 924 public void addChangeListener( 925 ConfigurationChangeListener<LogPublisherCfg> listener) { 926 impl.registerChangeListener(listener); 927 } 928 929 930 931 /** {@inheritDoc} */ 932 public void removeChangeListener( 933 ConfigurationChangeListener<LogPublisherCfg> listener) { 934 impl.deregisterChangeListener(listener); 935 } 936 937 938 939 /** {@inheritDoc} */ 940 public boolean isAsynchronous() { 941 return pAsynchronous; 942 } 943 944 945 946 /** {@inheritDoc} */ 947 public boolean isAutoFlush() { 948 return pAutoFlush; 949 } 950 951 952 953 /** {@inheritDoc} */ 954 public String getCsvDelimiterChar() { 955 return pCsvDelimiterChar; 956 } 957 958 959 960 /** {@inheritDoc} */ 961 public String getCsvEolSymbols() { 962 return pCsvEolSymbols; 963 } 964 965 966 967 /** {@inheritDoc} */ 968 public String getCsvQuoteChar() { 969 return pCsvQuoteChar; 970 } 971 972 973 974 /** {@inheritDoc} */ 975 public boolean isEnabled() { 976 return pEnabled; 977 } 978 979 980 981 /** {@inheritDoc} */ 982 public String getJavaClass() { 983 return pJavaClass; 984 } 985 986 987 988 /** {@inheritDoc} */ 989 public String getKeyStoreFile() { 990 return pKeyStoreFile; 991 } 992 993 994 995 /** {@inheritDoc} */ 996 public String getKeyStorePinFile() { 997 return pKeyStorePinFile; 998 } 999 1000 1001 1002 /** {@inheritDoc} */ 1003 public String getLogDirectory() { 1004 return pLogDirectory; 1005 } 1006 1007 1008 1009 /** {@inheritDoc} */ 1010 public SortedSet<String> getRetentionPolicy() { 1011 return pRetentionPolicy; 1012 } 1013 1014 1015 1016 /** 1017 * {@inheritDoc} 1018 */ 1019 public SortedSet<DN> getRetentionPolicyDNs() { 1020 SortedSet<String> values = getRetentionPolicy(); 1021 SortedSet<DN> dnValues = new TreeSet<DN>(); 1022 for (String value : values) { 1023 DN dn = INSTANCE.getRetentionPolicyPropertyDefinition().getChildDN(value); 1024 dnValues.add(dn); 1025 } 1026 return dnValues; 1027 } 1028 1029 1030 1031 /** {@inheritDoc} */ 1032 public SortedSet<String> getRotationPolicy() { 1033 return pRotationPolicy; 1034 } 1035 1036 1037 1038 /** 1039 * {@inheritDoc} 1040 */ 1041 public SortedSet<DN> getRotationPolicyDNs() { 1042 SortedSet<String> values = getRotationPolicy(); 1043 SortedSet<DN> dnValues = new TreeSet<DN>(); 1044 for (String value : values) { 1045 DN dn = INSTANCE.getRotationPolicyPropertyDefinition().getChildDN(value); 1046 dnValues.add(dn); 1047 } 1048 return dnValues; 1049 } 1050 1051 1052 1053 /** {@inheritDoc} */ 1054 public long getSignatureTimeInterval() { 1055 return pSignatureTimeInterval; 1056 } 1057 1058 1059 1060 /** {@inheritDoc} */ 1061 public boolean isTamperEvident() { 1062 return pTamperEvident; 1063 } 1064 1065 1066 1067 /** {@inheritDoc} */ 1068 public Class<? extends CsvFileHTTPAccessLogPublisherCfg> configurationClass() { 1069 return CsvFileHTTPAccessLogPublisherCfg.class; 1070 } 1071 1072 1073 1074 /** {@inheritDoc} */ 1075 public DN dn() { 1076 return impl.getDN(); 1077 } 1078 1079 1080 1081 /** {@inheritDoc} */ 1082 public String toString() { 1083 return impl.toString(); 1084 } 1085 } 1086}