public boolean setRetentionProperties(String path, String mode, String fromDate, String toDate) throws RemoteException, PropertiesAdminServiceRegistryExceptionException { RetentionBean retentionBean = new RetentionBean(); retentionBean.setWriteLocked(mode.contains("write")); retentionBean.setDeleteLocked(mode.contains("delete")); retentionBean.setFromDate(fromDate); retentionBean.setToDate(toDate); return propertiesAdminServiceStub.setRetentionProperties(path, retentionBean); }
/** * Utility method to write an element start tag. */ private void writeStartElement(java.lang.String prefix, java.lang.String namespace, java.lang.String localPart, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); if (writerPrefix != null) { xmlWriter.writeStartElement(namespace, localPart); } else { if (namespace.length() == 0) { prefix = ""; } else if (prefix == null) { prefix = generatePrefix(namespace); } xmlWriter.writeStartElement(prefix, localPart, namespace); xmlWriter.writeNamespace(prefix, namespace); xmlWriter.setPrefix(prefix, namespace); } }
new RetentionBean(); object.setDeleteLocked( org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); object.setFromDate( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); object.setReadOnly( org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content)); object.setToDate( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); object.setUserName( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); object.setWriteLocked( org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content));
public RetentionBean getRetentionProperties(String path) throws RemoteException, PropertiesAdminServiceRegistryExceptionException { RetentionBean retentionBean = new RetentionBean(); try { retentionBean = propertiesAdminServiceStub.getRetentionProperties(path); } catch (RemoteException e) { log.error("get retention properties failed ", e); throw new RemoteException("get retention properties failed ", e); } catch (PropertiesAdminServiceRegistryExceptionException e) { log.error("get retention properties failed ", e); throw new PropertiesAdminServiceRegistryExceptionException("get retention properties failed ", e); } return retentionBean; }
public RetentionBean getRetentionProperties(String path) throws RemoteException, PropertiesAdminServiceRegistryExceptionException { RetentionBean retentionBean = new RetentionBean(); try { retentionBean = propertiesAdminServiceStub.getRetentionProperties(path); } catch (RemoteException e) { log.error("get retention properties failed ", e); throw new RemoteException("get retention properties failed ", e); } catch (PropertiesAdminServiceRegistryExceptionException e) { log.error("get retention properties failed ", e); throw new PropertiesAdminServiceRegistryExceptionException("get retention properties failed ", e); } return retentionBean; }
public void setRetentionProperties(String path, String mode, String fromDate, String toDate) throws RemoteException, PropertiesAdminServiceRegistryExceptionException { RetentionBean retentionBean = new RetentionBean(); retentionBean.setWriteLocked(mode.contains("write")); retentionBean.setDeleteLocked(mode.contains("delete")); retentionBean.setFromDate(fromDate); retentionBean.setToDate(toDate); try { propertiesAdminServiceStub.setRetentionProperties(path, retentionBean); } catch (RemoteException e) { log.error("Set retention properties failed ", e); throw new RemoteException("Set retention properties failed ", e); } catch (PropertiesAdminServiceRegistryExceptionException e) { log.error("Set retention lock failed ", e); throw new PropertiesAdminServiceRegistryExceptionException("Set retention properties failed ", e); } }
public RetentionBean getRetentionProperties(String path) throws RemoteException, PropertiesAdminServiceRegistryExceptionException { RetentionBean retentionBean = new RetentionBean(); try { retentionBean = propertiesAdminServiceStub.getRetentionProperties(path); } catch (RemoteException e) { log.error("get retention properties failed ", e); throw new RemoteException("get retention properties failed ", e); } catch (PropertiesAdminServiceRegistryExceptionException e) { log.error("get retention properties failed ", e); throw new PropertiesAdminServiceRegistryExceptionException("get retention properties failed ", e); } return retentionBean; }
/** * Register a namespace prefix */ private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = xmlWriter.getPrefix(namespace); if (prefix == null) { prefix = generatePrefix(namespace); while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); } xmlWriter.writeNamespace(prefix, namespace); xmlWriter.setPrefix(prefix, namespace); } return prefix; }
public void setRetentionProperties(String path, String mode, String fromDate, String toDate) throws RemoteException, PropertiesAdminServiceRegistryExceptionException { RetentionBean retentionBean = new RetentionBean(); retentionBean.setWriteLocked(mode.contains("write")); retentionBean.setDeleteLocked(mode.contains("delete")); retentionBean.setFromDate(fromDate); retentionBean.setToDate(toDate); try { propertiesAdminServiceStub.setRetentionProperties(path, retentionBean); } catch (RemoteException e) { log.error("Set retention properties failed ", e); throw new RemoteException("Set retention properties failed ", e); } catch (PropertiesAdminServiceRegistryExceptionException e) { log.error("Set retention lock failed ", e); throw new PropertiesAdminServiceRegistryExceptionException("Set retention properties failed ", e); } }
public RetentionBean getRetentionProperties(String path) throws RemoteException, PropertiesAdminServiceRegistryExceptionException { RetentionBean retentionBean = new RetentionBean(); try { retentionBean = propertiesAdminServiceStub.getRetentionProperties(path); } catch (RemoteException e) { log.error("get retention properties failed ", e); throw new RemoteException("get retention properties failed ", e); } catch (PropertiesAdminServiceRegistryExceptionException e) { log.error("get retention properties failed ", e); throw new PropertiesAdminServiceRegistryExceptionException("get retention properties failed ", e); } return retentionBean; }
/** * method to handle Qnames */ private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String namespaceURI = qname.getNamespaceURI(); if (namespaceURI != null) { java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); if (prefix == null) { prefix = generatePrefix(namespaceURI); xmlWriter.writeNamespace(prefix, namespaceURI); xmlWriter.setPrefix(prefix,namespaceURI); } if (prefix.trim().length() > 0){ xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } else { // i.e this is the default namespace xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } } else { xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } }
public boolean setRetentionProperties(String path, String mode, String fromDate, String toDate) throws RemoteException, PropertiesAdminServiceRegistryExceptionException { RetentionBean retentionBean = new RetentionBean(); retentionBean.setWriteLocked(mode.contains("write")); retentionBean.setDeleteLocked(mode.contains("delete")); retentionBean.setFromDate(fromDate); retentionBean.setToDate(toDate); try { return propertiesAdminServiceStub.setRetentionProperties(path, retentionBean); } catch (RemoteException e) { log.error("Set retention properties failed ", e); throw new RemoteException("Set retention properties failed ", e); } catch (PropertiesAdminServiceRegistryExceptionException e) { log.error("Set retention lock failed ", e); throw new PropertiesAdminServiceRegistryExceptionException("Set retention properties failed ", e); } }
prefix = xmlWriter.getPrefix(namespaceURI); if ((prefix == null) || (prefix.length() == 0)) { prefix = generatePrefix(namespaceURI); xmlWriter.writeNamespace(prefix, namespaceURI); xmlWriter.setPrefix(prefix,namespaceURI);
/** * Method to set resource retention properties of a resource. * * @param request Http request with parameters. * @throws RegistryException throws if there is an error */ public boolean setRetentionProperties(HttpServletRequest request) throws RegistryException { String path = request.getParameter(PATH); try { RetentionBean bean; 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")); } propertAdminServicestub.setRetentionProperties(path, bean); } catch (RemoteException | PropertiesAdminServiceRegistryExceptionException e) { throw new RegistryException("Failed to add retention to resource at path" + path, e); } return true; }