AuthenticationResult.java
01 /*
02  *
03  * Licensed to the Apache Software Foundation (ASF) under one
04  * or more contributor license agreements.  See the NOTICE file
05  * distributed with this work for additional information
06  * regarding copyright ownership.  The ASF licenses this file
07  * to you under the Apache License, Version 2.0 (the
08  * "License"); you may not use this file except in compliance
09  * with the License.  You may obtain a copy of the License at
10  
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  */
21 package org.apache.qpid.server.security.auth;
22 
23 import javax.security.sasl.SaslException;
24 
25 public class AuthenticationResult
26 {
27     public enum AuthenticationStatus
28     {
29         SUCCESS, CONTINUE, ERROR
30     }
31 
32     public AuthenticationStatus status;
33     public byte[] challenge;
34     
35     private Exception cause;
36 
37     public AuthenticationResult(AuthenticationStatus status)
38     {
39         this(null, status, null);
40     }
41 
42     public AuthenticationResult(byte[] challenge, AuthenticationStatus status)
43     {
44         this(challenge, status, null);
45     }
46 
47     public AuthenticationResult(AuthenticationStatus error, Exception cause)
48     {
49         this(null, error, cause);
50     }
51 
52     public AuthenticationResult(byte[] challenge, AuthenticationStatus status, Exception cause)
53     {
54         this.status = status;
55         this.challenge = challenge;
56         this.cause = cause;
57     }
58 
59     public Exception getCause()
60     {
61         return cause;
62     }
63 }