*/
public RetentionBean getRetentionProperties(String path) throws RegistryException {
UserRegistry registry = (UserRegistry) getRootRegistry();
Resource resource = registry.get(path);
RetentionBean bean = new RetentionBean();
String userName = resource.getProperty(CommonConstants.RETENTION_USERNAME_PROP_NAME);
if (userName == null) {
/* Consistency is assumed. If this property is not set, that means no retention for that
resource
*/
return null;
}
bean.setUserName(userName);
bean.setFromDate(resource.getProperty(CommonConstants.RETENTION_FROM_DATE_PROP_NAME));
bean.setToDate(resource.getProperty(CommonConstants.RETENTION_TO_DATE_PROP_NAME));
bean.setWriteLocked(Boolean.parseBoolean(resource.getProperty(
CommonConstants.RETENTION_WRITE_LOCKED_PROP_NAME)));
bean.setDeleteLocked(Boolean.parseBoolean(resource.getProperty(
CommonConstants.RETENTION_DELETE_LOCKED_PROP_NAME)));
bean.setReadOnly(!userName.equals(registry.getUserName()));
return bean;
}