01: /*
02: * $Id: DefaultMuleAuthentication.java 10489 2008-01-23 17:53:38Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
10:
11: package org.mule.security;
12:
13: import org.mule.api.security.Authentication;
14: import org.mule.api.security.Credentials;
15:
16: import java.util.Map;
17:
18: public class DefaultMuleAuthentication implements Authentication {
19: private boolean authenticated;
20: private char[] credentials;
21: private String user;
22: private Map properties;
23:
24: public DefaultMuleAuthentication(Credentials credentials) {
25: this .user = credentials.getUsername();
26: this .credentials = credentials.getPassword();
27: }
28:
29: public void setAuthenticated(boolean b) {
30: authenticated = b;
31: }
32:
33: public boolean isAuthenticated() {
34: return authenticated;
35: }
36:
37: public Object getCredentials() {
38: return new String(credentials);
39: }
40:
41: public Object getPrincipal() {
42: return user;
43: }
44:
45: public Map getProperties() {
46: return properties;
47: }
48:
49: public void setProperties(Map properties) {
50: this.properties = properties;
51: }
52:
53: }
|