View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.module.jaas;
8   
9   import java.io.Serializable;
10  import java.security.Principal;
11  
12  public class MuleJaasPrincipal implements Principal, Serializable
13  {
14      private final String name;
15  
16      public MuleJaasPrincipal(String name)
17      {
18          if (name == null)
19          {
20              throw new IllegalArgumentException("Null name");
21          }
22          this.name = name;
23      }
24  
25      public String getName()
26      {
27          return name;
28      }
29  
30      public String toString()
31      {
32          return name;
33      }
34  
35      public int hasCode()
36      {
37          return name.hashCode();
38      }
39  }