All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.camel.spi.ClaimCheckRepository Maven / Gradle / Ivy

There is a newer version: 4.6.0
Show newest version
/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.camel.spi;

import org.apache.camel.Exchange;
import org.apache.camel.Service;

/**
 * Access to a repository of keys to implement the
 * Claim Check pattern.
 * 

* The add and contains methods is operating according to the {@link java.util.Map} contract, * and the push and pop methods is operating according to the {@link java.util.Stack} contract. *

* See important details about the Claim Check EIP implementation in Apache Camel at {@link org.apache.camel.processor.ClaimCheckProcessor}. */ public interface ClaimCheckRepository extends Service { /** * Adds the exchange to the repository. * * @param key the claim check key * @return true if this repository did not already contain the specified key */ boolean add(String key, Exchange exchange); /** * Returns true if this repository contains the specified key. * * @param key the claim check key * @return true if this repository contains the specified key */ boolean contains(String key); /** * Gets the exchange from the repository. * * @param key the claim check key */ Exchange get(String key); /** * Gets and removes the exchange from the repository. * * @param key the claim check key * @return the removed exchange, or null if the key did not exists. */ Exchange getAndRemove(String key); /** * Pushes the exchange on top of the repository. */ void push(Exchange exchange); /** * Pops the repository and returns the latest. Or returns null if the stack is empty. */ Exchange pop(); /** * Clear the repository. */ void clear(); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy