mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
125603 rmunteanu: Merged 5.1.1 (5.1.1) to 5.1.N (5.1.2) 125484 slanglois: MNT-16155 Update source headers - remove old Copyrights from Java and JSP dource files git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@125781 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
231 lines
4.9 KiB
Java
231 lines
4.9 KiB
Java
package org.alfresco.repo.domain.permissions;
|
|
|
|
import java.io.Serializable;
|
|
|
|
import org.alfresco.repo.security.permissions.ACLType;
|
|
import org.alfresco.util.EqualsHelper;
|
|
|
|
|
|
/**
|
|
* Entity for <b>alf_acess_control_list</b> persistence.
|
|
*
|
|
* @author janv
|
|
* @since 3.4
|
|
*/
|
|
public class AclEntity implements Acl, Serializable
|
|
{
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
private Long id;
|
|
private Long version;
|
|
private String aclId;
|
|
private boolean latest;
|
|
private Long aclVersion;
|
|
private boolean inherits;
|
|
private Long inheritsFrom;
|
|
private Integer type;
|
|
private Long inheritedAcl;
|
|
private boolean isVersioned;
|
|
private boolean requiresVersion;
|
|
private Long aclChangeSet;
|
|
|
|
/**
|
|
* Default constructor
|
|
*/
|
|
public AclEntity()
|
|
{
|
|
}
|
|
|
|
public Long getId()
|
|
{
|
|
return id;
|
|
}
|
|
|
|
public void setId(Long id)
|
|
{
|
|
this.id = id;
|
|
}
|
|
|
|
public Long getVersion()
|
|
{
|
|
return version;
|
|
}
|
|
|
|
public void setVersion(Long version)
|
|
{
|
|
this.version = version;
|
|
}
|
|
|
|
public void incrementVersion()
|
|
{
|
|
if (this.version >= Long.MAX_VALUE)
|
|
{
|
|
this.version = 0L;
|
|
}
|
|
else
|
|
{
|
|
this.version++;
|
|
}
|
|
}
|
|
|
|
public String getAclId()
|
|
{
|
|
return aclId;
|
|
}
|
|
|
|
public void setAclId(String aclId)
|
|
{
|
|
this.aclId = aclId;
|
|
}
|
|
|
|
public Boolean isLatest()
|
|
{
|
|
return latest;
|
|
}
|
|
|
|
public void setLatest(boolean latest)
|
|
{
|
|
this.latest = latest;
|
|
}
|
|
|
|
public Long getAclVersion()
|
|
{
|
|
return aclVersion;
|
|
}
|
|
|
|
public void setAclVersion(Long aclVersion)
|
|
{
|
|
this.aclVersion = aclVersion;
|
|
}
|
|
|
|
public Boolean getInherits()
|
|
{
|
|
return inherits;
|
|
}
|
|
|
|
public void setInherits(boolean inherits)
|
|
{
|
|
this.inherits = inherits;
|
|
}
|
|
|
|
public Long getInheritsFrom()
|
|
{
|
|
return inheritsFrom;
|
|
}
|
|
|
|
public void setInheritsFrom(Long inheritsFrom)
|
|
{
|
|
this.inheritsFrom = inheritsFrom;
|
|
}
|
|
|
|
public Integer getType()
|
|
{
|
|
return type;
|
|
}
|
|
|
|
public void setType(Integer type)
|
|
{
|
|
this.type = type;
|
|
}
|
|
|
|
public Long getInheritedAcl()
|
|
{
|
|
return inheritedAcl;
|
|
}
|
|
|
|
public void setInheritedAcl(Long inheritedAcl)
|
|
{
|
|
this.inheritedAcl = inheritedAcl;
|
|
}
|
|
|
|
public Boolean isVersioned()
|
|
{
|
|
return isVersioned;
|
|
}
|
|
|
|
public void setVersioned(boolean isVersioned)
|
|
{
|
|
this.isVersioned = isVersioned;
|
|
}
|
|
|
|
public Boolean getRequiresVersion()
|
|
{
|
|
return requiresVersion;
|
|
}
|
|
|
|
public void setRequiresVersion(boolean requiresVersion)
|
|
{
|
|
this.requiresVersion = requiresVersion;
|
|
}
|
|
|
|
public Long getAclChangeSetId()
|
|
{
|
|
return aclChangeSet;
|
|
}
|
|
|
|
public void setAclChangeSetId(Long aclChangeSet)
|
|
{
|
|
this.aclChangeSet = aclChangeSet;
|
|
}
|
|
|
|
public ACLType getAclType()
|
|
{
|
|
return ACLType.getACLTypeFromId(type);
|
|
}
|
|
|
|
public void setAclType(ACLType type)
|
|
{
|
|
this.type = type.getId();
|
|
}
|
|
|
|
@Override
|
|
public int hashCode()
|
|
{
|
|
final int prime = 31;
|
|
int result = 1;
|
|
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
|
result = prime * result + ((version == null) ? 0 : version.hashCode());
|
|
return result;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object obj)
|
|
{
|
|
if (this == obj)
|
|
{
|
|
return true;
|
|
}
|
|
else if (obj instanceof AclEntity)
|
|
{
|
|
AclEntity that = (AclEntity) obj;
|
|
return EqualsHelper.nullSafeEquals(this.id, that.id)
|
|
&& EqualsHelper.nullSafeEquals(this.version, that.version);
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public String toString()
|
|
{
|
|
StringBuilder sb = new StringBuilder(512);
|
|
sb.append("AclEntity")
|
|
.append("[ ID=").append(id)
|
|
.append(", version=").append(version)
|
|
.append(", aclId=").append(aclId)
|
|
.append(", isLatest=").append(latest)
|
|
.append(", aclVersion=").append(aclVersion)
|
|
.append(", inherits=").append(inherits)
|
|
.append(", inheritsFrom=").append(inheritsFrom)
|
|
.append(", type=").append(type)
|
|
.append(", inheritedAcl=").append(inheritedAcl)
|
|
.append(", isVersioned=").append(isVersioned)
|
|
.append(", requiresVersion=").append(requiresVersion)
|
|
.append(", aclChangeSet=").append(aclChangeSet)
|
|
.append("]");
|
|
return sb.toString();
|
|
}
|
|
}
|