View Javadoc

1   /*
2    * $Id: AcegiAuthenticationAdapter.java 10789 2008-02-12 20:04:43Z dfeist $
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 CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.module.acegi;
12  
13  import org.mule.api.security.Authentication;
14  
15  import java.util.Map;
16  
17  import org.acegisecurity.GrantedAuthority;
18  
19  /**
20   * <code>AcegiAuthenticationAdapter</code> TODO
21   */
22  public class AcegiAuthenticationAdapter implements Authentication
23  {
24      private org.acegisecurity.Authentication delegate;
25      private Map properties;
26  
27      public AcegiAuthenticationAdapter(org.acegisecurity.Authentication authentication)
28      {
29          this.delegate = authentication;
30      }
31  
32      public AcegiAuthenticationAdapter(org.acegisecurity.Authentication authentication, Map 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 getCredentials()
54      {
55          return delegate.getCredentials();
56      }
57  
58      public Object getDetails()
59      {
60          return delegate.getDetails();
61      }
62  
63      public Object getPrincipal()
64      {
65          return delegate.getPrincipal();
66      }
67  
68      public int hashCode()
69      {
70          return delegate.hashCode();
71      }
72  
73      public boolean equals(Object another)
74      {
75          return delegate.equals(another);
76      }
77  
78      public String getName()
79      {
80          return delegate.getName();
81      }
82  
83      public org.acegisecurity.Authentication getDelegate()
84      {
85          return delegate;
86      }
87  
88      public Map getProperties()
89      {
90          return properties;
91      }
92  
93      public void setProperties(Map properties)
94      {
95          this.properties = properties;
96      }
97  }