001/* 002 * The contents of this file are subject to the terms of the Common Development and 003 * Distribution License (the License). You may not use this file except in compliance with the 004 * License. 005 * 006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the 007 * specific language governing permission and limitations under the License. 008 * 009 * When distributing Covered Software, include this CDDL Header Notice in each file and include 010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL 011 * Header, with the fields enclosed by brackets [] replaced by your own identifying 012 * information: "Portions Copyright [year] [name of copyright owner]". 013 * 014 * Copyright 2008 Sun Microsystems, Inc. 015 */ 016package org.opends.server.authorization.dseecompat; 017 018 019/** 020 * Enumeration that represents the type an "userdn" keyword DN can have. 021 * The issues is the syntax allows invalid URLs such as "ldap:///anyone" 022 * and "ldap:///self". The strategy is to use this class to hold 023 * the type and another class UserDNTypeURL to hold both this type and URL. 024 * 025 * If the URL is an invalid URL, then a dummy URL is saved. 026 * For types such as URL, DN and DNPATTERN, the actual URL is saved and can 027 * be retrieved by the UserDN.evaluate() method when needed. The dummy URL is 028 * ignored in the UserDN.evaluate() method for types such as: ALL, PARENT, 029 * SELF and ANYONE. 030 */ 031public enum EnumUserDNType { 032 033 /** 034 * The enumeration type when the "userdn" URL contains only a DN (no 035 * filter or scope) and that DN has no pattern. 036 */ 037 DN(0), 038 /** 039 * The enumeration type when the "userdn" URL contains only a DN (no 040 * filter or scope) and that DN has a substring pattern. 041 */ 042 DNPATTERN(1), 043 /** 044 * The enumeration type when the "userdn" URL has the value of: 045 * "ldap:///all". 046 */ 047 ALL(2), 048 /** 049 * The enumeration type when the "userdn" URL has the value of: 050 * "ldap:///parent". 051 */ 052 PARENT(3), 053 /** 054 * The enumeration type when the "userdn" URL has the value of: 055 * "ldap:///self". 056 */ 057 SELF(4), 058 /** 059 * The enumeration type when the "userdn" URL has the value of: 060 * "ldap:///anyone". 061 */ 062 ANYONE(5), 063 /** 064 * The enumeration type when the "userdn" URL is contains a DN (suffix), 065 * a scope and a filter. 066 */ 067 URL(6); 068 069 /** 070 * Constructor taking an integer value. 071 * @param v Integer value. 072 */ 073 EnumUserDNType(int v) {} 074}