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