KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > directory > ldapstudio > dsmlv2 > reponse > LdapResultEnum


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  *
19  */

20
21 package org.apache.directory.ldapstudio.dsmlv2.reponse;
22
23 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
24
25
26 /**
27  * This Class helps to get resultCodeDesc for a ResultCode of a LdapResult.
28  *
29  * @author <a HREF="mailto:dev@directory.apache.org">Apache Directory Project</a>
30  * @version $Rev$, $Date$
31  */

32 public class LdapResultEnum
33 {
34     /**
35      * Gets the String description of a given result code
36      *
37      * @param resultCode
38      * a result code
39      * @return
40      * the String description corresponding to the result code
41      */

42     public static String JavaDoc getResultCodeDescr( ResultCodeEnum resultCode )
43     {
44         switch ( resultCode )
45         {
46             case SUCCESS:
47                 return "success";
48             case OPERATIONS_ERROR:
49                 return "operationsError";
50             case PROTOCOL_ERROR:
51                 return "protocolError";
52             case TIME_LIMIT_EXCEEDED:
53                 return "timeLimitExceeded";
54             case SIZE_LIMIT_EXCEEDED:
55                 return "sizeLimitExceeded";
56             case COMPARE_FALSE:
57                 return "compareFalse";
58             case COMPARE_TRUE:
59                 return "compareTrue";
60             case AUTH_METHOD_NOT_SUPPORTED:
61                 return "authMethodNotSupported";
62             case STRONG_AUTH_REQUIRED:
63                 return "strongAuthRequired";
64             case PARTIAL_RESULTS:
65                 return "partialResults";
66             case REFERRAL:
67                 return "referral";
68             case ADMIN_LIMIT_EXCEEDED:
69                 return "adminLimitExceeded";
70             case UNAVAILABLE_CRITICAL_EXTENSION:
71                 return "unavailableCriticalExtension";
72             case CONFIDENTIALITY_REQUIRED:
73                 return "confidentialityRequired";
74             case SASL_BIND_IN_PROGRESS:
75                 return "saslBindInProgress";
76             case NO_SUCH_ATTRIBUTE:
77                 return "noSuchAttribute";
78             case UNDEFINED_ATTRIBUTE_TYPE:
79                 return "undefinedAttributeType";
80             case INAPPROPRIATE_MATCHING:
81                 return "inappropriateMatching";
82             case CONSTRAINT_VIOLATION:
83                 return "constraintViolation";
84             case ATTRIBUTE_OR_VALUE_EXISTS:
85                 return "attributeOrValueExists";
86             case INVALID_ATTRIBUTE_SYNTAX:
87                 return "invalidAttributeSyntax";
88             case NO_SUCH_OBJECT:
89                 return "NO_SUCH_OBJECT";
90             case ALIAS_PROBLEM:
91                 return "aliasProblem";
92             case INVALID_DN_SYNTAX:
93                 return "invalidDNSyntax";
94             case ALIAS_DEREFERENCING_PROBLEM:
95                 return "aliasDereferencingProblem";
96             case INAPPROPRIATE_AUTHENTICATION:
97                 return "inappropriateAuthentication";
98             case INVALID_CREDENTIALS:
99                 return "invalidCredentials";
100             case INSUFFICIENT_ACCESS_RIGHTS:
101                 return "insufficientAccessRights";
102             case BUSY:
103                 return "busy";
104             case UNAVAILABLE:
105                 return "unavailable";
106             case UNWILLING_TO_PERFORM:
107                 return "unwillingToPerform";
108             case LOOP_DETECT:
109                 return "loopDetect";
110             case NAMING_VIOLATION:
111                 return "namingViolation";
112             case OBJECT_CLASS_VIOLATION:
113                 return "objectClassViolation";
114             case NOT_ALLOWED_ON_NON_LEAF:
115                 return "notAllowedOnNonLeaf";
116             case NOT_ALLOWED_ON_RDN:
117                 return "notAllowedOnRDN";
118             case ENTRY_ALREADY_EXISTS:
119                 return "entryAlreadyExists";
120             case OBJECT_CLASS_MODS_PROHIBITED:
121                 return "objectClassModsProhibited";
122             case AFFECTS_MULTIPLE_DSAS:
123                 return "affectsMultipleDSAs";
124             case OTHER:
125                 return "other";
126             case UNKNOWN:
127                 return "unknown";
128                 
129             default:
130                 return "unknoxn";
131         }
132     }
133 }
134
Popular Tags