Package org.apache.james.mailbox.jcr.user.model

Examples of org.apache.james.mailbox.jcr.user.model.JCRSubscription


            QueryManager manager = getSession().getWorkspace().getQueryManager();
            QueryResult result = manager.createQuery(queryString, Query.XPATH).execute();
           
            NodeIterator nodeIt = result.getNodes();
            if (nodeIt.hasNext()) {
                JCRSubscription sub = new JCRSubscription(nodeIt.nextNode(), mailbox, getLogger());
                return sub;
            }
           
        } catch (PathNotFoundException e) {
            // nothing todo here
View Full Code Here


            while (nodeIt.hasNext()) {
                Node node = nodeIt.nextNode();
                if (node.hasProperty(JCRSubscription.MAILBOXES_PROPERTY)) {
                    Value[] values = node.getProperty(JCRSubscription.MAILBOXES_PROPERTY).getValues();
                    for (int i = 0; i < values.length; i++) {
                        subList.add(new JCRSubscription(node, values[i].getString(), getLogger()));
                    }
                }
            }
        } catch (PathNotFoundException e) {
            // Do nothing just return the empty list later
View Full Code Here

        String mailbox = subscription.getMailbox();
        try {

            Node node = null;
        
            JCRSubscription sub = (JCRSubscription) findMailboxSubscriptionForUser(username, mailbox);
           
            // its a new subscription
            if (sub == null) {
                node = JcrUtils.getOrAddNode(getSession().getRootNode(), MAILBOXES_PATH);
                node = JcrUtils.getOrAddNode(node, Text.escapeIllegalJcrChars(MailboxConstants.USER_NAMESPACE));

                // This is needed to minimize the child nodes a bit
                node = createUserPathStructure(node, Text.escapeIllegalJcrChars(username));
            } else {
                node = sub.getNode();
            }
           
            // Copy new properties to the node
            ((JCRSubscription)subscription).merge(node);
View Full Code Here

TOP

Related Classes of org.apache.james.mailbox.jcr.user.model.JCRSubscription

Copyright © 2018 www.massapicom. 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.