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 legal-notices/CDDLv1_0.txt
010 * or http://forgerock.org/license/CDDLv1.0.html.
011 * See the License for the specific language governing permissions
012 * and limitations under the License.
013 *
014 * When distributing Covered Code, include this CDDL HEADER in each
015 * file and include the License file at legal-notices/CDDLv1_0.txt.
016 * If applicable, add the following below this CDDL HEADER, with the
017 * fields enclosed by brackets "[]" replaced with your own identifying
018 * information:
019 *      Portions Copyright [yyyy] [name of copyright owner]
020 *
021 * CDDL HEADER END
022 *
023 *
024 *      Copyright 2008 Sun Microsystems, Inc.
025 *      Portions Copyright 2015 ForgeRock AS.
026 */
027package org.opends.server.authorization.dseecompat;
028
029import org.opends.server.types.LDAPURL;
030
031/**
032 * The UserDNTypeURL class contains the EnumUserDNType and the URL value,
033 * of a "userdn" URL decoded by the UserDN.decode() method.
034 */
035public class UserDNTypeURL {
036
037    /** The DN type of the URL. */
038    private EnumUserDNType dnType;
039
040    /** The URL value. Maybe a dummy value for types such as ANYONE or SELF. */
041    private LDAPURL url;
042
043    /**
044     * Create a class representing the "userdn" URL decoded by the
045     * UserDN.decode() method.
046     * @param dnType The type of the URL determined by examining the DN
047     * or suffix.
048     * @param url The URL itself from the ACI "userdn" string expression.
049     */
050    UserDNTypeURL(EnumUserDNType dnType, LDAPURL url) {
051        this.url=url;
052        this.dnType=dnType;
053    }
054
055    /**
056     * Returns the DN type.
057     * @return The DN type of the URL.
058     */
059    public EnumUserDNType getUserDNType() {
060        return this.dnType;
061    }
062
063    /** Returns the URL.
064     * @return The URL decoded by the UserDN.decode() method.
065     */
066    public LDAPURL getURL() {
067        return this.url;
068    }
069}