001    /**
002     * Copyright (c) 2010 Yahoo! Inc. All rights reserved.
003     * Licensed under the Apache License, Version 2.0 (the "License");
004     * you may not use this file except in compliance with the License.
005     * You may obtain a copy of the License at
006     *
007     *   http://www.apache.org/licenses/LICENSE-2.0
008     *
009     *  Unless required by applicable law or agreed to in writing, software
010     *  distributed under the License is distributed on an "AS IS" BASIS,
011     *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012     *  See the License for the specific language governing permissions and
013     *  limitations under the License. See accompanying LICENSE file.
014     */
015    package org.apache.oozie.command.coord;
016    
017    import java.util.List;
018    import java.util.Map;
019    
020    import org.apache.oozie.CoordinatorJobBean;
021    import org.apache.oozie.CoordinatorJobInfo;
022    import org.apache.oozie.DagEngineException;
023    import org.apache.oozie.command.CommandException;
024    import org.apache.oozie.command.wf.JobCommand;
025    import org.apache.oozie.store.CoordinatorStore;
026    import org.apache.oozie.store.StoreException;
027    import org.apache.oozie.util.ParamChecker;
028    import org.apache.oozie.util.XLog;
029    
030    public class CoordJobsCommand extends CoordinatorCommand<CoordinatorJobInfo> {
031        private Map<String, List<String>> filter;
032        private int start;
033        private int len;
034    
035        public CoordJobsCommand(Map<String, List<String>> filter, int start, int length) {
036            super("job.info", "job.info", 1, XLog.OPS);
037            this.filter = filter;
038            this.start = start;
039            this.len = length;
040        }
041    
042        @Override
043        protected CoordinatorJobInfo call(CoordinatorStore store) throws StoreException, CommandException {
044            CoordinatorJobInfo coord = store.getCoordinatorInfo(filter, start, len);
045            // workflow.setConsoleUrl(getJobConsoleUrl(id));
046            // workflow.setActions((List) store.getActionsForWorkflow(id,
047            // false));
048            return coord;
049        }
050    }