Package org.apache.slide.webdav.event

Examples of org.apache.slide.webdav.event.WebdavEvent$Subscribe


            if (!overwrite && destinationExistsBefore) {
                int statusCode = WebdavStatus.SC_PRECONDITION_FAILED;
                sendError( statusCode, getClass().getName()+".noOverwrite", new Object[]{destinationUri} );
                throw new WebdavException( statusCode );
            }
            if ( WebdavEvent.MOVE.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.MOVE, new WebdavEvent(this));

            macro.move(slideToken, sourceUri, destinationUri, macroParameters, null, this, null, this);

            if (overwrite && destinationExistsBefore) {
                resp.setStatus(WebdavStatus.SC_NO_CONTENT);
View Full Code Here


            if( destUh.isWorkspaceUri()        ||
               destUh.isWorkingresourceUri()
              ) {
                // COPY on existing WSs or WRs is *not* restricted !!!
                try {
                    if ( WebdavEvent.COPY.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.COPY, new WebdavEvent(this));
                   
                    content.retrieve(slideToken, destinationUri);
                    sendError = false;
                }
                catch( SlideException x ) {
View Full Code Here

    protected void executeRequest() throws WebdavException {
       
        SearchQueryResult result = null;
       
        try {
            if ( WebdavEvent.SEARCH.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.SEARCH, new WebdavEvent(this));

            resp.setContentType (TEXT_XML_UTF_8);
           
            result = searchHelper.search (slideToken, searchQuery);
            WebdavResult webdavResult = new WebdavResult (result, retriever);
View Full Code Here

            if (isExcludedForVersionControl(resourcePath)) {
                throw new ForbiddenException(
                    resourcePath,
                    new Exception("The resource path has been excluded from version-control") );
            }
            if ( WebdavEvent.VERSION_CONTROL.isEnabled() ) EventDispatcher.getInstance().fireVetoableEvent(WebdavEvent.VERSION_CONTROL, new WebdavEvent(this));

            VersioningHelper vh = VersioningHelper.getVersioningHelper(
                slideToken, token, req, resp, getConfig() );
            if( existingVersionPath == null )
                vh.versionControl( resourcePath );
View Full Code Here

public class SubscribeParseTest extends TestCase {

    protected JAXBContext context;

    public void testParseXmlBeansUsingURL() throws Exception {
        Subscribe doc = (Subscribe) context.createUnmarshaller().unmarshal(getClass().getResource("wsn-subscribe.xml"));

        System.out.println("Parsed: " + doc);
        System.out.println("Addresss: " + doc.getConsumerReference().getAddress().getValue());
    }
View Full Code Here

     * (non-Javadoc)
     *
     * @see org.springframework.beans.factory.FactoryBean#getObject()
     */
    public Object getObject() throws Exception {
        Subscribe subscribe = new Subscribe();
        subscribe.setConsumerReference(AbstractWSAClient.createWSA(consumer));
        subscribe.setFilter(new FilterType());
        if (topic != null) {
            TopicExpressionType topicExp = new TopicExpressionType();
            topicExp.getContent().add(topic);
            subscribe.getFilter().getAny().add(
                    new JAXBElement<TopicExpressionType>(AbstractSubscription.QNAME_TOPIC_EXPRESSION,
                            TopicExpressionType.class, topicExp));
        }
        if (xpath != null) {
            QueryExpressionType xpathExp = new QueryExpressionType();
            xpathExp.setDialect(AbstractSubscription.XPATH1_URI);
            xpathExp.getContent().add(xpath);
            subscribe.getFilter().getAny().add(
                    new JAXBElement<QueryExpressionType>(AbstractSubscription.QNAME_MESSAGE_CONTENT,
                            QueryExpressionType.class, xpathExp));
        }
        if (raw) {
            subscribe.setSubscriptionPolicy(new Subscribe.SubscriptionPolicy());
            subscribe.getSubscriptionPolicy().getAny().add(new UseRaw());
        }
        return subscribe;
    }
View Full Code Here

    }

    public Subscription subscribe(EndpointReferenceType consumer, String topic,
                                  String xpath, boolean raw) throws JBIException {

        Subscribe subscribeRequest = new Subscribe();
        subscribeRequest.setConsumerReference(consumer);
        subscribeRequest.setFilter(new FilterType());
        if (topic != null) {
            TopicExpressionType topicExp = new TopicExpressionType();
            topicExp.getContent().add(topic);
            subscribeRequest.getFilter().getAny().add(
                    new JAXBElement<TopicExpressionType>(AbstractSubscription.QNAME_TOPIC_EXPRESSION,
                            TopicExpressionType.class, topicExp));
        }
        if (xpath != null) {
            QueryExpressionType xpathExp = new QueryExpressionType();
            xpathExp.setDialect(AbstractSubscription.XPATH1_URI);
            xpathExp.getContent().add(xpath);
            subscribeRequest.getFilter().getAny().add(
                    new JAXBElement<QueryExpressionType>(AbstractSubscription.QNAME_MESSAGE_CONTENT,
                            QueryExpressionType.class, xpathExp));
        }
        if (raw) {
            subscribeRequest.setSubscriptionPolicy(new Subscribe.SubscriptionPolicy());
            subscribeRequest.getSubscriptionPolicy().getAny().add(new UseRaw());
        }
        SubscribeResponse response = (SubscribeResponse) request(subscribeRequest);
        return new Subscription(response.getSubscriptionReference(), getClient());
    }
View Full Code Here

        subscription = new DummySubscription("mySubscription");
    }

    protected Subscribe getSubscription(String file) throws JAXBException, IOException {
        InputStream is = getClass().getResourceAsStream(file);
        Subscribe subscribe = (Subscribe) unmarshaller.unmarshal(is);
        is.close();
        return subscribe;
    }
View Full Code Here

        is.close();
        return subscribe;
    }

    public void testWithNilITT() throws Exception {
        Subscribe subscribe = getSubscription("subscribe-nil-itt.xml");
        subscription.validateSubscription(subscribe);
    }
View Full Code Here

        Subscribe subscribe = getSubscription("subscribe-nil-itt.xml");
        subscription.validateSubscription(subscribe);
    }

    public void testWithAbsoluteITT() throws Exception {
        Subscribe subscribe = getSubscription("subscribe-abs-itt.xml");
        try {
            subscription.validateSubscription(subscribe);
            fail("Invalid initial termination time used. Fault was expected.");
        } catch (UnacceptableInitialTerminationTimeFault e) {
            // OK
View Full Code Here

TOP

Related Classes of org.apache.slide.webdav.event.WebdavEvent$Subscribe

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.