@@ -0,0 +1,2972 @@
+/*-%0A * #%25L%0A * %25%25%0A * Copyright (C) 2018 BMW Car IT GmbH%0A * %25%25%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A * #L%25%0A */%0Apackage io.joynr.messaging.routing;%0A%0Aimport java.util.Set;%0A%0A/**%0A * You can provide an implementation of this interface in order to be given the chance to persist messages being%0A * added to the %7B@link MessageQueue%7D so that if the joynr runtime quits unexpectedly, the messages in the queue%0A * are not lost and can be restored on the next start of the runtime.%0A */%0Apublic interface MessagePersister %7B%0A%0A    /**%0A     * Called with the message to be persisted. If the implementation does not want to persist the message, it%0A     * should return %3Ccode%3Efalse%3C/code%3E. Implementations of this method can block until the persisting was%0A     * successful, but be aware that this might impact performance.%0A     *%0A     * @param messageQueueId the unique ID of the message queue for which the message is being persisted%0A     * @param message the message which is a candidate for persisting%0A     * @return %3Ccode%3Etrue%3C/code%3E if the message is persisted, %3Ccode%3Efalse%3C/code%3E if not.%0A     */%0A    boolean persist(String messageQueueId, DelayableImmutableMessage message);%0A%0A    /**%0A     * Fetches all messages from persistence which have not yet been %7B@link #remove(String,DelayableImmutableMessage)%7D.%0A     * The %7B@link MessageQueue%7D will call this during startup to fetch any messages which were persisted but not%0A     * consumed during a previous lifetime of the joynr runtime in order to re-add them to the queue.%0A     *%0A     * @param messageQueueId the ID of the message queue for which to fetch the persisted messages.%0A     * @return the set of messages which were previously added by the IDed message queue, but were not consumed.%0A     */%0A    Set%3CDelayableImmutableMessage%3E fetchAll(String messageQueueId);%0A%0A    /**%0A     * Called once the message queue has actually processed the message previously added to the persistence by calling%0A     * %7B@link #persist(String,DelayableImmutableMessage)%7D.%0A     * The implementation of this method should ensure that the message is actually removed%0A     * from the persistence, and should block until this has been done successfully.%0A     *%0A     * @param messageQueueId the ID of the message queue which consumed the message.%0A     * @param message the message which has been consumed by the queue and should be removed from persistence.%0A     */%0A    void remove(String messageQueueId, DelayableImmutableMessage message);%0A%7D%0A

Add MessagePersister interface