source: contrib/psync/src/main/java/br/com/prognus/psync/synclet/StopProcessingSynclet.java @ 1009

Revision 1009, 2.3 KB checked in by wmerlotto, 15 years ago (diff)

Ticket #554 - Commit da versão inicial do psync.

Line 
1/**
2 * Copyright (C) 2003-2007 Funambol
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the Honest Public License.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 * Honest Public License for more details.
11 *
12 * You should have received a copy of the Honest Public License
13 * along with this program; if not, write to Funambol,
14 * 643 Bair Island Road, Suite 305 - Redwood City, CA 94063, USA
15 */
16package br.com.prognus.psync.synclet;
17
18import com.funambol.framework.core.SyncML;
19import com.funambol.framework.core.Sync4jException;
20import com.funambol.framework.engine.pipeline.InputMessageProcessor;
21import com.funambol.framework.engine.pipeline.OutputMessageProcessor;
22import com.funambol.framework.engine.pipeline.MessageProcessingContext;
23import com.funambol.framework.engine.pipeline.StopProcessingException;
24
25/**
26 * This synclet simply throws a StopProcessingException at each call. It can be
27 * useful for debugging purposes.
28 *
29 * @version $Id: StopProcessingSynclet.java,v 1.2 2007-01-11 19:20:19 nichele Exp $
30 */
31public class StopProcessingSynclet
32implements InputMessageProcessor, OutputMessageProcessor {
33
34    // ---------------------------------------------------------- Public methods
35
36    /**
37     * Throws a StopProcessingException.
38     *
39     * @param processingContext the message processing context
40     * @param message the message to be processed
41     *
42     * @throws Sync4jException
43     */
44    public void preProcessMessage(MessageProcessingContext processingContext,
45                                  SyncML                   message)
46    throws Sync4jException {
47        throw new StopProcessingException("Please stop input procesing!");
48    }
49
50    /**
51     * Logs the output message and context
52     *
53     * @param processingContext the message processing context
54     * @param message the message to be processed
55     *
56     * @throws Sync4jException
57     */
58    public void postProcessMessage(MessageProcessingContext processingContext,
59                                   SyncML                   message)
60    throws Sync4jException {
61        throw new StopProcessingException("Please stop output procesing!");
62    }
63
64
65}
Note: See TracBrowser for help on using the repository browser.