1 /*
2 * $Id: MuleJaasPrincipal.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.jaas;
12
13 import java.security.Principal;
14
15 public class MuleJaasPrincipal implements Principal
16 {
17 private final String name;
18
19 public MuleJaasPrincipal(String name)
20 {
21 if (name == null)
22 {
23 throw new IllegalArgumentException("Null name");
24 }
25 this.name = name;
26 }
27
28 public String getName()
29 {
30 return name;
31 }
32
33 public String toString()
34 {
35 return name;
36 }
37
38 public int hasCode()
39 {
40 return name.hashCode();
41 }
42 }