01: /*
02: * $Id: IdempotentMessageIdStore.java 10489 2008-01-23 17:53:38Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
10:
11: package org.mule.api.routing;
12:
13: import org.mule.routing.inbound.IdempotentInMemoryMessageIdStore;
14: import org.mule.routing.inbound.IdempotentReceiver;
15:
16: /**
17: * <code>IdempotentMessageIdStore</code> is the main interface used by
18: * {@link IdempotentReceiver} for storing received message IDs.
19: *
20: * @see {@link IdempotentInMemoryMessageIdStore}
21: */
22: public interface IdempotentMessageIdStore {
23: /**
24: * Check whether the given ID is already registered with this store.
25: *
26: * @param id the ID to check
27: * @return <code>true</code> if the ID is stored or <code>false</code> if it could
28: * not be found
29: * @throws IllegalArgumentException if the given ID is <code>null</code>
30: * @throws Exception if any implementation-specific error occured, e.g. when the store
31: * is not available
32: */
33: boolean containsId(Object id) throws IllegalArgumentException,
34: Exception;
35:
36: /**
37: * Store the given ID.
38: *
39: * @param id the ID to store
40: * @return <code>true</code> if the ID was stored properly, or <code>false</code>
41: * if it already existed
42: * @throws IllegalArgumentException if the given ID cannot be stored or is
43: * <code>null</code>
44: * @throws Exception if the store is not available or any other
45: * implementation-specific error occured
46: */
47: boolean storeId(Object id) throws IllegalArgumentException,
48: Exception;
49: }
|