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.ExecutionContext;
025    import org.jboss.dna.graph.commands.CompositeCommand;
026    import org.jboss.dna.graph.commands.CopyBranchCommand;
027    import org.jboss.dna.graph.commands.CopyNodeCommand;
028    import org.jboss.dna.graph.commands.CreateNodeCommand;
029    import org.jboss.dna.graph.commands.DeleteBranchCommand;
030    import org.jboss.dna.graph.commands.GetChildrenCommand;
031    import org.jboss.dna.graph.commands.GetNodeCommand;
032    import org.jboss.dna.graph.commands.GetPropertiesCommand;
033    import org.jboss.dna.graph.commands.GraphCommand;
034    import org.jboss.dna.graph.commands.MoveBranchCommand;
035    import org.jboss.dna.graph.commands.RecordBranchCommand;
036    import org.jboss.dna.graph.commands.SetPropertiesCommand;
037    import org.jboss.dna.graph.connectors.RepositorySource;
038    import org.jboss.dna.graph.connectors.RepositorySourceException;
039    import org.jboss.dna.graph.properties.DateTime;
040    
041    /**
042     * @author Randall Hauch
043     */
044    public class NoOpCommandExecutor extends AbstractCommandExecutor {
045    
046        /**
047         * Create a command executor that does nothing.
048         * 
049         * @param context the execution context in which the executor will be run; may not be null
050         * @param sourceName the name of the {@link RepositorySource} that is making use of this executor; may not be null or empty
051         */
052        public NoOpCommandExecutor( ExecutionContext context,
053                                    String sourceName ) {
054            super(context, sourceName);
055        }
056    
057        /**
058         * Create a command executor that does nothing.
059         * 
060         * @param context the execution context in which the executor will be run; may not be null
061         * @param sourceName the name of the {@link RepositorySource} that is making use of this executor; may not be null or empty
062         * @param now the current time; may be null if the system time is to be used
063         */
064        public NoOpCommandExecutor( ExecutionContext context,
065                                    String sourceName,
066                                    DateTime now ) {
067            super(context, sourceName, now);
068        }
069    
070        /**
071         * {@inheritDoc}
072         * 
073         * @see org.jboss.dna.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.graph.commands.GraphCommand)
074         */
075        @Override
076        public void execute( GraphCommand command ) throws RepositorySourceException {
077            // do nothing
078        }
079    
080        /**
081         * {@inheritDoc}
082         * 
083         * @see org.jboss.dna.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.graph.commands.CompositeCommand)
084         */
085        @Override
086        public void execute( CompositeCommand command ) throws RepositorySourceException {
087            // do nothing
088        }
089    
090        /**
091         * {@inheritDoc}
092         * 
093         * @see org.jboss.dna.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.graph.commands.GetNodeCommand)
094         */
095        @Override
096        public void execute( GetNodeCommand command ) throws RepositorySourceException {
097            // do nothing
098        }
099    
100        /**
101         * {@inheritDoc}
102         * 
103         * @see org.jboss.dna.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.graph.commands.CopyBranchCommand)
104         */
105        @Override
106        public void execute( CopyBranchCommand command ) throws RepositorySourceException {
107            // do nothing
108        }
109    
110        /**
111         * {@inheritDoc}
112         * 
113         * @see org.jboss.dna.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.graph.commands.CopyNodeCommand)
114         */
115        @Override
116        public void execute( CopyNodeCommand command ) throws RepositorySourceException {
117            // do nothing
118        }
119    
120        /**
121         * {@inheritDoc}
122         * 
123         * @see org.jboss.dna.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.graph.commands.CreateNodeCommand)
124         */
125        @Override
126        public void execute( CreateNodeCommand command ) throws RepositorySourceException {
127            // do nothing
128        }
129    
130        /**
131         * {@inheritDoc}
132         * 
133         * @see org.jboss.dna.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.graph.commands.DeleteBranchCommand)
134         */
135        @Override
136        public void execute( DeleteBranchCommand command ) throws RepositorySourceException {
137            // do nothing
138        }
139    
140        /**
141         * {@inheritDoc}
142         * 
143         * @see org.jboss.dna.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.graph.commands.GetChildrenCommand)
144         */
145        @Override
146        public void execute( GetChildrenCommand command ) throws RepositorySourceException {
147            // do nothing
148        }
149    
150        /**
151         * {@inheritDoc}
152         * 
153         * @see org.jboss.dna.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.graph.commands.GetPropertiesCommand)
154         */
155        @Override
156        public void execute( GetPropertiesCommand command ) throws RepositorySourceException {
157            // do nothing
158        }
159    
160        /**
161         * {@inheritDoc}
162         * 
163         * @see org.jboss.dna.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.graph.commands.MoveBranchCommand)
164         */
165        @Override
166        public void execute( MoveBranchCommand command ) throws RepositorySourceException {
167            // do nothing
168        }
169    
170        /**
171         * {@inheritDoc}
172         * 
173         * @see org.jboss.dna.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.graph.commands.RecordBranchCommand)
174         */
175        @Override
176        public void execute( RecordBranchCommand command ) throws RepositorySourceException {
177            // do nothing
178        }
179    
180        /**
181         * {@inheritDoc}
182         * 
183         * @see org.jboss.dna.graph.commands.executor.AbstractCommandExecutor#execute(org.jboss.dna.graph.commands.SetPropertiesCommand)
184         */
185        @Override
186        public void execute( SetPropertiesCommand command ) throws RepositorySourceException {
187            // do nothing
188        }
189    }