1
/*___INFO__MARK_BEGIN__*/
2
/*************************************************************************
4
* The Contents of this file are made available subject to the terms of
5
* the Sun Industry Standards Source License Version 1.2
7
* Sun Microsystems Inc., March, 2001
10
* Sun Industry Standards Source License Version 1.2
11
* =================================================
12
* The contents of this file are subject to the Sun Industry Standards
13
* Source License Version 1.2 (the "License"); You may not use this file
14
* except in compliance with the License. You may obtain a copy of the
15
* License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
17
* Software provided under this License is provided on an "AS IS" basis,
18
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
19
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
20
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
21
* See the License for the specific provisions governing your rights and
22
* obligations concerning the Software.
24
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
26
* Copyright: 2001 by Sun Microsystems, Inc.
28
* All Rights Reserved.
30
************************************************************************/
31
/*___INFO__MARK_END__*/
32
package com.sun.grid.jgdi.monitoring;
34
import com.sun.grid.jgdi.monitoring.filter.*;
35
import java.io.Serializable;
38
* Base class for all classes which implements options for the qstat
41
public abstract class BasicQueueOptions implements Serializable {
44
private boolean showAdditionalAttributes;
46
private QueueFilter queueFilter;
48
private ResourceFilter resourceFilter;
50
private QueueStateFilter queueStateFilter;
52
private UserFilter queueUserFilter;
56
* Creates a new instance of BaseQStatFilter
58
public BasicQueueOptions() {
62
* Get the queue filter
64
* The CLI qstat equivialent for queue filter is <code>qstat -q</code>
66
* @return the queue filters
68
public QueueFilter getQueueFilter() {
73
* Set the queue filter
74
* @param queueFilter the new queue filter
76
public void setQueueFilter(QueueFilter queueFilter) {
77
this.queueFilter = queueFilter;
81
* Update the content of the queue user filter by adding values in vals
82
* @param vals values to be added to the filter
84
public void updateQueueFilter(String vals) {
85
if (queueFilter == null) {
86
queueFilter = QueueFilter.parse(vals);
88
queueFilter.fill(vals);
93
* Get the the resource filter.
95
* The CLI equivialent for resource fitler is <code>qstat -l</code>
97
public ResourceFilter getResourceFilter() {
98
return resourceFilter;
102
* Set the resource filter
104
* @param resourceFilter the new resource filter
106
public void setResourceFilter(ResourceFilter resourceFilter) {
107
this.resourceFilter = resourceFilter;
111
* Update the content of the resource filter by adding values in vals
112
* @param vals values to be added to the filter
114
public void updateResourceFilter(String vals) {
115
if (resourceFilter == null) {
116
resourceFilter = ResourceFilter.parse(vals);
118
resourceFilter.fill(vals);
123
* Get the queue state filter.
125
* The CLI equivialent for queue state filter is <code>qstat -qs</code>
126
* @return the queue state filter
128
public QueueStateFilter getQueueStateFilter() {
129
return queueStateFilter;
133
* Set the queue state filter.
135
* @param queueStateFilter the queue state filter
137
public void setQueueStateFilter(QueueStateFilter queueStateFilter) {
138
this.queueStateFilter = queueStateFilter;
142
* Update the content of the queue state filter by adding values in vals
143
* @param vals values to be added to the filter
145
public void updateQueueStateFilter(String vals) {
146
if (queueStateFilter == null) {
147
queueStateFilter = QueueStateFilter.parse(vals);
149
queueStateFilter.fill(vals);
154
* Get the queue user filter. The result of the qstat algorithm will only
155
* include those queue which are accessible by user of the queue user filter.
157
* The CLI equivialent for the queue user filter is <code>qstat -U</code>
158
* @return the queue user filter
160
public UserFilter getQueueUserFilter() {
161
return queueUserFilter;
165
* Set a new queue user filter
167
* @param queueUserFilter the new queue user filter
169
public void setQueueUserFilter(UserFilter queueUserFilter) {
170
this.queueUserFilter = queueUserFilter;
174
* Update the content of the queue user filter by adding values in vals
175
* @param vals values to be added to the filter
177
public void updateQueueUserFilter(String vals) {
178
if (queueUserFilter == null) {
179
queueUserFilter = UserFilter.parse(vals);
181
queueUserFilter.fill(vals);
186
* Should additional attributes be includes into the result
188
* The CLI equivialent is <code>qstat -ext</code>
190
* @return <code>true</code> of additional attributes should be included
193
public boolean showAdditionalAttributes() {
194
return showAdditionalAttributes;
198
* Set the show additional attributes flag
199
* @param showAdditionalAttributes the show additional attributes flag
201
public void setShowAdditionalAttributes(boolean showAdditionalAttributes) {
202
this.showAdditionalAttributes = showAdditionalAttributes;