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
010 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
011 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
012 * See the License for the specific language governing permissions
013 * and limitations under the License.
014 *
015 * When distributing Covered Code, include this CDDL HEADER in each
016 * file and include the License file at
017 * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
018 * add the following below this CDDL HEADER, with the fields enclosed
019 * by brackets "[]" replaced with your own identifying information:
020 * Portions Copyright [yyyy] [name of copyright owner]
021 *
022 * CDDL HEADER END
023 *
024 *
025 * Copyright 2008 Sun Microsystems, Inc.
026 */
027 package org.opends.server.admin.std.meta;
028
029
030
031 import java.util.Collection;
032 import java.util.SortedSet;
033 import org.opends.server.admin.AdministratorAction;
034 import org.opends.server.admin.BooleanPropertyDefinition;
035 import org.opends.server.admin.ClassPropertyDefinition;
036 import org.opends.server.admin.client.AuthorizationException;
037 import org.opends.server.admin.client.CommunicationException;
038 import org.opends.server.admin.client.ConcurrentModificationException;
039 import org.opends.server.admin.client.ManagedObject;
040 import org.opends.server.admin.client.MissingMandatoryPropertiesException;
041 import org.opends.server.admin.client.OperationRejectedException;
042 import org.opends.server.admin.DefaultBehaviorProvider;
043 import org.opends.server.admin.DefinedDefaultBehaviorProvider;
044 import org.opends.server.admin.DurationPropertyDefinition;
045 import org.opends.server.admin.EnumPropertyDefinition;
046 import org.opends.server.admin.IntegerPropertyDefinition;
047 import org.opends.server.admin.ManagedObjectAlreadyExistsException;
048 import org.opends.server.admin.ManagedObjectDefinition;
049 import org.opends.server.admin.PropertyOption;
050 import org.opends.server.admin.PropertyProvider;
051 import org.opends.server.admin.server.ConfigurationChangeListener;
052 import org.opends.server.admin.server.ServerManagedObject;
053 import org.opends.server.admin.SizePropertyDefinition;
054 import org.opends.server.admin.std.client.FileSystemEntryCacheCfgClient;
055 import org.opends.server.admin.std.server.EntryCacheCfg;
056 import org.opends.server.admin.std.server.FileSystemEntryCacheCfg;
057 import org.opends.server.admin.StringPropertyDefinition;
058 import org.opends.server.admin.Tag;
059 import org.opends.server.admin.UndefinedDefaultBehaviorProvider;
060 import org.opends.server.types.DN;
061
062
063
064 /**
065 * An interface for querying the File System Entry Cache managed
066 * object definition meta information.
067 * <p>
068 * The File System Entry Cache is an entry cache implementation which
069 * uses a JE database to keep track of the entries.
070 */
071 public final class FileSystemEntryCacheCfgDefn extends ManagedObjectDefinition<FileSystemEntryCacheCfgClient, FileSystemEntryCacheCfg> {
072
073 // The singleton configuration definition instance.
074 private static final FileSystemEntryCacheCfgDefn INSTANCE = new FileSystemEntryCacheCfgDefn();
075
076
077
078 /**
079 * Defines the set of permissable values for the "cache-type" property.
080 * <p>
081 * Specifies the policy which should be used for purging entries
082 * from the cache.
083 */
084 public static enum CacheType {
085
086 /**
087 * FIFO based entry cache.
088 */
089 FIFO("fifo"),
090
091
092
093 /**
094 * LRU based entry cache.
095 */
096 LRU("lru");
097
098
099
100 // String representation of the value.
101 private final String name;
102
103
104
105 // Private constructor.
106 private CacheType(String name) { this.name = name; }
107
108
109
110 /**
111 * {@inheritDoc}
112 */
113 public String toString() { return name; }
114
115 }
116
117
118
119 // The "cache-directory" property definition.
120 private static final StringPropertyDefinition PD_CACHE_DIRECTORY;
121
122
123
124 // The "cache-type" property definition.
125 private static final EnumPropertyDefinition<CacheType> PD_CACHE_TYPE;
126
127
128
129 // The "compact-encoding" property definition.
130 private static final BooleanPropertyDefinition PD_COMPACT_ENCODING;
131
132
133
134 // The "db-cache-percent" property definition.
135 private static final IntegerPropertyDefinition PD_DB_CACHE_PERCENT;
136
137
138
139 // The "db-cache-size" property definition.
140 private static final SizePropertyDefinition PD_DB_CACHE_SIZE;
141
142
143
144 // The "exclude-filter" property definition.
145 private static final StringPropertyDefinition PD_EXCLUDE_FILTER;
146
147
148
149 // The "include-filter" property definition.
150 private static final StringPropertyDefinition PD_INCLUDE_FILTER;
151
152
153
154 // The "java-class" property definition.
155 private static final ClassPropertyDefinition PD_JAVA_CLASS;
156
157
158
159 // The "je-property" property definition.
160 private static final StringPropertyDefinition PD_JE_PROPERTY;
161
162
163
164 // The "lock-timeout" property definition.
165 private static final DurationPropertyDefinition PD_LOCK_TIMEOUT;
166
167
168
169 // The "max-entries" property definition.
170 private static final IntegerPropertyDefinition PD_MAX_ENTRIES;
171
172
173
174 // The "max-memory-size" property definition.
175 private static final SizePropertyDefinition PD_MAX_MEMORY_SIZE;
176
177
178
179 // The "persistent-cache" property definition.
180 private static final BooleanPropertyDefinition PD_PERSISTENT_CACHE;
181
182
183
184 // Build the "cache-directory" property definition.
185 static {
186 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "cache-directory");
187 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "cache-directory"));
188 DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("/tmp/OpenDS.FSCache");
189 builder.setDefaultBehaviorProvider(provider);
190 PD_CACHE_DIRECTORY = builder.getInstance();
191 INSTANCE.registerPropertyDefinition(PD_CACHE_DIRECTORY);
192 }
193
194
195
196 // Build the "cache-type" property definition.
197 static {
198 EnumPropertyDefinition.Builder<CacheType> builder = EnumPropertyDefinition.createBuilder(INSTANCE, "cache-type");
199 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "cache-type"));
200 DefaultBehaviorProvider<CacheType> provider = new DefinedDefaultBehaviorProvider<CacheType>("fifo");
201 builder.setDefaultBehaviorProvider(provider);
202 builder.setEnumClass(CacheType.class);
203 PD_CACHE_TYPE = builder.getInstance();
204 INSTANCE.registerPropertyDefinition(PD_CACHE_TYPE);
205 }
206
207
208
209 // Build the "compact-encoding" property definition.
210 static {
211 BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "compact-encoding");
212 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "compact-encoding"));
213 DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("true");
214 builder.setDefaultBehaviorProvider(provider);
215 PD_COMPACT_ENCODING = builder.getInstance();
216 INSTANCE.registerPropertyDefinition(PD_COMPACT_ENCODING);
217 }
218
219
220
221 // Build the "db-cache-percent" property definition.
222 static {
223 IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "db-cache-percent");
224 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "db-cache-percent"));
225 DefaultBehaviorProvider<Integer> provider = new DefinedDefaultBehaviorProvider<Integer>("1");
226 builder.setDefaultBehaviorProvider(provider);
227 builder.setUpperLimit(90);
228 builder.setLowerLimit(0);
229 PD_DB_CACHE_PERCENT = builder.getInstance();
230 INSTANCE.registerPropertyDefinition(PD_DB_CACHE_PERCENT);
231 }
232
233
234
235 // Build the "db-cache-size" property definition.
236 static {
237 SizePropertyDefinition.Builder builder = SizePropertyDefinition.createBuilder(INSTANCE, "db-cache-size");
238 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "db-cache-size"));
239 DefaultBehaviorProvider<Long> provider = new DefinedDefaultBehaviorProvider<Long>("0b");
240 builder.setDefaultBehaviorProvider(provider);
241 PD_DB_CACHE_SIZE = builder.getInstance();
242 INSTANCE.registerPropertyDefinition(PD_DB_CACHE_SIZE);
243 }
244
245
246
247 // Build the "exclude-filter" property definition.
248 static {
249 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "exclude-filter");
250 builder.setOption(PropertyOption.MULTI_VALUED);
251 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "exclude-filter"));
252 builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
253 PD_EXCLUDE_FILTER = builder.getInstance();
254 INSTANCE.registerPropertyDefinition(PD_EXCLUDE_FILTER);
255 }
256
257
258
259 // Build the "include-filter" property definition.
260 static {
261 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "include-filter");
262 builder.setOption(PropertyOption.MULTI_VALUED);
263 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "include-filter"));
264 builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
265 PD_INCLUDE_FILTER = builder.getInstance();
266 INSTANCE.registerPropertyDefinition(PD_INCLUDE_FILTER);
267 }
268
269
270
271 // Build the "java-class" property definition.
272 static {
273 ClassPropertyDefinition.Builder builder = ClassPropertyDefinition.createBuilder(INSTANCE, "java-class");
274 builder.setOption(PropertyOption.MANDATORY);
275 builder.setOption(PropertyOption.ADVANCED);
276 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "java-class"));
277 DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("org.opends.server.extensions.FileSystemEntryCache");
278 builder.setDefaultBehaviorProvider(provider);
279 builder.addInstanceOf("org.opends.server.api.EntryCache");
280 PD_JAVA_CLASS = builder.getInstance();
281 INSTANCE.registerPropertyDefinition(PD_JAVA_CLASS);
282 }
283
284
285
286 // Build the "je-property" property definition.
287 static {
288 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "je-property");
289 builder.setOption(PropertyOption.MULTI_VALUED);
290 builder.setOption(PropertyOption.ADVANCED);
291 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "je-property"));
292 DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("je.env.isLocking=false");
293 builder.setDefaultBehaviorProvider(provider);
294 PD_JE_PROPERTY = builder.getInstance();
295 INSTANCE.registerPropertyDefinition(PD_JE_PROPERTY);
296 }
297
298
299
300 // Build the "lock-timeout" property definition.
301 static {
302 DurationPropertyDefinition.Builder builder = DurationPropertyDefinition.createBuilder(INSTANCE, "lock-timeout");
303 builder.setOption(PropertyOption.ADVANCED);
304 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "lock-timeout"));
305 DefaultBehaviorProvider<Long> provider = new DefinedDefaultBehaviorProvider<Long>("2000.0ms");
306 builder.setDefaultBehaviorProvider(provider);
307 builder.setAllowUnlimited(true);
308 builder.setBaseUnit("ms");
309 PD_LOCK_TIMEOUT = builder.getInstance();
310 INSTANCE.registerPropertyDefinition(PD_LOCK_TIMEOUT);
311 }
312
313
314
315 // Build the "max-entries" property definition.
316 static {
317 IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "max-entries");
318 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "max-entries"));
319 DefaultBehaviorProvider<Integer> provider = new DefinedDefaultBehaviorProvider<Integer>("2147483647");
320 builder.setDefaultBehaviorProvider(provider);
321 builder.setLowerLimit(0);
322 PD_MAX_ENTRIES = builder.getInstance();
323 INSTANCE.registerPropertyDefinition(PD_MAX_ENTRIES);
324 }
325
326
327
328 // Build the "max-memory-size" property definition.
329 static {
330 SizePropertyDefinition.Builder builder = SizePropertyDefinition.createBuilder(INSTANCE, "max-memory-size");
331 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "max-memory-size"));
332 DefaultBehaviorProvider<Long> provider = new DefinedDefaultBehaviorProvider<Long>("0b");
333 builder.setDefaultBehaviorProvider(provider);
334 PD_MAX_MEMORY_SIZE = builder.getInstance();
335 INSTANCE.registerPropertyDefinition(PD_MAX_MEMORY_SIZE);
336 }
337
338
339
340 // Build the "persistent-cache" property definition.
341 static {
342 BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "persistent-cache");
343 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "persistent-cache"));
344 DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("false");
345 builder.setDefaultBehaviorProvider(provider);
346 PD_PERSISTENT_CACHE = builder.getInstance();
347 INSTANCE.registerPropertyDefinition(PD_PERSISTENT_CACHE);
348 }
349
350
351
352 // Register the tags associated with this managed object definition.
353 static {
354 INSTANCE.registerTag(Tag.valueOf("database"));
355 }
356
357
358
359 /**
360 * Get the File System Entry Cache configuration definition
361 * singleton.
362 *
363 * @return Returns the File System Entry Cache configuration
364 * definition singleton.
365 */
366 public static FileSystemEntryCacheCfgDefn getInstance() {
367 return INSTANCE;
368 }
369
370
371
372 /**
373 * Private constructor.
374 */
375 private FileSystemEntryCacheCfgDefn() {
376 super("file-system-entry-cache", EntryCacheCfgDefn.getInstance());
377 }
378
379
380
381 /**
382 * {@inheritDoc}
383 */
384 public FileSystemEntryCacheCfgClient createClientConfiguration(
385 ManagedObject<? extends FileSystemEntryCacheCfgClient> impl) {
386 return new FileSystemEntryCacheCfgClientImpl(impl);
387 }
388
389
390
391 /**
392 * {@inheritDoc}
393 */
394 public FileSystemEntryCacheCfg createServerConfiguration(
395 ServerManagedObject<? extends FileSystemEntryCacheCfg> impl) {
396 return new FileSystemEntryCacheCfgServerImpl(impl);
397 }
398
399
400
401 /**
402 * {@inheritDoc}
403 */
404 public Class<FileSystemEntryCacheCfg> getServerConfigurationClass() {
405 return FileSystemEntryCacheCfg.class;
406 }
407
408
409
410 /**
411 * Get the "cache-directory" property definition.
412 * <p>
413 * Specifies the directory in which the JE environment should store
414 * the cache.
415 *
416 * @return Returns the "cache-directory" property definition.
417 */
418 public StringPropertyDefinition getCacheDirectoryPropertyDefinition() {
419 return PD_CACHE_DIRECTORY;
420 }
421
422
423
424 /**
425 * Get the "cache-level" property definition.
426 * <p>
427 * Specifies the cache level in the cache order if more than one
428 * instance of the cache is configured.
429 *
430 * @return Returns the "cache-level" property definition.
431 */
432 public IntegerPropertyDefinition getCacheLevelPropertyDefinition() {
433 return EntryCacheCfgDefn.getInstance().getCacheLevelPropertyDefinition();
434 }
435
436
437
438 /**
439 * Get the "cache-type" property definition.
440 * <p>
441 * Specifies the policy which should be used for purging entries
442 * from the cache.
443 *
444 * @return Returns the "cache-type" property definition.
445 */
446 public EnumPropertyDefinition<CacheType> getCacheTypePropertyDefinition() {
447 return PD_CACHE_TYPE;
448 }
449
450
451
452 /**
453 * Get the "compact-encoding" property definition.
454 * <p>
455 * Indicates whether the cache should use a compact form when
456 * encoding cache entries by compressing the attribute descriptions
457 * and object class sets.
458 * <p>
459 * Note that compression does not preserve user-supplied
460 * capitalization in the object class and attribute type names.
461 *
462 * @return Returns the "compact-encoding" property definition.
463 */
464 public BooleanPropertyDefinition getCompactEncodingPropertyDefinition() {
465 return PD_COMPACT_ENCODING;
466 }
467
468
469
470 /**
471 * Get the "db-cache-percent" property definition.
472 * <p>
473 * Specifies the maximum memory usage for the internal JE cache as a
474 * percentage of the total JVM memory.
475 *
476 * @return Returns the "db-cache-percent" property definition.
477 */
478 public IntegerPropertyDefinition getDBCachePercentPropertyDefinition() {
479 return PD_DB_CACHE_PERCENT;
480 }
481
482
483
484 /**
485 * Get the "db-cache-size" property definition.
486 * <p>
487 * Specifies the maximum JVM memory usage in bytes for the internal
488 * JE cache.
489 *
490 * @return Returns the "db-cache-size" property definition.
491 */
492 public SizePropertyDefinition getDBCacheSizePropertyDefinition() {
493 return PD_DB_CACHE_SIZE;
494 }
495
496
497
498 /**
499 * Get the "enabled" property definition.
500 * <p>
501 * Indicates whether the File System Entry Cache is enabled.
502 *
503 * @return Returns the "enabled" property definition.
504 */
505 public BooleanPropertyDefinition getEnabledPropertyDefinition() {
506 return EntryCacheCfgDefn.getInstance().getEnabledPropertyDefinition();
507 }
508
509
510
511 /**
512 * Get the "exclude-filter" property definition.
513 * <p>
514 * The set of filters that define the entries that should be
515 * excluded from the cache.
516 *
517 * @return Returns the "exclude-filter" property definition.
518 */
519 public StringPropertyDefinition getExcludeFilterPropertyDefinition() {
520 return PD_EXCLUDE_FILTER;
521 }
522
523
524
525 /**
526 * Get the "include-filter" property definition.
527 * <p>
528 * The set of filters that define the entries that should be
529 * included in the cache.
530 *
531 * @return Returns the "include-filter" property definition.
532 */
533 public StringPropertyDefinition getIncludeFilterPropertyDefinition() {
534 return PD_INCLUDE_FILTER;
535 }
536
537
538
539 /**
540 * Get the "java-class" property definition.
541 * <p>
542 * Specifies the fully-qualified name of the Java class that
543 * provides the File System Entry Cache implementation.
544 *
545 * @return Returns the "java-class" property definition.
546 */
547 public ClassPropertyDefinition getJavaClassPropertyDefinition() {
548 return PD_JAVA_CLASS;
549 }
550
551
552
553 /**
554 * Get the "je-property" property definition.
555 * <p>
556 * Specifies the environment properties for the Berkeley DB Java
557 * Edition database providing the backend for this entry cache.
558 * <p>
559 * Any Berkeley DB Java Edition property can be specified using the
560 * following form: property-name=property-value. Refer to the OpenDS
561 * documentation for further information on related properties, their
562 * implications and range values. The definitive identification of
563 * all the property parameters available in the example.properties
564 * file in the Berkeley DB Java Edition distribution.
565 *
566 * @return Returns the "je-property" property definition.
567 */
568 public StringPropertyDefinition getJEPropertyPropertyDefinition() {
569 return PD_JE_PROPERTY;
570 }
571
572
573
574 /**
575 * Get the "lock-timeout" property definition.
576 * <p>
577 * The length of time to wait while attempting to acquire a read or
578 * write lock.
579 *
580 * @return Returns the "lock-timeout" property definition.
581 */
582 public DurationPropertyDefinition getLockTimeoutPropertyDefinition() {
583 return PD_LOCK_TIMEOUT;
584 }
585
586
587
588 /**
589 * Get the "max-entries" property definition.
590 * <p>
591 * The maximum number of entries allowed in the cache.
592 *
593 * @return Returns the "max-entries" property definition.
594 */
595 public IntegerPropertyDefinition getMaxEntriesPropertyDefinition() {
596 return PD_MAX_ENTRIES;
597 }
598
599
600
601 /**
602 * Get the "max-memory-size" property definition.
603 * <p>
604 * The maximum size of the entry cache in bytes.
605 *
606 * @return Returns the "max-memory-size" property definition.
607 */
608 public SizePropertyDefinition getMaxMemorySizePropertyDefinition() {
609 return PD_MAX_MEMORY_SIZE;
610 }
611
612
613
614 /**
615 * Get the "persistent-cache" property definition.
616 * <p>
617 * Specifies whether the cache should persist across restarts.
618 *
619 * @return Returns the "persistent-cache" property definition.
620 */
621 public BooleanPropertyDefinition getPersistentCachePropertyDefinition() {
622 return PD_PERSISTENT_CACHE;
623 }
624
625
626
627 /**
628 * Managed object client implementation.
629 */
630 private static class FileSystemEntryCacheCfgClientImpl implements
631 FileSystemEntryCacheCfgClient {
632
633 // Private implementation.
634 private ManagedObject<? extends FileSystemEntryCacheCfgClient> impl;
635
636
637
638 // Private constructor.
639 private FileSystemEntryCacheCfgClientImpl(
640 ManagedObject<? extends FileSystemEntryCacheCfgClient> impl) {
641 this.impl = impl;
642 }
643
644
645
646 /**
647 * {@inheritDoc}
648 */
649 public String getCacheDirectory() {
650 return impl.getPropertyValue(INSTANCE.getCacheDirectoryPropertyDefinition());
651 }
652
653
654
655 /**
656 * {@inheritDoc}
657 */
658 public void setCacheDirectory(String value) {
659 impl.setPropertyValue(INSTANCE.getCacheDirectoryPropertyDefinition(), value);
660 }
661
662
663
664 /**
665 * {@inheritDoc}
666 */
667 public Integer getCacheLevel() {
668 return impl.getPropertyValue(INSTANCE.getCacheLevelPropertyDefinition());
669 }
670
671
672
673 /**
674 * {@inheritDoc}
675 */
676 public void setCacheLevel(int value) {
677 impl.setPropertyValue(INSTANCE.getCacheLevelPropertyDefinition(), value);
678 }
679
680
681
682 /**
683 * {@inheritDoc}
684 */
685 public CacheType getCacheType() {
686 return impl.getPropertyValue(INSTANCE.getCacheTypePropertyDefinition());
687 }
688
689
690
691 /**
692 * {@inheritDoc}
693 */
694 public void setCacheType(CacheType value) {
695 impl.setPropertyValue(INSTANCE.getCacheTypePropertyDefinition(), value);
696 }
697
698
699
700 /**
701 * {@inheritDoc}
702 */
703 public boolean isCompactEncoding() {
704 return impl.getPropertyValue(INSTANCE.getCompactEncodingPropertyDefinition());
705 }
706
707
708
709 /**
710 * {@inheritDoc}
711 */
712 public void setCompactEncoding(Boolean value) {
713 impl.setPropertyValue(INSTANCE.getCompactEncodingPropertyDefinition(), value);
714 }
715
716
717
718 /**
719 * {@inheritDoc}
720 */
721 public int getDBCachePercent() {
722 return impl.getPropertyValue(INSTANCE.getDBCachePercentPropertyDefinition());
723 }
724
725
726
727 /**
728 * {@inheritDoc}
729 */
730 public void setDBCachePercent(Integer value) {
731 impl.setPropertyValue(INSTANCE.getDBCachePercentPropertyDefinition(), value);
732 }
733
734
735
736 /**
737 * {@inheritDoc}
738 */
739 public long getDBCacheSize() {
740 return impl.getPropertyValue(INSTANCE.getDBCacheSizePropertyDefinition());
741 }
742
743
744
745 /**
746 * {@inheritDoc}
747 */
748 public void setDBCacheSize(Long value) {
749 impl.setPropertyValue(INSTANCE.getDBCacheSizePropertyDefinition(), value);
750 }
751
752
753
754 /**
755 * {@inheritDoc}
756 */
757 public Boolean isEnabled() {
758 return impl.getPropertyValue(INSTANCE.getEnabledPropertyDefinition());
759 }
760
761
762
763 /**
764 * {@inheritDoc}
765 */
766 public void setEnabled(boolean value) {
767 impl.setPropertyValue(INSTANCE.getEnabledPropertyDefinition(), value);
768 }
769
770
771
772 /**
773 * {@inheritDoc}
774 */
775 public SortedSet<String> getExcludeFilter() {
776 return impl.getPropertyValues(INSTANCE.getExcludeFilterPropertyDefinition());
777 }
778
779
780
781 /**
782 * {@inheritDoc}
783 */
784 public void setExcludeFilter(Collection<String> values) {
785 impl.setPropertyValues(INSTANCE.getExcludeFilterPropertyDefinition(), values);
786 }
787
788
789
790 /**
791 * {@inheritDoc}
792 */
793 public SortedSet<String> getIncludeFilter() {
794 return impl.getPropertyValues(INSTANCE.getIncludeFilterPropertyDefinition());
795 }
796
797
798
799 /**
800 * {@inheritDoc}
801 */
802 public void setIncludeFilter(Collection<String> values) {
803 impl.setPropertyValues(INSTANCE.getIncludeFilterPropertyDefinition(), values);
804 }
805
806
807
808 /**
809 * {@inheritDoc}
810 */
811 public String getJavaClass() {
812 return impl.getPropertyValue(INSTANCE.getJavaClassPropertyDefinition());
813 }
814
815
816
817 /**
818 * {@inheritDoc}
819 */
820 public void setJavaClass(String value) {
821 impl.setPropertyValue(INSTANCE.getJavaClassPropertyDefinition(), value);
822 }
823
824
825
826 /**
827 * {@inheritDoc}
828 */
829 public SortedSet<String> getJEProperty() {
830 return impl.getPropertyValues(INSTANCE.getJEPropertyPropertyDefinition());
831 }
832
833
834
835 /**
836 * {@inheritDoc}
837 */
838 public void setJEProperty(Collection<String> values) {
839 impl.setPropertyValues(INSTANCE.getJEPropertyPropertyDefinition(), values);
840 }
841
842
843
844 /**
845 * {@inheritDoc}
846 */
847 public long getLockTimeout() {
848 return impl.getPropertyValue(INSTANCE.getLockTimeoutPropertyDefinition());
849 }
850
851
852
853 /**
854 * {@inheritDoc}
855 */
856 public void setLockTimeout(Long value) {
857 impl.setPropertyValue(INSTANCE.getLockTimeoutPropertyDefinition(), value);
858 }
859
860
861
862 /**
863 * {@inheritDoc}
864 */
865 public int getMaxEntries() {
866 return impl.getPropertyValue(INSTANCE.getMaxEntriesPropertyDefinition());
867 }
868
869
870
871 /**
872 * {@inheritDoc}
873 */
874 public void setMaxEntries(Integer value) {
875 impl.setPropertyValue(INSTANCE.getMaxEntriesPropertyDefinition(), value);
876 }
877
878
879
880 /**
881 * {@inheritDoc}
882 */
883 public long getMaxMemorySize() {
884 return impl.getPropertyValue(INSTANCE.getMaxMemorySizePropertyDefinition());
885 }
886
887
888
889 /**
890 * {@inheritDoc}
891 */
892 public void setMaxMemorySize(Long value) {
893 impl.setPropertyValue(INSTANCE.getMaxMemorySizePropertyDefinition(), value);
894 }
895
896
897
898 /**
899 * {@inheritDoc}
900 */
901 public boolean isPersistentCache() {
902 return impl.getPropertyValue(INSTANCE.getPersistentCachePropertyDefinition());
903 }
904
905
906
907 /**
908 * {@inheritDoc}
909 */
910 public void setPersistentCache(Boolean value) {
911 impl.setPropertyValue(INSTANCE.getPersistentCachePropertyDefinition(), value);
912 }
913
914
915
916 /**
917 * {@inheritDoc}
918 */
919 public ManagedObjectDefinition<? extends FileSystemEntryCacheCfgClient, ? extends FileSystemEntryCacheCfg> definition() {
920 return INSTANCE;
921 }
922
923
924
925 /**
926 * {@inheritDoc}
927 */
928 public PropertyProvider properties() {
929 return impl;
930 }
931
932
933
934 /**
935 * {@inheritDoc}
936 */
937 public void commit() throws ManagedObjectAlreadyExistsException,
938 MissingMandatoryPropertiesException, ConcurrentModificationException,
939 OperationRejectedException, AuthorizationException,
940 CommunicationException {
941 impl.commit();
942 }
943
944 }
945
946
947
948 /**
949 * Managed object server implementation.
950 */
951 private static class FileSystemEntryCacheCfgServerImpl implements
952 FileSystemEntryCacheCfg {
953
954 // Private implementation.
955 private ServerManagedObject<? extends FileSystemEntryCacheCfg> impl;
956
957 // The value of the "cache-directory" property.
958 private final String pCacheDirectory;
959
960 // The value of the "cache-level" property.
961 private final int pCacheLevel;
962
963 // The value of the "cache-type" property.
964 private final CacheType pCacheType;
965
966 // The value of the "compact-encoding" property.
967 private final boolean pCompactEncoding;
968
969 // The value of the "db-cache-percent" property.
970 private final int pDBCachePercent;
971
972 // The value of the "db-cache-size" property.
973 private final long pDBCacheSize;
974
975 // The value of the "enabled" property.
976 private final boolean pEnabled;
977
978 // The value of the "exclude-filter" property.
979 private final SortedSet<String> pExcludeFilter;
980
981 // The value of the "include-filter" property.
982 private final SortedSet<String> pIncludeFilter;
983
984 // The value of the "java-class" property.
985 private final String pJavaClass;
986
987 // The value of the "je-property" property.
988 private final SortedSet<String> pJEProperty;
989
990 // The value of the "lock-timeout" property.
991 private final long pLockTimeout;
992
993 // The value of the "max-entries" property.
994 private final int pMaxEntries;
995
996 // The value of the "max-memory-size" property.
997 private final long pMaxMemorySize;
998
999 // The value of the "persistent-cache" property.
1000 private final boolean pPersistentCache;
1001
1002
1003
1004 // Private constructor.
1005 private FileSystemEntryCacheCfgServerImpl(ServerManagedObject<? extends FileSystemEntryCacheCfg> impl) {
1006 this.impl = impl;
1007 this.pCacheDirectory = impl.getPropertyValue(INSTANCE.getCacheDirectoryPropertyDefinition());
1008 this.pCacheLevel = impl.getPropertyValue(INSTANCE.getCacheLevelPropertyDefinition());
1009 this.pCacheType = impl.getPropertyValue(INSTANCE.getCacheTypePropertyDefinition());
1010 this.pCompactEncoding = impl.getPropertyValue(INSTANCE.getCompactEncodingPropertyDefinition());
1011 this.pDBCachePercent = impl.getPropertyValue(INSTANCE.getDBCachePercentPropertyDefinition());
1012 this.pDBCacheSize = impl.getPropertyValue(INSTANCE.getDBCacheSizePropertyDefinition());
1013 this.pEnabled = impl.getPropertyValue(INSTANCE.getEnabledPropertyDefinition());
1014 this.pExcludeFilter = impl.getPropertyValues(INSTANCE.getExcludeFilterPropertyDefinition());
1015 this.pIncludeFilter = impl.getPropertyValues(INSTANCE.getIncludeFilterPropertyDefinition());
1016 this.pJavaClass = impl.getPropertyValue(INSTANCE.getJavaClassPropertyDefinition());
1017 this.pJEProperty = impl.getPropertyValues(INSTANCE.getJEPropertyPropertyDefinition());
1018 this.pLockTimeout = impl.getPropertyValue(INSTANCE.getLockTimeoutPropertyDefinition());
1019 this.pMaxEntries = impl.getPropertyValue(INSTANCE.getMaxEntriesPropertyDefinition());
1020 this.pMaxMemorySize = impl.getPropertyValue(INSTANCE.getMaxMemorySizePropertyDefinition());
1021 this.pPersistentCache = impl.getPropertyValue(INSTANCE.getPersistentCachePropertyDefinition());
1022 }
1023
1024
1025
1026 /**
1027 * {@inheritDoc}
1028 */
1029 public void addFileSystemChangeListener(
1030 ConfigurationChangeListener<FileSystemEntryCacheCfg> listener) {
1031 impl.registerChangeListener(listener);
1032 }
1033
1034
1035
1036 /**
1037 * {@inheritDoc}
1038 */
1039 public void removeFileSystemChangeListener(
1040 ConfigurationChangeListener<FileSystemEntryCacheCfg> listener) {
1041 impl.deregisterChangeListener(listener);
1042 }
1043 /**
1044 * {@inheritDoc}
1045 */
1046 public void addChangeListener(
1047 ConfigurationChangeListener<EntryCacheCfg> listener) {
1048 impl.registerChangeListener(listener);
1049 }
1050
1051
1052
1053 /**
1054 * {@inheritDoc}
1055 */
1056 public void removeChangeListener(
1057 ConfigurationChangeListener<EntryCacheCfg> listener) {
1058 impl.deregisterChangeListener(listener);
1059 }
1060
1061
1062
1063 /**
1064 * {@inheritDoc}
1065 */
1066 public String getCacheDirectory() {
1067 return pCacheDirectory;
1068 }
1069
1070
1071
1072 /**
1073 * {@inheritDoc}
1074 */
1075 public int getCacheLevel() {
1076 return pCacheLevel;
1077 }
1078
1079
1080
1081 /**
1082 * {@inheritDoc}
1083 */
1084 public CacheType getCacheType() {
1085 return pCacheType;
1086 }
1087
1088
1089
1090 /**
1091 * {@inheritDoc}
1092 */
1093 public boolean isCompactEncoding() {
1094 return pCompactEncoding;
1095 }
1096
1097
1098
1099 /**
1100 * {@inheritDoc}
1101 */
1102 public int getDBCachePercent() {
1103 return pDBCachePercent;
1104 }
1105
1106
1107
1108 /**
1109 * {@inheritDoc}
1110 */
1111 public long getDBCacheSize() {
1112 return pDBCacheSize;
1113 }
1114
1115
1116
1117 /**
1118 * {@inheritDoc}
1119 */
1120 public boolean isEnabled() {
1121 return pEnabled;
1122 }
1123
1124
1125
1126 /**
1127 * {@inheritDoc}
1128 */
1129 public SortedSet<String> getExcludeFilter() {
1130 return pExcludeFilter;
1131 }
1132
1133
1134
1135 /**
1136 * {@inheritDoc}
1137 */
1138 public SortedSet<String> getIncludeFilter() {
1139 return pIncludeFilter;
1140 }
1141
1142
1143
1144 /**
1145 * {@inheritDoc}
1146 */
1147 public String getJavaClass() {
1148 return pJavaClass;
1149 }
1150
1151
1152
1153 /**
1154 * {@inheritDoc}
1155 */
1156 public SortedSet<String> getJEProperty() {
1157 return pJEProperty;
1158 }
1159
1160
1161
1162 /**
1163 * {@inheritDoc}
1164 */
1165 public long getLockTimeout() {
1166 return pLockTimeout;
1167 }
1168
1169
1170
1171 /**
1172 * {@inheritDoc}
1173 */
1174 public int getMaxEntries() {
1175 return pMaxEntries;
1176 }
1177
1178
1179
1180 /**
1181 * {@inheritDoc}
1182 */
1183 public long getMaxMemorySize() {
1184 return pMaxMemorySize;
1185 }
1186
1187
1188
1189 /**
1190 * {@inheritDoc}
1191 */
1192 public boolean isPersistentCache() {
1193 return pPersistentCache;
1194 }
1195
1196
1197
1198 /**
1199 * {@inheritDoc}
1200 */
1201 public Class<? extends FileSystemEntryCacheCfg> configurationClass() {
1202 return FileSystemEntryCacheCfg.class;
1203 }
1204
1205
1206
1207 /**
1208 * {@inheritDoc}
1209 */
1210 public DN dn() {
1211 return impl.getDN();
1212 }
1213
1214 }
1215 }