001/*
002 * Licensed to DuraSpace under one or more contributor license agreements.
003 * See the NOTICE file distributed with this work for additional information
004 * regarding copyright ownership.
005 *
006 * DuraSpace licenses this file to you under the Apache License,
007 * Version 2.0 (the "License"); you may not use this file except in
008 * compliance 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, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018
019/*
020 * Copyright 2015 DuraSpace, Inc.
021 *
022 * Licensed under the Apache License, Version 2.0 (the "License");
023 * you may not use this file except in compliance with the License.
024 * You may obtain a copy of the License at
025 *
026 *     http://www.apache.org/licenses/LICENSE-2.0
027 *
028 * Unless required by applicable law or agreed to in writing, software
029 * distributed under the License is distributed on an "AS IS" BASIS,
030 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
031 * See the License for the specific language governing permissions and
032 * limitations under the License.
033 */
034package org.fcrepo.kernel.modeshape.utils.iterators;
035
036import com.google.common.util.concurrent.ListenableFuture;
037
038/**
039 * Implemented by something that can consume an {@link java.util.Iterator}. The
040 * assumption is that a reference to the appropriate iterator is managed as part
041 * of the state of any implementation.
042 * 
043 * @author ajs6f
044 * @since Oct 24, 2013
045 * @param <E> E
046 * @param <T> T
047 */
048public interface IteratorConsumer<E, T> {
049
050    /**
051     * Synchronous consumption.
052     */
053    void consume();
054
055    /**
056     * Asynchronous consumption.
057     *
058     * @return ListenableFuture
059     */
060    ListenableFuture<T> consumeAsync();
061
062}