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