001    /*
002     * JBoss, Home of Professional Open Source.
003     * Copyright 2008, Red Hat Middleware LLC, and individual contributors
004     * as indicated by the @author tags. See the copyright.txt file in the
005     * distribution for a full listing of individual contributors. 
006     *
007     * This is free software; you can redistribute it and/or modify it
008     * under the terms of the GNU Lesser General Public License as
009     * published by the Free Software Foundation; either version 2.1 of
010     * the License, or (at your option) any later version.
011     *
012     * This software is distributed in the hope that it will be useful,
013     * but WITHOUT ANY WARRANTY; without even the implied warranty of
014     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015     * Lesser General Public License for more details.
016     *
017     * You should have received a copy of the GNU Lesser General Public
018     * License along with this software; if not, write to the Free
019     * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020     * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021     */
022    package org.jboss.dna.graph.commands.executor;
023    
024    import org.jboss.dna.graph.commands.CompositeCommand;
025    import org.jboss.dna.graph.commands.CopyBranchCommand;
026    import org.jboss.dna.graph.commands.CopyNodeCommand;
027    import org.jboss.dna.graph.commands.CreateNodeCommand;
028    import org.jboss.dna.graph.commands.DeleteBranchCommand;
029    import org.jboss.dna.graph.commands.GetChildrenCommand;
030    import org.jboss.dna.graph.commands.GetNodeCommand;
031    import org.jboss.dna.graph.commands.GetPropertiesCommand;
032    import org.jboss.dna.graph.commands.GraphCommand;
033    import org.jboss.dna.graph.commands.MoveBranchCommand;
034    import org.jboss.dna.graph.commands.RecordBranchCommand;
035    import org.jboss.dna.graph.commands.SetPropertiesCommand;
036    import org.jboss.dna.graph.connectors.RepositorySourceException;
037    
038    /**
039     * @author Randall Hauch
040     */
041    public class DelegatingCommandExecutor implements CommandExecutor {
042    
043        private final CommandExecutor delegate;
044    
045        public DelegatingCommandExecutor( CommandExecutor delegate ) {
046            assert delegate != null;
047            this.delegate = delegate;
048        }
049    
050        /**
051         * {@inheritDoc}
052         * 
053         * @see org.jboss.dna.graph.commands.executor.CommandExecutor#close()
054         */
055        public void close() {
056            delegate.close();
057        }
058    
059        /**
060         * {@inheritDoc}
061         * 
062         * @see org.jboss.dna.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.graph.commands.GraphCommand)
063         */
064        public void execute( GraphCommand command ) throws RepositorySourceException {
065            delegate.execute(command);
066        }
067    
068        /**
069         * {@inheritDoc}
070         * 
071         * @see org.jboss.dna.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.graph.commands.CompositeCommand)
072         */
073        public void execute( CompositeCommand command ) throws RepositorySourceException {
074            delegate.execute(command);
075        }
076    
077        /**
078         * {@inheritDoc}
079         * 
080         * @see org.jboss.dna.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.graph.commands.GetNodeCommand)
081         */
082        public void execute( GetNodeCommand command ) throws RepositorySourceException {
083            delegate.execute(command);
084        }
085    
086        /**
087         * {@inheritDoc}
088         * 
089         * @see org.jboss.dna.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.graph.commands.GetPropertiesCommand)
090         */
091        public void execute( GetPropertiesCommand command ) throws RepositorySourceException {
092            delegate.execute(command);
093        }
094    
095        /**
096         * {@inheritDoc}
097         * 
098         * @see org.jboss.dna.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.graph.commands.GetChildrenCommand)
099         */
100        public void execute( GetChildrenCommand command ) throws RepositorySourceException {
101            delegate.execute(command);
102        }
103    
104        /**
105         * {@inheritDoc}
106         * 
107         * @see org.jboss.dna.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.graph.commands.CreateNodeCommand)
108         */
109        public void execute( CreateNodeCommand command ) throws RepositorySourceException {
110            delegate.execute(command);
111        }
112    
113        /**
114         * {@inheritDoc}
115         * 
116         * @see org.jboss.dna.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.graph.commands.SetPropertiesCommand)
117         */
118        public void execute( SetPropertiesCommand command ) throws RepositorySourceException {
119            delegate.execute(command);
120        }
121    
122        /**
123         * {@inheritDoc}
124         * 
125         * @see org.jboss.dna.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.graph.commands.CopyNodeCommand)
126         */
127        public void execute( CopyNodeCommand command ) throws RepositorySourceException {
128            delegate.execute(command);
129        }
130    
131        /**
132         * {@inheritDoc}
133         * 
134         * @see org.jboss.dna.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.graph.commands.CopyBranchCommand)
135         */
136        public void execute( CopyBranchCommand command ) throws RepositorySourceException {
137            delegate.execute(command);
138        }
139    
140        /**
141         * {@inheritDoc}
142         * 
143         * @see org.jboss.dna.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.graph.commands.RecordBranchCommand)
144         */
145        public void execute( RecordBranchCommand command ) throws RepositorySourceException {
146            delegate.execute(command);
147        }
148    
149        /**
150         * {@inheritDoc}
151         * 
152         * @see org.jboss.dna.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.graph.commands.DeleteBranchCommand)
153         */
154        public void execute( DeleteBranchCommand command ) throws RepositorySourceException {
155            delegate.execute(command);
156        }
157    
158        /**
159         * {@inheritDoc}
160         * 
161         * @see org.jboss.dna.graph.commands.executor.CommandExecutor#execute(org.jboss.dna.graph.commands.MoveBranchCommand)
162         */
163        public void execute( MoveBranchCommand command ) throws RepositorySourceException {
164            delegate.execute(command);
165        }
166    
167    }