1 /*
2 * $Id: MuleJaasPrincipal.java 22686 2011-08-16 19:39:20Z pablo.lagreca $
3 * --------------------------------------------------------------------------------------
4 * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.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.io.Serializable;
14 import java.security.Principal;
15
16 public class MuleJaasPrincipal implements Principal, Serializable
17 {
18 private final String name;
19
20 public MuleJaasPrincipal(String name)
21 {
22 if (name == null)
23 {
24 throw new IllegalArgumentException("Null name");
25 }
26 this.name = name;
27 }
28
29 public String getName()
30 {
31 return name;
32 }
33
34 public String toString()
35 {
36 return name;
37 }
38
39 public int hasCode()
40 {
41 return name.hashCode();
42 }
43 }