REPO-164 / REPO-1086 - V1 REST API: Lock Node

- review suggestions
   - added more test cases + utility methods

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@129751 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ancuta Morarasu
2016-08-22 13:10:19 +00:00
parent c83c0521b2
commit ecec348d6c
4 changed files with 102 additions and 59 deletions

View File

@@ -27,12 +27,14 @@ package org.alfresco.rest.api.model;
import org.alfresco.repo.lock.mem.Lifetime;
import org.alfresco.service.cmr.lock.LockType;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
/**
* Representation of a lock info
*
* @author Ancuta Morarasu
*/
@JsonIgnoreProperties({"mappedType"})
public class LockInfo
{
private Integer timeToExpire;
@@ -85,10 +87,15 @@ public class LockInfo
return includeChildren;
}
public LockType getType()
public LockType getMappedType()
{
return type != null ? type.getType() : null;
}
public LockType2 getType()
{
return type;
}
public void setType(String type)
{
@@ -110,9 +117,9 @@ public class LockInfo
{
final StringBuilder sb = new StringBuilder("LockInfo{");
sb.append("includeChildren='").append(includeChildren).append('\'');
sb.append(", timeToExpire=").append(timeToExpire).append('\'');
sb.append(", type=").append(type).append('\'');
sb.append(", lifetime=").append(lifetime).append('\'');
sb.append(", timeToExpire='").append(timeToExpire).append('\'');
sb.append(", type='").append(type).append('\'');
sb.append(", lifetime='").append(lifetime).append('\'');
sb.append('}');
return sb.toString();
}