1 21 22 package org.apache.derby.iapi.sql.dictionary; 23 24 import org.apache.derby.catalog.UUID; 25 import org.apache.derby.iapi.error.StandardException; 26 import org.apache.derby.iapi.sql.depend.Provider; 27 import org.apache.derby.iapi.sql.dictionary.DataDictionary; 28 import org.apache.derby.iapi.services.sanity.SanityManager; 29 30 34 public abstract class PermissionsDescriptor extends TupleDescriptor 35 implements Cloneable , Provider 36 { 37 protected UUID oid; 38 private String grantee; 39 private final String grantor; 40 41 PermissionsDescriptor( DataDictionary dd, 42 String grantee, 43 String grantor) 44 { 45 super (dd); 46 this.grantee = grantee; 47 this.grantor = grantor; 48 } 49 50 public Object clone() 51 { 52 try 53 { 54 return super.clone(); 55 } 56 catch( java.lang.CloneNotSupportedException cnse) 57 { 58 if( SanityManager.DEBUG) 59 SanityManager.THROWASSERT( "Could not clone a " + getClass().getName()); 60 return null; 61 } 62 } 63 64 public abstract int getCatalogNumber(); 65 66 70 protected boolean keyEquals( PermissionsDescriptor other) 71 { 72 return grantee.equals( other.grantee); 73 } 74 75 78 protected int keyHashCode() 79 { 80 return grantee.hashCode(); 81 } 82 83 public void setGrantee( String grantee) 84 { 85 this.grantee = grantee; 86 } 87 88 89 public final String getGrantee() { return grantee;} 90 public final String getGrantor() { return grantor;} 91 92 97 public UUID getUUID() { return oid;} 98 99 104 public void setUUID(UUID oid) { this.oid = oid;} 105 106 116 public abstract boolean checkOwner(String authorizationId) throws StandardException; 117 118 124 129 public UUID getObjectID() 130 { 131 return oid; 132 } 133 134 140 public boolean isPersistent() 141 { 142 return true; 143 } 144 } 145 | Popular Tags |