1 17 package org.alfresco.repo.security.permissions.impl.hibernate; 18 19 import java.util.HashSet ; 20 import java.util.Set ; 21 22 import org.alfresco.repo.domain.NodeKey; 23 import org.alfresco.service.cmr.repository.NodeRef; 24 import org.alfresco.service.cmr.repository.StoreRef; 25 26 31 public class NodePermissionEntryImpl implements NodePermissionEntry 32 { 33 36 private NodeKey nodeKey; 37 38 41 private boolean inherits; 42 43 46 private Set <PermissionEntry> permissionEntries = new HashSet <PermissionEntry>(); 47 48 public NodePermissionEntryImpl() 49 { 50 super(); 51 } 52 53 public NodeKey getNodeKey() 54 { 55 return nodeKey; 56 } 57 58 public void setNodeKey(NodeKey nodeKey) 59 { 60 this.nodeKey = nodeKey; 61 } 62 63 public NodeRef getNodeRef() 64 { 65 return new NodeRef(new StoreRef(nodeKey.getProtocol(), nodeKey 66 .getIdentifier()), nodeKey.getGuid()); 67 } 68 69 public boolean getInherits() 70 { 71 return inherits; 72 } 73 74 public void setInherits(boolean inherits) 75 { 76 this.inherits = inherits; 77 } 78 79 public Set <PermissionEntry> getPermissionEntries() 80 { 81 return permissionEntries; 82 } 83 84 86 void setPermissionEntries(Set <PermissionEntry> permissionEntries) 87 { 88 this.permissionEntries = permissionEntries; 89 } 90 91 93 @Override 94 public boolean equals(Object o) 95 { 96 if (this == o) 97 { 98 return true; 99 } 100 if (!(o instanceof NodePermissionEntryImpl)) 101 { 102 return false; 103 } 104 NodePermissionEntryImpl other = (NodePermissionEntryImpl) o; 105 106 return this.nodeKey.equals(other.nodeKey) 107 && (this.inherits == other.inherits) 108 && (this.permissionEntries.equals(other.permissionEntries)); 109 } 110 111 @Override 112 public int hashCode() 113 { 114 return nodeKey.hashCode(); 115 } 116 117 } 118 | Popular Tags |