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