1 11 12 13 package com.sun.jmx.snmp.IPAcl; 14 15 16 17 import java.util.Vector ; 18 import java.util.Enumeration ; 19 import java.io.Serializable ; 20 import java.net.UnknownHostException ; 21 22 23 import java.security.Principal ; 24 import java.security.acl.Group ; 25 26 27 35 36 class GroupImpl extends PrincipalImpl implements Group , Serializable { 37 38 42 public GroupImpl () throws UnknownHostException { 43 } 44 45 51 public GroupImpl (String mask) throws UnknownHostException { 52 super(mask); 53 } 54 55 62 public boolean addMember(Principal p) { 63 return true; 66 } 67 68 public int hashCode() { 69 return super.hashCode(); 70 } 71 72 80 public boolean equals (Object p) { 81 if (p instanceof PrincipalImpl || p instanceof GroupImpl){ 82 if ((super.hashCode() & p.hashCode()) == p.hashCode()) return true; 83 else return false; 84 } else { 85 return false; 86 } 87 } 88 89 95 public boolean isMember(Principal p) { 96 if ((p.hashCode() & super.hashCode()) == p.hashCode()) return true; 97 else return false; 98 } 99 100 105 public Enumeration members(){ 106 Vector v = new Vector (1); 107 v.addElement(this); 108 return v.elements(); 109 } 110 111 117 public boolean removeMember(Principal p) { 118 return true; 119 } 120 121 126 public String toString() { 127 return ("GroupImpl :"+super.getAddress().toString()); 128 } 129 } 130 131 132 | Popular Tags |