001/* 002 * Copyright 2009-2014 UnboundID Corp. 003 * All Rights Reserved. 004 */ 005/* 006 * Copyright (C) 2009-2014 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 */ 021package com.unboundid.ldap.sdk.persist; 022 023 024 025import java.io.Serializable; 026 027import com.unboundid.util.Extensible; 028import com.unboundid.util.ThreadSafety; 029import 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) 045public abstract class OIDAllocator 046 implements Serializable 047{ 048 /** 049 * Allocates an OID for the attribute type with the specified name. 050 * 051 * @param name The name of the attribute type for which to generate an OID. 052 * It must not be {@code null} or empty. 053 * 054 * @return The OID to use for the attribute type definition. 055 */ 056 public abstract String allocateAttributeTypeOID(final String name); 057 058 059 060 /** 061 * Allocates an OID for the object class with the specified name. 062 * 063 * @param name The name of the object class for which to generate an OID. 064 * It must not be {@code null} or empty. 065 * 066 * @return The OID to use for the object class definition. 067 */ 068 public abstract String allocateObjectClassOID(final String name); 069}