Examples of RetentionBean


Examples of org.wso2.carbon.registry.properties.beans.RetentionBean

     */
    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;
    }
View Full Code Here

Examples of org.wso2.carbon.registry.properties.stub.beans.xsd.RetentionBean

        }
    }

    public boolean setRetentionProperties(HttpServletRequest request) {
        try {
            RetentionBean bean;
            String path = request.getParameter("path");
            String fromDate = request.getParameter("fromDate");
            if (fromDate == null || "".equals(fromDate)) {
                bean = null;
            } else {
                bean = new RetentionBean();
                bean.setFromDate(fromDate);
                bean.setToDate(request.getParameter("toDate"));
                String lockedOperationsParam = request.getParameter("lockedOperations");
                bean.setWriteLocked(lockedOperationsParam.contains("write"));
                bean.setDeleteLocked(lockedOperationsParam.contains("delete"));
            }
            stub.setRetentionProperties(path, bean);
        } catch (Exception e) {
            log.error("Failed to add retention: " + e.getMessage(), e);
            return false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.