001    /*
002     * Copyright 2009-2015 UnboundID Corp.
003     * All Rights Reserved.
004     */
005    /*
006     * Copyright (C) 2009-2015 UnboundID Corp.
007     *
008     * This program is free software; you can redistribute it and/or modify
009     * it under the terms of the GNU General Public License (GPLv2 only)
010     * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
011     * as published by the Free Software Foundation.
012     *
013     * This program is distributed in the hope that it will be useful,
014     * but WITHOUT ANY WARRANTY; without even the implied warranty of
015     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016     * GNU General Public License for more details.
017     *
018     * You should have received a copy of the GNU General Public License
019     * along with this program; if not, see <http://www.gnu.org/licenses>.
020     */
021    package com.unboundid.ldap.sdk.persist;
022    
023    
024    
025    import java.io.Serializable;
026    
027    import com.unboundid.util.Extensible;
028    import com.unboundid.util.ThreadSafety;
029    import com.unboundid.util.ThreadSafetyLevel;
030    
031    
032    
033    /**
034     * This class provides a mechanism that can be used for generating object
035     * identifiers (OIDs) for use in attribute type and object class definitions
036     * constructed for use in representing an object in the directory.
037     * <BR><BR>
038     * Note that OIDs generated are not necessarily required to be valid, nor are
039     * they required to be unique.  As such, OIDs included in generated attribute
040     * type and object class definitions may need to be edited before the
041     * definitions can be added to the directory server.
042     */
043    @Extensible()
044    @ThreadSafety(level=ThreadSafetyLevel.INTERFACE_THREADSAFE)
045    public abstract class OIDAllocator
046           implements Serializable
047    {
048      /**
049       * The serial version UID for this serializable class.
050       */
051      private static final long serialVersionUID = -2031217984148568974L;
052    
053    
054    
055      /**
056       * Allocates an OID for the attribute type with the specified name.
057       *
058       * @param  name  The name of the attribute type for which to generate an OID.
059       *               It must not be {@code null} or empty.
060       *
061       * @return  The OID to use for the attribute type definition.
062       */
063      public abstract String allocateAttributeTypeOID(final String name);
064    
065    
066    
067      /**
068       * Allocates an OID for the object class with the specified name.
069       *
070       * @param  name  The name of the object class for which to generate an OID.
071       *               It must not be {@code null} or empty.
072       *
073       * @return  The OID to use for the object class definition.
074       */
075      public abstract String allocateObjectClassOID(final String name);
076    }