org.glite.wmsui.apij
Class Query

java.lang.Object
  extended byorg.glite.wmsui.apij.Query

public class Query
extends java.lang.Object

LB QeuryServer Class Wrapped.

This class is used to specify a filter while performing LB server jobs information It allows the user to specify the

Version:
0.1
Author:
Alessandro Maraschini

Constructor Summary
Query()
          Default Constructor
 
Method Summary
 void clean()
          Clean all the filter in the current Query
 Query copy()
          Make a deep copy of the current query
 boolean getExclude(int status_code)
          Retrieve the value of the restriction for the specified status
 java.util.Calendar getFrom()
          Retrieve the set from filter
 boolean getInclude(int status_code)
          Retrieve the value of the restriction for the specified status
 boolean getOwned()
          retrieve the owned flag
 java.util.Calendar getTo()
          Retrieve the set to filter
 java.lang.String getUserTag(java.lang.String name)
          retrieve UserTag value
 org.glite.jdl.Ad getUserTags()
          Retrieve all the query user tags
 void setExclude(int status_code)
          Exclude all the jobs in the specified status.
 void setInclude(int status_code)
          Including only the jobs in the specified status.
 void setOwned()
          Retrieve only current certificate owned jobs
 void setTimeFrom(java.util.Calendar time)
          get all jobs submitted after the specified time
 void setTimeFrom(int time)
          get all jobs submitted after the specified time
 void setTimeTo(java.util.Calendar time)
          get all jobs submitted before the specified time
 void setTimeTo(int time)
          get all jobs submitted before the specified time
 void setUserTag(java.lang.String name, java.lang.String value)
          get all jobs submitted with the specified user tag If the attribute already exists is automatically replaced
 void setUserTags(org.glite.jdl.Ad tags)
          Set all userTags couples in the query.
 java.lang.String toString()
          Retrieve current query string representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Query

public Query()
Default Constructor

Method Detail

copy

public Query copy()
Make a deep copy of the current query


clean

public void clean()
Clean all the filter in the current Query


toString

public java.lang.String toString()
Retrieve current query string representation

Returns:
query string representation

setTimeFrom

public void setTimeFrom(java.util.Calendar time)
get all jobs submitted after the specified time

Parameters:
time - Calendar representing the specified time

setTimeTo

public void setTimeTo(java.util.Calendar time)
get all jobs submitted before the specified time

Parameters:
time - Calendar representing the specified time

setTimeFrom

public void setTimeFrom(int time)
get all jobs submitted after the specified time

Parameters:
time - number of seconds since epoch

setTimeTo

public void setTimeTo(int time)
get all jobs submitted before the specified time

Parameters:
time - number of seconds since epoch

setUserTags

public void setUserTags(org.glite.jdl.Ad tags)
Set all userTags couples in the query. Only jobs containing such tags will be retrieved If the attribute already exists is automatically replaced

Parameters:
tags - a valid ad containing all usertags information

setUserTag

public void setUserTag(java.lang.String name,
                       java.lang.String value)
                throws javax.naming.directory.InvalidAttributeValueException
get all jobs submitted with the specified user tag If the attribute already exists is automatically replaced

Parameters:
name - the name of the user tag
value - the value of the user tag
Throws:
javax.naming.directory.InvalidAttributeValueException - when the couple name-value has classad syntax error

setOwned

public void setOwned()
Retrieve only current certificate owned jobs


setInclude

public void setInclude(int status_code)
Including only the jobs in the specified status. This method could be called repetively in order to include different states

Parameters:
status_code - must be a valid JobStatus code
See Also:
JobStatus.UNDEF, JobStatus.SUBMITTED, JobStatus.WAITING, JobStatus.READY, JobStatus.SCHEDULED, JobStatus.RUNNING, JobStatus.DONE, JobStatus.CLEARED, JobStatus.ABORTED, JobStatus.CANCELLED, JobStatus.UNKNOWN, JobStatus.PURGED

setExclude

public void setExclude(int status_code)
Exclude all the jobs in the specified status.

Parameters:
status_code - must be a valid JobStatus code
See Also:
JobStatus.UNDEF, JobStatus.SUBMITTED, JobStatus.WAITING, JobStatus.READY, JobStatus.SCHEDULED, JobStatus.RUNNING, JobStatus.DONE, JobStatus.CLEARED, JobStatus.ABORTED, JobStatus.CANCELLED, JobStatus.UNKNOWN, JobStatus.PURGED

getFrom

public java.util.Calendar getFrom()
Retrieve the set from filter

Returns:
a Calendar representing the time when to look for the jobs from (Null if not set)

getTo

public java.util.Calendar getTo()
Retrieve the set to filter

Returns:
a Calendar representing the time when to look for the jobs to (Null if not set)

getUserTag

public java.lang.String getUserTag(java.lang.String name)
                            throws java.lang.NoSuchFieldException
retrieve UserTag value

Parameters:
name - the name of the user tag looked for
Returns:
the value for the specified userTag (Null if not set)
Throws:
java.lang.NoSuchFieldException - if the specified attribute is not set

getUserTags

public org.glite.jdl.Ad getUserTags()
Retrieve all the query user tags

Returns:
an Ad class containing all the usertags names and values (empty Ad if no user tag set yet)

getOwned

public boolean getOwned()
retrieve the owned flag

Returns:
true if flag has been set, false otherwise

getInclude

public boolean getInclude(int status_code)
Retrieve the value of the restriction for the specified status

Parameters:
status_code - must be a valid JobStatus code
Returns:
true if the parameter has been set, false otherwise
See Also:
JobStatus.UNDEF, JobStatus.SUBMITTED, JobStatus.WAITING, JobStatus.READY, JobStatus.SCHEDULED, JobStatus.RUNNING, JobStatus.DONE, JobStatus.CLEARED, JobStatus.ABORTED, JobStatus.CANCELLED, JobStatus.UNKNOWN, JobStatus.PURGED

getExclude

public boolean getExclude(int status_code)
Retrieve the value of the restriction for the specified status

Parameters:
status_code - must be a valid JobStatus code
Returns:
true if the parameter has been set, false otherwise
See Also:
JobStatus.UNDEF, JobStatus.SUBMITTED, JobStatus.WAITING, JobStatus.READY, JobStatus.SCHEDULED, JobStatus.RUNNING, JobStatus.DONE, JobStatus.CLEARED, JobStatus.ABORTED, JobStatus.CANCELLED, JobStatus.UNKNOWN, JobStatus.PURGED