1package org.apache.archiva.redback.authorization;
23/*4 * Licensed to the Apache Software Foundation (ASF) under one5 * or more contributor license agreements. See the NOTICE file6 * distributed with this work for additional information7 * regarding copyright ownership. The ASF licenses this file8 * to you under the Apache License, Version 2.0 (the9 * "License"); you may not use this file except in compliance10 * with the License. You may obtain a copy of the License at11 *12 * http://www.apache.org/licenses/LICENSE-2.013 *14 * Unless required by applicable law or agreed to in writing,15 * software distributed under the License is distributed on an16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY17 * KIND, either express or implied. See the License for the18 * specific language governing permissions and limitations19 * under the License.20 */2122/**23 * AuthorizationResult: wrapper object for results from the authorization system24 *25 * @author: Jesse McConnell <jesse@codehaus.org>26 */27publicclassAuthorizationResult28 {
29privateboolean isAuthorized;
3031private Object principal;
3233private Exception exception;
343536publicAuthorizationResult( boolean authorized,
37 Object principal,
38 Exception exception )
39 {
40 isAuthorized = authorized;
41this.principal = principal;
42this.exception = exception;
43 }
4445publicboolean isAuthorized()
46 {
47return isAuthorized;
48 }
4950public Object getPrincipal()
51 {
52return principal;
53 }
5455public Exception getException()
56 {
57return exception;
58 }
5960 @Override
61public String toString()
62 {
63final StringBuilder sb = new StringBuilder();
64 sb.append( "AuthorizationResult" );
65 sb.append( "{isAuthorized=" ).append( isAuthorized );
66 sb.append( ", principal=" ).append( principal );
67 sb.append( ", exception=" ).append( exception );
68 sb.append( '}' );
69return sb.toString();
70 }
71 }