001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */package org.apache.cxf.ws.rm.persistence;
019:
020: import java.math.BigInteger;
021: import java.util.Collection;
022:
023: import org.apache.cxf.ws.rm.DestinationSequence;
024: import org.apache.cxf.ws.rm.Identifier;
025: import org.apache.cxf.ws.rm.SourceSequence;
026:
027: public interface RMStore {
028:
029: /**
030: * Create a source sequence in the persistent store, with the sequence attributes as specified in the
031: * <code>RMSourceSequence</code> object.
032: * @param seq the sequence
033: */
034: void createSourceSequence(SourceSequence seq);
035:
036: /**
037: * Create a destination sequence in the persistent store, with the sequence attributes as specified in the
038: * <code>RMSDestinationSequence</code> object.
039: * @param seq the sequence
040: */
041: void createDestinationSequence(DestinationSequence seq);
042:
043: /**
044: * Remove the source sequence with the specified identifier from persistent store.
045: * @param seq the sequence
046: */
047: void removeSourceSequence(Identifier seq);
048:
049: /**
050: * Remove the destination sequence with the specified identifier from persistent store.
051: * @param seq the sequence
052: */
053: void removeDestinationSequence(Identifier seq);
054:
055: /**
056: * Retrieves all sequences managed by the identified RM source endpoint
057: * from persistent store.
058: *
059: * @param endpointIdentifier the identifier for the source
060: * @return the collection of sequences
061: */
062: Collection<SourceSequence> getSourceSequences(
063: String endpointIdentifier);
064:
065: /**
066: * Retrieves all sequences managed by the identified RM destination endpoint
067: * from persistent store.
068: *
069: * @param endpointIdentifier the identifier for the destination
070: * @return the collection of sequences
071: */
072: Collection<DestinationSequence> getDestinationSequences(
073: String endpointIdentifier);
074:
075: /**
076: * Retrieves the outbound/inbound messages stored for the source/destination sequence with
077: * the given identifier.
078: * @param sid the source sequence identifier
079: * @param outbound true if the message is outbound
080: * @return the collection of messages
081: * *
082: */
083: Collection<RMMessage> getMessages(Identifier sid, boolean outbound);
084:
085: /**
086: * Called by an RM source upon processing an outbound message. The <code>RMMessage</code>
087: * parameter is null for non application (RM protocol) messages.
088: *
089: * @param seq the source sequence
090: * @param msg the outgoing message
091: */
092: void persistOutgoing(SourceSequence seq, RMMessage msg);
093:
094: /**
095: * Called by an RM source upon processing an outbound message. The <code>RMMessage</code>
096: * parameter is null for non application (RM protocol) messages.
097: *
098: * @param seq the destination sequence
099: * @param msg the incoming message
100: */
101: void persistIncoming(DestinationSequence seq, RMMessage msg);
102:
103: /**
104: * Removes the messages with the given message numbers and identifiers from the store of
105: * outbound/inbound messages.
106: *
107: * @param sid the identifier of the source sequence
108: * @param messageNrs the collection of message numbers
109: * @param outbound true if the message is outbound
110: */
111: void removeMessages(Identifier sid,
112: Collection<BigInteger> messageNrs, boolean outbound);
113: }
|