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 org.opends.server.admin.AbstractManagedObjectDefinition;
032    import org.opends.server.admin.AdministratorAction;
033    import org.opends.server.admin.BooleanPropertyDefinition;
034    import org.opends.server.admin.PropertyOption;
035    import org.opends.server.admin.std.client.LogPublisherCfgClient;
036    import org.opends.server.admin.std.server.LogPublisherCfg;
037    import org.opends.server.admin.Tag;
038    import org.opends.server.admin.TopCfgDefn;
039    import org.opends.server.admin.UndefinedDefaultBehaviorProvider;
040    
041    
042    
043    /**
044     * An interface for querying the Log Publisher managed object
045     * definition meta information.
046     * <p>
047     * Log Publishers are responsible for distributing log messages from
048     * different loggers to a destination.
049     */
050    public final class LogPublisherCfgDefn extends AbstractManagedObjectDefinition<LogPublisherCfgClient, LogPublisherCfg> {
051    
052      // The singleton configuration definition instance.
053      private static final LogPublisherCfgDefn INSTANCE = new LogPublisherCfgDefn();
054    
055    
056    
057      // The "enabled" property definition.
058      private static final BooleanPropertyDefinition PD_ENABLED;
059    
060    
061    
062      // Build the "enabled" property definition.
063      static {
064          BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "enabled");
065          builder.setOption(PropertyOption.MANDATORY);
066          builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "enabled"));
067          builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<Boolean>());
068          PD_ENABLED = builder.getInstance();
069          INSTANCE.registerPropertyDefinition(PD_ENABLED);
070      }
071    
072    
073    
074      // Register the tags associated with this managed object definition.
075      static {
076        INSTANCE.registerTag(Tag.valueOf("logging"));
077      }
078    
079    
080    
081      /**
082       * Get the Log Publisher configuration definition singleton.
083       *
084       * @return Returns the Log Publisher configuration definition
085       *         singleton.
086       */
087      public static LogPublisherCfgDefn getInstance() {
088        return INSTANCE;
089      }
090    
091    
092    
093      /**
094       * Private constructor.
095       */
096      private LogPublisherCfgDefn() {
097        super("log-publisher", TopCfgDefn.getInstance());
098      }
099    
100    
101    
102      /**
103       * Get the "enabled" property definition.
104       * <p>
105       * Indicates whether the Log Publisher is enabled for use.
106       *
107       * @return Returns the "enabled" property definition.
108       */
109      public BooleanPropertyDefinition getEnabledPropertyDefinition() {
110        return PD_ENABLED;
111      }
112    }