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;
016    
017    import java.util.List;
018    
019    /**
020     * Bean that contains the result for a workflows query.
021     */
022    public class WorkflowsInfo {
023        private int start;
024        private int len;
025        private int total;
026        private List<WorkflowJobBean> workflows;
027    
028        /**
029         * Create  a workflows info bean.
030         *
031         * @param workflows workflows being returned.
032         * @param start workflows offset.
033         * @param len number of workflows.
034         * @param total total workflows.
035         */
036        public WorkflowsInfo(List<WorkflowJobBean> workflows, int start, int len, int total) {
037            this.start = start;
038            this.len = len;
039            this.total = total;
040            this.workflows = workflows;
041        }
042    
043        /**
044         * Return the workflows being returned.
045         *
046         * @return the workflows being returned.
047         */
048        public List<WorkflowJobBean> getWorkflows() {
049            return workflows;
050        }
051    
052        /**
053         * Return the offset of the workflows being returned. <p/> For pagination purposes.
054         *
055         * @return the offset of the workflows being returned.
056         */
057        public int getStart() {
058            return start;
059        }
060    
061        /**
062         * Return the number of the workflows being returned. <p/> For pagination purposes.
063         *
064         * @return the number of the workflows being returned.
065         */
066        public int getLen() {
067            return len;
068        }
069    
070        /**
071         * Return the total number of workflows. <p/> For pagination purposes.
072         *
073         * @return the total number of workflows.
074         */
075        public int getTotal() {
076            return total;
077        }
078    
079    }