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.AliasDefaultBehaviorProvider;
035    import org.opends.server.admin.BooleanPropertyDefinition;
036    import org.opends.server.admin.ClassPropertyDefinition;
037    import org.opends.server.admin.client.AuthorizationException;
038    import org.opends.server.admin.client.CommunicationException;
039    import org.opends.server.admin.client.ConcurrentModificationException;
040    import org.opends.server.admin.client.ManagedObject;
041    import org.opends.server.admin.client.MissingMandatoryPropertiesException;
042    import org.opends.server.admin.client.OperationRejectedException;
043    import org.opends.server.admin.DefaultBehaviorProvider;
044    import org.opends.server.admin.DefinedDefaultBehaviorProvider;
045    import org.opends.server.admin.DNPropertyDefinition;
046    import org.opends.server.admin.EnumPropertyDefinition;
047    import org.opends.server.admin.ManagedObjectAlreadyExistsException;
048    import org.opends.server.admin.ManagedObjectDefinition;
049    import org.opends.server.admin.ManagedObjectOption;
050    import org.opends.server.admin.PropertyIsReadOnlyException;
051    import org.opends.server.admin.PropertyOption;
052    import org.opends.server.admin.PropertyProvider;
053    import org.opends.server.admin.server.ConfigurationChangeListener;
054    import org.opends.server.admin.server.ServerManagedObject;
055    import org.opends.server.admin.std.client.TrustStoreBackendCfgClient;
056    import org.opends.server.admin.std.meta.BackendCfgDefn.WritabilityMode;
057    import org.opends.server.admin.std.server.BackendCfg;
058    import org.opends.server.admin.std.server.TrustStoreBackendCfg;
059    import org.opends.server.admin.StringPropertyDefinition;
060    import org.opends.server.admin.Tag;
061    import org.opends.server.admin.UndefinedDefaultBehaviorProvider;
062    import org.opends.server.types.DN;
063    
064    
065    
066    /**
067     * An interface for querying the Trust Store Backend managed object
068     * definition meta information.
069     * <p>
070     * The Trust Store Backend provides an LDAP view of a file-based trust
071     * store. It is used by the administrative cryptographic framework.
072     */
073    public final class TrustStoreBackendCfgDefn extends ManagedObjectDefinition<TrustStoreBackendCfgClient, TrustStoreBackendCfg> {
074    
075      // The singleton configuration definition instance.
076      private static final TrustStoreBackendCfgDefn INSTANCE = new TrustStoreBackendCfgDefn();
077    
078    
079    
080      // The "java-class" property definition.
081      private static final ClassPropertyDefinition PD_JAVA_CLASS;
082    
083    
084    
085      // The "trust-store-file" property definition.
086      private static final StringPropertyDefinition PD_TRUST_STORE_FILE;
087    
088    
089    
090      // The "trust-store-pin" property definition.
091      private static final StringPropertyDefinition PD_TRUST_STORE_PIN;
092    
093    
094    
095      // The "trust-store-pin-environment-variable" property definition.
096      private static final StringPropertyDefinition PD_TRUST_STORE_PIN_ENVIRONMENT_VARIABLE;
097    
098    
099    
100      // The "trust-store-pin-file" property definition.
101      private static final StringPropertyDefinition PD_TRUST_STORE_PIN_FILE;
102    
103    
104    
105      // The "trust-store-pin-property" property definition.
106      private static final StringPropertyDefinition PD_TRUST_STORE_PIN_PROPERTY;
107    
108    
109    
110      // The "trust-store-type" property definition.
111      private static final StringPropertyDefinition PD_TRUST_STORE_TYPE;
112    
113    
114    
115      // The "writability-mode" property definition.
116      private static final EnumPropertyDefinition<WritabilityMode> PD_WRITABILITY_MODE;
117    
118    
119    
120      // Build the "java-class" property definition.
121      static {
122          ClassPropertyDefinition.Builder builder = ClassPropertyDefinition.createBuilder(INSTANCE, "java-class");
123          builder.setOption(PropertyOption.MANDATORY);
124          builder.setOption(PropertyOption.ADVANCED);
125          builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "java-class"));
126          DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("org.opends.server.backends.TrustStoreBackend");
127          builder.setDefaultBehaviorProvider(provider);
128          builder.addInstanceOf("org.opends.server.api.Backend");
129          PD_JAVA_CLASS = builder.getInstance();
130          INSTANCE.registerPropertyDefinition(PD_JAVA_CLASS);
131      }
132    
133    
134    
135      // Build the "trust-store-file" property definition.
136      static {
137          StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "trust-store-file");
138          builder.setOption(PropertyOption.MANDATORY);
139          builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "trust-store-file"));
140          DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("config/ads-truststore");
141          builder.setDefaultBehaviorProvider(provider);
142          PD_TRUST_STORE_FILE = builder.getInstance();
143          INSTANCE.registerPropertyDefinition(PD_TRUST_STORE_FILE);
144      }
145    
146    
147    
148      // Build the "trust-store-pin" property definition.
149      static {
150          StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "trust-store-pin");
151          builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "trust-store-pin"));
152          builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
153          PD_TRUST_STORE_PIN = builder.getInstance();
154          INSTANCE.registerPropertyDefinition(PD_TRUST_STORE_PIN);
155      }
156    
157    
158    
159      // Build the "trust-store-pin-environment-variable" property definition.
160      static {
161          StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "trust-store-pin-environment-variable");
162          builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "trust-store-pin-environment-variable"));
163          builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
164          PD_TRUST_STORE_PIN_ENVIRONMENT_VARIABLE = builder.getInstance();
165          INSTANCE.registerPropertyDefinition(PD_TRUST_STORE_PIN_ENVIRONMENT_VARIABLE);
166      }
167    
168    
169    
170      // Build the "trust-store-pin-file" property definition.
171      static {
172          StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "trust-store-pin-file");
173          builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "trust-store-pin-file"));
174          builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
175          PD_TRUST_STORE_PIN_FILE = builder.getInstance();
176          INSTANCE.registerPropertyDefinition(PD_TRUST_STORE_PIN_FILE);
177      }
178    
179    
180    
181      // Build the "trust-store-pin-property" property definition.
182      static {
183          StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "trust-store-pin-property");
184          builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "trust-store-pin-property"));
185          builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
186          PD_TRUST_STORE_PIN_PROPERTY = builder.getInstance();
187          INSTANCE.registerPropertyDefinition(PD_TRUST_STORE_PIN_PROPERTY);
188      }
189    
190    
191    
192      // Build the "trust-store-type" property definition.
193      static {
194          StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "trust-store-type");
195          builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "trust-store-type"));
196          builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "trust-store-type"));
197          PD_TRUST_STORE_TYPE = builder.getInstance();
198          INSTANCE.registerPropertyDefinition(PD_TRUST_STORE_TYPE);
199      }
200    
201    
202    
203      // Build the "writability-mode" property definition.
204      static {
205          EnumPropertyDefinition.Builder<WritabilityMode> builder = EnumPropertyDefinition.createBuilder(INSTANCE, "writability-mode");
206          builder.setOption(PropertyOption.MANDATORY);
207          builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "writability-mode"));
208          DefaultBehaviorProvider<WritabilityMode> provider = new DefinedDefaultBehaviorProvider<WritabilityMode>("enabled");
209          builder.setDefaultBehaviorProvider(provider);
210          builder.setEnumClass(WritabilityMode.class);
211          PD_WRITABILITY_MODE = builder.getInstance();
212          INSTANCE.registerPropertyDefinition(PD_WRITABILITY_MODE);
213      }
214    
215    
216    
217      // Register the options associated with this managed object definition.
218      static {
219        INSTANCE.registerOption(ManagedObjectOption.ADVANCED);
220      }
221    
222    
223    
224      // Register the tags associated with this managed object definition.
225      static {
226        INSTANCE.registerTag(Tag.valueOf("database"));
227      }
228    
229    
230    
231      /**
232       * Get the Trust Store Backend configuration definition singleton.
233       *
234       * @return Returns the Trust Store Backend configuration definition
235       *         singleton.
236       */
237      public static TrustStoreBackendCfgDefn getInstance() {
238        return INSTANCE;
239      }
240    
241    
242    
243      /**
244       * Private constructor.
245       */
246      private TrustStoreBackendCfgDefn() {
247        super("trust-store-backend", BackendCfgDefn.getInstance());
248      }
249    
250    
251    
252      /**
253       * {@inheritDoc}
254       */
255      public TrustStoreBackendCfgClient createClientConfiguration(
256          ManagedObject<? extends TrustStoreBackendCfgClient> impl) {
257        return new TrustStoreBackendCfgClientImpl(impl);
258      }
259    
260    
261    
262      /**
263       * {@inheritDoc}
264       */
265      public TrustStoreBackendCfg createServerConfiguration(
266          ServerManagedObject<? extends TrustStoreBackendCfg> impl) {
267        return new TrustStoreBackendCfgServerImpl(impl);
268      }
269    
270    
271    
272      /**
273       * {@inheritDoc}
274       */
275      public Class<TrustStoreBackendCfg> getServerConfigurationClass() {
276        return TrustStoreBackendCfg.class;
277      }
278    
279    
280    
281      /**
282       * Get the "backend-id" property definition.
283       * <p>
284       * Specifies a name to identify the associated backend.
285       * <p>
286       * The name must be unique among all backends in the server. The
287       * backend ID may not be altered after the backend is created in the
288       * server.
289       *
290       * @return Returns the "backend-id" property definition.
291       */
292      public StringPropertyDefinition getBackendIdPropertyDefinition() {
293        return BackendCfgDefn.getInstance().getBackendIdPropertyDefinition();
294      }
295    
296    
297    
298      /**
299       * Get the "base-dn" property definition.
300       * <p>
301       * Specifies the base DN(s) for the data that the backend handles.
302       * <p>
303       * A single backend may be responsible for one or more base DNs.
304       * Note that no two backends may have the same base DN although one
305       * backend may have a base DN that is below a base DN provided by
306       * another backend (similar to the use of sub-suffixes in the Sun
307       * Java System Directory Server). If any of the base DNs is
308       * subordinate to a base DN for another backend, then all base DNs
309       * for that backend must be subordinate to that same base DN.
310       *
311       * @return Returns the "base-dn" property definition.
312       */
313      public DNPropertyDefinition getBaseDNPropertyDefinition() {
314        return BackendCfgDefn.getInstance().getBaseDNPropertyDefinition();
315      }
316    
317    
318    
319      /**
320       * Get the "enabled" property definition.
321       * <p>
322       * Indicates whether the backend is enabled in the server.
323       * <p>
324       * If a backend is not enabled, then its contents are not accessible
325       * when processing operations.
326       *
327       * @return Returns the "enabled" property definition.
328       */
329      public BooleanPropertyDefinition getEnabledPropertyDefinition() {
330        return BackendCfgDefn.getInstance().getEnabledPropertyDefinition();
331      }
332    
333    
334    
335      /**
336       * Get the "java-class" property definition.
337       * <p>
338       * Specifies the fully-qualified name of the Java class that
339       * provides the backend implementation.
340       *
341       * @return Returns the "java-class" property definition.
342       */
343      public ClassPropertyDefinition getJavaClassPropertyDefinition() {
344        return PD_JAVA_CLASS;
345      }
346    
347    
348    
349      /**
350       * Get the "trust-store-file" property definition.
351       * <p>
352       * Specifies the path to the file that stores the trust information.
353       * <p>
354       * It may be an absolute path, or a path that is relative to the
355       * OpenDS Directory Server instance root.
356       *
357       * @return Returns the "trust-store-file" property definition.
358       */
359      public StringPropertyDefinition getTrustStoreFilePropertyDefinition() {
360        return PD_TRUST_STORE_FILE;
361      }
362    
363    
364    
365      /**
366       * Get the "trust-store-pin" property definition.
367       * <p>
368       * Specifies the clear-text PIN needed to access the Trust Store
369       * Backend .
370       *
371       * @return Returns the "trust-store-pin" property definition.
372       */
373      public StringPropertyDefinition getTrustStorePinPropertyDefinition() {
374        return PD_TRUST_STORE_PIN;
375      }
376    
377    
378    
379      /**
380       * Get the "trust-store-pin-environment-variable" property definition.
381       * <p>
382       * Specifies the name of the environment variable that contains the
383       * clear-text PIN needed to access the Trust Store Backend .
384       *
385       * @return Returns the "trust-store-pin-environment-variable" property definition.
386       */
387      public StringPropertyDefinition getTrustStorePinEnvironmentVariablePropertyDefinition() {
388        return PD_TRUST_STORE_PIN_ENVIRONMENT_VARIABLE;
389      }
390    
391    
392    
393      /**
394       * Get the "trust-store-pin-file" property definition.
395       * <p>
396       * Specifies the path to the text file whose only contents should be
397       * a single line containing the clear-text PIN needed to access the
398       * Trust Store Backend .
399       *
400       * @return Returns the "trust-store-pin-file" property definition.
401       */
402      public StringPropertyDefinition getTrustStorePinFilePropertyDefinition() {
403        return PD_TRUST_STORE_PIN_FILE;
404      }
405    
406    
407    
408      /**
409       * Get the "trust-store-pin-property" property definition.
410       * <p>
411       * Specifies the name of the Java property that contains the
412       * clear-text PIN needed to access the Trust Store Backend .
413       *
414       * @return Returns the "trust-store-pin-property" property definition.
415       */
416      public StringPropertyDefinition getTrustStorePinPropertyPropertyDefinition() {
417        return PD_TRUST_STORE_PIN_PROPERTY;
418      }
419    
420    
421    
422      /**
423       * Get the "trust-store-type" property definition.
424       * <p>
425       * Specifies the format for the data in the key store file.
426       * <p>
427       * Valid values should always include 'JKS' and 'PKCS12', but
428       * different implementations may allow other values as well.
429       *
430       * @return Returns the "trust-store-type" property definition.
431       */
432      public StringPropertyDefinition getTrustStoreTypePropertyDefinition() {
433        return PD_TRUST_STORE_TYPE;
434      }
435    
436    
437    
438      /**
439       * Get the "writability-mode" property definition.
440       * <p>
441       * Specifies the behavior that the backend should use when
442       * processing write operations.
443       *
444       * @return Returns the "writability-mode" property definition.
445       */
446      public EnumPropertyDefinition<WritabilityMode> getWritabilityModePropertyDefinition() {
447        return PD_WRITABILITY_MODE;
448      }
449    
450    
451    
452      /**
453       * Managed object client implementation.
454       */
455      private static class TrustStoreBackendCfgClientImpl implements
456        TrustStoreBackendCfgClient {
457    
458        // Private implementation.
459        private ManagedObject<? extends TrustStoreBackendCfgClient> impl;
460    
461    
462    
463        // Private constructor.
464        private TrustStoreBackendCfgClientImpl(
465            ManagedObject<? extends TrustStoreBackendCfgClient> impl) {
466          this.impl = impl;
467        }
468    
469    
470    
471        /**
472         * {@inheritDoc}
473         */
474        public String getBackendId() {
475          return impl.getPropertyValue(INSTANCE.getBackendIdPropertyDefinition());
476        }
477    
478    
479    
480        /**
481         * {@inheritDoc}
482         */
483        public void setBackendId(String value) throws PropertyIsReadOnlyException {
484          impl.setPropertyValue(INSTANCE.getBackendIdPropertyDefinition(), value);
485        }
486    
487    
488    
489        /**
490         * {@inheritDoc}
491         */
492        public SortedSet<DN> getBaseDN() {
493          return impl.getPropertyValues(INSTANCE.getBaseDNPropertyDefinition());
494        }
495    
496    
497    
498        /**
499         * {@inheritDoc}
500         */
501        public void setBaseDN(Collection<DN> values) {
502          impl.setPropertyValues(INSTANCE.getBaseDNPropertyDefinition(), values);
503        }
504    
505    
506    
507        /**
508         * {@inheritDoc}
509         */
510        public Boolean isEnabled() {
511          return impl.getPropertyValue(INSTANCE.getEnabledPropertyDefinition());
512        }
513    
514    
515    
516        /**
517         * {@inheritDoc}
518         */
519        public void setEnabled(boolean value) {
520          impl.setPropertyValue(INSTANCE.getEnabledPropertyDefinition(), value);
521        }
522    
523    
524    
525        /**
526         * {@inheritDoc}
527         */
528        public String getJavaClass() {
529          return impl.getPropertyValue(INSTANCE.getJavaClassPropertyDefinition());
530        }
531    
532    
533    
534        /**
535         * {@inheritDoc}
536         */
537        public void setJavaClass(String value) {
538          impl.setPropertyValue(INSTANCE.getJavaClassPropertyDefinition(), value);
539        }
540    
541    
542    
543        /**
544         * {@inheritDoc}
545         */
546        public String getTrustStoreFile() {
547          return impl.getPropertyValue(INSTANCE.getTrustStoreFilePropertyDefinition());
548        }
549    
550    
551    
552        /**
553         * {@inheritDoc}
554         */
555        public void setTrustStoreFile(String value) {
556          impl.setPropertyValue(INSTANCE.getTrustStoreFilePropertyDefinition(), value);
557        }
558    
559    
560    
561        /**
562         * {@inheritDoc}
563         */
564        public String getTrustStorePin() {
565          return impl.getPropertyValue(INSTANCE.getTrustStorePinPropertyDefinition());
566        }
567    
568    
569    
570        /**
571         * {@inheritDoc}
572         */
573        public void setTrustStorePin(String value) {
574          impl.setPropertyValue(INSTANCE.getTrustStorePinPropertyDefinition(), value);
575        }
576    
577    
578    
579        /**
580         * {@inheritDoc}
581         */
582        public String getTrustStorePinEnvironmentVariable() {
583          return impl.getPropertyValue(INSTANCE.getTrustStorePinEnvironmentVariablePropertyDefinition());
584        }
585    
586    
587    
588        /**
589         * {@inheritDoc}
590         */
591        public void setTrustStorePinEnvironmentVariable(String value) {
592          impl.setPropertyValue(INSTANCE.getTrustStorePinEnvironmentVariablePropertyDefinition(), value);
593        }
594    
595    
596    
597        /**
598         * {@inheritDoc}
599         */
600        public String getTrustStorePinFile() {
601          return impl.getPropertyValue(INSTANCE.getTrustStorePinFilePropertyDefinition());
602        }
603    
604    
605    
606        /**
607         * {@inheritDoc}
608         */
609        public void setTrustStorePinFile(String value) {
610          impl.setPropertyValue(INSTANCE.getTrustStorePinFilePropertyDefinition(), value);
611        }
612    
613    
614    
615        /**
616         * {@inheritDoc}
617         */
618        public String getTrustStorePinProperty() {
619          return impl.getPropertyValue(INSTANCE.getTrustStorePinPropertyPropertyDefinition());
620        }
621    
622    
623    
624        /**
625         * {@inheritDoc}
626         */
627        public void setTrustStorePinProperty(String value) {
628          impl.setPropertyValue(INSTANCE.getTrustStorePinPropertyPropertyDefinition(), value);
629        }
630    
631    
632    
633        /**
634         * {@inheritDoc}
635         */
636        public String getTrustStoreType() {
637          return impl.getPropertyValue(INSTANCE.getTrustStoreTypePropertyDefinition());
638        }
639    
640    
641    
642        /**
643         * {@inheritDoc}
644         */
645        public void setTrustStoreType(String value) {
646          impl.setPropertyValue(INSTANCE.getTrustStoreTypePropertyDefinition(), value);
647        }
648    
649    
650    
651        /**
652         * {@inheritDoc}
653         */
654        public WritabilityMode getWritabilityMode() {
655          return impl.getPropertyValue(INSTANCE.getWritabilityModePropertyDefinition());
656        }
657    
658    
659    
660        /**
661         * {@inheritDoc}
662         */
663        public void setWritabilityMode(WritabilityMode value) {
664          impl.setPropertyValue(INSTANCE.getWritabilityModePropertyDefinition(), value);
665        }
666    
667    
668    
669        /**
670         * {@inheritDoc}
671         */
672        public ManagedObjectDefinition<? extends TrustStoreBackendCfgClient, ? extends TrustStoreBackendCfg> definition() {
673          return INSTANCE;
674        }
675    
676    
677    
678        /**
679         * {@inheritDoc}
680         */
681        public PropertyProvider properties() {
682          return impl;
683        }
684    
685    
686    
687        /**
688         * {@inheritDoc}
689         */
690        public void commit() throws ManagedObjectAlreadyExistsException,
691            MissingMandatoryPropertiesException, ConcurrentModificationException,
692            OperationRejectedException, AuthorizationException,
693            CommunicationException {
694          impl.commit();
695        }
696    
697      }
698    
699    
700    
701      /**
702       * Managed object server implementation.
703       */
704      private static class TrustStoreBackendCfgServerImpl implements
705        TrustStoreBackendCfg {
706    
707        // Private implementation.
708        private ServerManagedObject<? extends TrustStoreBackendCfg> impl;
709    
710        // The value of the "backend-id" property.
711        private final String pBackendId;
712    
713        // The value of the "base-dn" property.
714        private final SortedSet<DN> pBaseDN;
715    
716        // The value of the "enabled" property.
717        private final boolean pEnabled;
718    
719        // The value of the "java-class" property.
720        private final String pJavaClass;
721    
722        // The value of the "trust-store-file" property.
723        private final String pTrustStoreFile;
724    
725        // The value of the "trust-store-pin" property.
726        private final String pTrustStorePin;
727    
728        // The value of the "trust-store-pin-environment-variable" property.
729        private final String pTrustStorePinEnvironmentVariable;
730    
731        // The value of the "trust-store-pin-file" property.
732        private final String pTrustStorePinFile;
733    
734        // The value of the "trust-store-pin-property" property.
735        private final String pTrustStorePinProperty;
736    
737        // The value of the "trust-store-type" property.
738        private final String pTrustStoreType;
739    
740        // The value of the "writability-mode" property.
741        private final WritabilityMode pWritabilityMode;
742    
743    
744    
745        // Private constructor.
746        private TrustStoreBackendCfgServerImpl(ServerManagedObject<? extends TrustStoreBackendCfg> impl) {
747          this.impl = impl;
748          this.pBackendId = impl.getPropertyValue(INSTANCE.getBackendIdPropertyDefinition());
749          this.pBaseDN = impl.getPropertyValues(INSTANCE.getBaseDNPropertyDefinition());
750          this.pEnabled = impl.getPropertyValue(INSTANCE.getEnabledPropertyDefinition());
751          this.pJavaClass = impl.getPropertyValue(INSTANCE.getJavaClassPropertyDefinition());
752          this.pTrustStoreFile = impl.getPropertyValue(INSTANCE.getTrustStoreFilePropertyDefinition());
753          this.pTrustStorePin = impl.getPropertyValue(INSTANCE.getTrustStorePinPropertyDefinition());
754          this.pTrustStorePinEnvironmentVariable = impl.getPropertyValue(INSTANCE.getTrustStorePinEnvironmentVariablePropertyDefinition());
755          this.pTrustStorePinFile = impl.getPropertyValue(INSTANCE.getTrustStorePinFilePropertyDefinition());
756          this.pTrustStorePinProperty = impl.getPropertyValue(INSTANCE.getTrustStorePinPropertyPropertyDefinition());
757          this.pTrustStoreType = impl.getPropertyValue(INSTANCE.getTrustStoreTypePropertyDefinition());
758          this.pWritabilityMode = impl.getPropertyValue(INSTANCE.getWritabilityModePropertyDefinition());
759        }
760    
761    
762    
763        /**
764         * {@inheritDoc}
765         */
766        public void addTrustStoreChangeListener(
767            ConfigurationChangeListener<TrustStoreBackendCfg> listener) {
768          impl.registerChangeListener(listener);
769        }
770    
771    
772    
773        /**
774         * {@inheritDoc}
775         */
776        public void removeTrustStoreChangeListener(
777            ConfigurationChangeListener<TrustStoreBackendCfg> listener) {
778          impl.deregisterChangeListener(listener);
779        }
780        /**
781         * {@inheritDoc}
782         */
783        public void addChangeListener(
784            ConfigurationChangeListener<BackendCfg> listener) {
785          impl.registerChangeListener(listener);
786        }
787    
788    
789    
790        /**
791         * {@inheritDoc}
792         */
793        public void removeChangeListener(
794            ConfigurationChangeListener<BackendCfg> listener) {
795          impl.deregisterChangeListener(listener);
796        }
797    
798    
799    
800        /**
801         * {@inheritDoc}
802         */
803        public String getBackendId() {
804          return pBackendId;
805        }
806    
807    
808    
809        /**
810         * {@inheritDoc}
811         */
812        public SortedSet<DN> getBaseDN() {
813          return pBaseDN;
814        }
815    
816    
817    
818        /**
819         * {@inheritDoc}
820         */
821        public boolean isEnabled() {
822          return pEnabled;
823        }
824    
825    
826    
827        /**
828         * {@inheritDoc}
829         */
830        public String getJavaClass() {
831          return pJavaClass;
832        }
833    
834    
835    
836        /**
837         * {@inheritDoc}
838         */
839        public String getTrustStoreFile() {
840          return pTrustStoreFile;
841        }
842    
843    
844    
845        /**
846         * {@inheritDoc}
847         */
848        public String getTrustStorePin() {
849          return pTrustStorePin;
850        }
851    
852    
853    
854        /**
855         * {@inheritDoc}
856         */
857        public String getTrustStorePinEnvironmentVariable() {
858          return pTrustStorePinEnvironmentVariable;
859        }
860    
861    
862    
863        /**
864         * {@inheritDoc}
865         */
866        public String getTrustStorePinFile() {
867          return pTrustStorePinFile;
868        }
869    
870    
871    
872        /**
873         * {@inheritDoc}
874         */
875        public String getTrustStorePinProperty() {
876          return pTrustStorePinProperty;
877        }
878    
879    
880    
881        /**
882         * {@inheritDoc}
883         */
884        public String getTrustStoreType() {
885          return pTrustStoreType;
886        }
887    
888    
889    
890        /**
891         * {@inheritDoc}
892         */
893        public WritabilityMode getWritabilityMode() {
894          return pWritabilityMode;
895        }
896    
897    
898    
899        /**
900         * {@inheritDoc}
901         */
902        public Class<? extends TrustStoreBackendCfg> configurationClass() {
903          return TrustStoreBackendCfg.class;
904        }
905    
906    
907    
908        /**
909         * {@inheritDoc}
910         */
911        public DN dn() {
912          return impl.getDN();
913        }
914    
915      }
916    }