EnumRight.java revision 31ef6298b4179ddca52d4b1d0aad873af9d17155
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
* add the following below this CDDL HEADER, with the fields enclosed
* by brackets "[]" replaced with your own identifying information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Portions Copyright 2007 Sun Microsystems, Inc.
*/
/**
* This class provides an enumeration of the allowed rights.
*/
public enum EnumRight {
/**
* This enumeration is returned when the result of the right is "read".
*/
READ ("read"),
/**
* This enumeration is returned when the result of the right is "write".
*/
WRITE ("write"),
/**
* This enumeration is returned when the result of the right is "add".
*/
ADD ("add"),
/**
* This enumeration is returned when the result of the right is "delete".
*/
DELETE ("delete"),
/**
* This enumeration is returned when the result of the right is "search".
*/
SEARCH ("search"),
/**
* This enumeration is returned when the result of the right is "compare".
*/
COMPARE ("compare"),
/**
* This enumeration is returned when the result of the right is
* "selfwrite".
*/
SELFWRITE ("selfwrite"),
/**
* This enumeration is returned when the result of the right is "proxy".
*/
PROXY ("proxy"),
/**
* This enumeration is returned when the result of the right is "import".
*/
IMPORT ("import"),
/**
* This enumeration is returned when the result of the right is "export".
*/
EXPORT ("export"),
/**
* This enumeration is returned when the result of the right is "all".
*/
ALL ("all"),
/**
* This enumeration is used internally by the modify operation
* processing and is not part of the ACI syntax.
*/
DELWRITE ("delwrite"),
/**
* This enumerations is used internally by the modify operation
* processing and is not part of the ACI syntax.
*/
ADDWRITE ("addwrite");
/*
* The name of the right.
*/
/**
* Creates an enumeration of the right name.
* @param right The name of the right.
*/
}
/**
* Checks if the enumeration is equal to the right name.
* @param right The name of the right to check.
* @return True if the right is equal to the enumeration's.
*/
}
/**
* Creates an enumeration of the right name.
* @param right The name of the right.
* @return An enumeration of the right or null if the name is invalid.
*/
return t;
}
}
}
return null;
}
/**
* Returns bit mask associated with the specified right.
* @param right The right enumeration to return the mask for.
* @return The bit mask associated with the right.
*/
switch(right) {
case READ:
break;
case WRITE:
break;
case ADD:
break;
case DELETE:
break;
case SEARCH:
break;
case COMPARE:
break;
case ALL:
break;
case EXPORT:
break;
case IMPORT:
break;
case PROXY:
break;
case SELFWRITE:
break;
}
return mask;
}
}