KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > extras > acegi > AcegiAuthenticationAdapter


1 /*
2  * $Id: AcegiAuthenticationAdapter.java 4259 2006-12-14 03:12:07Z aperepel $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.extras.acegi;
12
13 import java.util.Map JavaDoc;
14
15 import org.acegisecurity.Authentication;
16 import org.acegisecurity.GrantedAuthority;
17 import org.mule.umo.security.UMOAuthentication;
18
19 /**
20  * <code>AcegiAuthenticationAdapter</code> TODO
21  */

22 public class AcegiAuthenticationAdapter implements UMOAuthentication
23 {
24     private Authentication delegate;
25     private Map JavaDoc properties;
26
27     public AcegiAuthenticationAdapter(Authentication authentication)
28     {
29         this.delegate = authentication;
30     }
31
32     public AcegiAuthenticationAdapter(Authentication authentication, Map JavaDoc properties)
33     {
34         this.delegate = authentication;
35         this.properties = properties;
36     }
37
38     public void setAuthenticated(boolean b)
39     {
40         delegate.setAuthenticated(b);
41     }
42
43     public boolean isAuthenticated()
44     {
45         return delegate.isAuthenticated();
46     }
47
48     public GrantedAuthority[] getAuthorities()
49     {
50         return delegate.getAuthorities();
51     }
52
53     public Object JavaDoc getCredentials()
54     {
55         return delegate.getCredentials();
56     }
57
58     public Object JavaDoc getDetails()
59     {
60         return delegate.getDetails();
61     }
62
63     public Object JavaDoc getPrincipal()
64     {
65         return delegate.getPrincipal();
66     }
67
68     public int hashCode()
69     {
70         return delegate.hashCode();
71     }
72
73     public boolean equals(Object JavaDoc another)
74     {
75         return delegate.equals(another);
76     }
77
78     public String JavaDoc getName()
79     {
80         return delegate.getName();
81     }
82
83     public Authentication getDelegate()
84     {
85         return delegate;
86     }
87
88     public Map JavaDoc getProperties()
89     {
90         return properties;
91     }
92
93     public void setProperties(Map JavaDoc properties)
94     {
95         this.properties = properties;
96     }
97 }
98
Popular Tags