1 17 18 package org.apache.geronimo.security; 19 20 import java.security.Principal ; 21 22 23 26 public class PrimaryPrincipal implements Principal { 27 28 private final Principal principal; 29 30 public PrimaryPrincipal(Principal principal) { 31 if (principal == null) throw new IllegalArgumentException ("principal is null"); 32 this.principal = principal; 33 } 34 35 public boolean equals(Object o) { 36 if (this == o) return true; 37 if (o == null || getClass() != o.getClass()) return false; 38 39 final PrimaryPrincipal that = (PrimaryPrincipal) o; 40 41 if (!principal.equals(that.principal)) return false; 42 43 return true; 44 } 45 46 public int hashCode() { 47 return principal.hashCode(); 48 } 49 50 public String getName() { 51 return principal.getName(); 52 } 53 } 54 | Popular Tags |