View Javadoc
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  package org.apache.directory.api.ldap.extras.extended.whoAmI;
21  
22  
23  import org.apache.directory.api.ldap.model.message.ExtendedResponse;
24  import org.apache.directory.api.ldap.model.name.Dn;
25  
26  
27  /**
28   * The RFC 4532 WhoAmI response :
29   * 
30   * <pre>
31   * authzid ::= OCTET STRING OPTIONAL
32   * </pre>
33   * 
34   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
35   */
36  public interface WhoAmIResponse extends ExtendedResponse
37  {
38      /** The OID for the WhoAmI extended operation response. */
39      String EXTENSION_OID = WhoAmIRequest.EXTENSION_OID;
40  
41      
42      /**
43       * @return true if the response contains a DN authz (dn:XXX)
44       */
45      boolean isDnAuthzId();
46      
47      
48      /**
49       * @return true if the response contains a userID authz (u:XXX)
50       */
51      boolean isUserAuthzId();
52      
53  
54      /**
55       * Get the authzid as a byte[]
56       * 
57       * @return The authzid or null
58       */
59      byte[] getAuthzId();
60  
61  
62      /**
63       * Get the authzid as String. We will strip out the 'dn:' or 'u:' part.
64       * 
65       * @return The authzid or null
66       */
67      String getAuthzIdString();
68  
69  
70      /**
71       * Get the UserId
72       * 
73       * @return The userId or null
74       */
75      String getUserId();
76  
77  
78      /**
79       * Get the DN authzid.
80       * 
81       * @return The DN or null
82       */
83      Dn getDn();
84  
85  
86      /**
87       * set the authzid
88       * 
89       * @param authzId The authzId to set
90       */
91      void setAuthzId( byte[] authzId );
92  }