001/*
002 * jPOS Project [http://jpos.org]
003 * Copyright (C) 2000-2026 jPOS Software SRL
004 *
005 * This program is free software: you can redistribute it and/or modify
006 * it under the terms of the GNU Affero General Public License as
007 * published by the Free Software Foundation, either version 3 of the
008 * License, or (at your option) any later version.
009 *
010 * This program is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013 * GNU Affero General Public License for more details.
014 *
015 * You should have received a copy of the GNU Affero General Public License
016 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
017 */
018
019package org.jpos.space;
020
021/**
022 * Intercepts space operations.
023 *
024 * @author Alejandro Revilla
025 * @since  1.4.7
026 */
027public class SpaceInterceptor<K,V> implements Space<K,V> {
028    protected Space<K,V> sp;
029    public SpaceInterceptor (Space<K,V> sp) {
030        super();
031        this.sp = sp;
032    }
033    public void out (K key, V value) {
034        sp.out (key, value);
035    }
036    public void out (K key, V value, long timeout) {
037        sp.out (key, value, timeout);
038    }
039    public void push (K key, V value) {
040        sp.push (key, value);
041    }
042    public void push (K key, V value, long timeout) {
043        sp.push (key, value, timeout);
044    }
045    public void put (K key, V value) {
046        sp.put (key, value);
047    }
048    public void put (K key, V value, long timeout) {
049        sp.put (key, value, timeout);
050    }    
051    public V in  (K key) {
052        return sp.in (key);
053    }
054    public V rd  (K key) {
055        return sp.rd (key);
056    }
057    public V in  (K key, long timeout) {
058        return sp.in (key, timeout);
059    }
060    public V rd  (K key, long timeout) {
061        return sp.rd (key, timeout);
062    }
063    public V inp (K key) {
064        return sp.inp (key);
065    }
066    public V rdp (K key) {
067        return sp.rdp (key);
068    }
069    @Override
070    public void nrd(K key) {
071        sp.nrd(key);
072    }
073    @Override
074    public V nrd(K key, long timeout) {
075        return sp.nrd(key, timeout);
076    }
077
078    public boolean existAny (K[] keys) {
079        return sp.existAny (keys);
080    }
081    public boolean existAny (K[] keys, long timeout) {
082        return sp.existAny (keys, timeout);
083    }
084}