com.sun.identity.log
Class LogQuery

java.lang.Object
  extended bycom.sun.identity.log.LogQuery

public class LogQuery
extends java.lang.Object

LogQuery defines the query format that reader api supports. This class contains a list of individual query elements and also stores information about whether all the query to be satisfied or any one to be satisfied. It also allows caller to set required number of most recent records and to specify the sortby field name (optional).


Field Summary
static int ALL_RECORDS
          All the records that matches query criteria (if any) will be retrieved.
static int MATCH_ALL_CONDITIONS
          All the queries to be applied successfully
static int MATCH_ANY_CONDITION
          Any one of the query must be true
static int MOST_RECENT_MAX_RECORDS
          Most recent maximum number of records to be collected.
 
Constructor Summary
LogQuery()
          Default constructor It creates the new object and assigns space to them.
LogQuery(int max_record)
          Customized constructor to set only maxrecord.
LogQuery(int max_Record, int matchCriteria, java.lang.String sortingBy)
          Customized constructor.
 
Method Summary
 void addQuery(QueryElement qryElement)
          Adds a query element to the list present in LogQuery.
 int getGlobalOperand()
          Returns the value of global operand set in the query.
 int getNumRecordsWanted()
           
 java.util.ArrayList getQueries()
          Returns the full list of query
 java.lang.String getSortingField()
          Returns the field name on which records to be sorted.
 void setGlobalOperand(int no)
          Sets the globalOperand field to either any query criteria match or to match all the criteria.
 void setMaxRecord(int value)
           
 void setSortingField(java.lang.String fieldName)
          Set the field name on which records to be sorted.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MATCH_ALL_CONDITIONS

public static final int MATCH_ALL_CONDITIONS
All the queries to be applied successfully

See Also:
Constant Field Values

MATCH_ANY_CONDITION

public static final int MATCH_ANY_CONDITION
Any one of the query must be true

See Also:
Constant Field Values

MOST_RECENT_MAX_RECORDS

public static final int MOST_RECENT_MAX_RECORDS
Most recent maximum number of records to be collected. Here maximum number will be as stored in the configuration.

See Also:
Constant Field Values

ALL_RECORDS

public static final int ALL_RECORDS
All the records that matches query criteria (if any) will be retrieved. Maximum number of records as configured will be ignored.

See Also:
Constant Field Values
Constructor Detail

LogQuery

public LogQuery()
Default constructor It creates the new object and assigns space to them. It sets default values when applicable.


LogQuery

public LogQuery(int max_record)
Customized constructor to set only maxrecord.

Parameters:
max_record - is maximum number of most recent records to be returned.

LogQuery

public LogQuery(int max_Record,
                int matchCriteria,
                java.lang.String sortingBy)
         throws java.lang.IllegalArgumentException
Customized constructor.

Parameters:
max_Record - is maximum number of most recent records to be returned
matchCriteria - whether all queries to be matched or any one match.
sortingBy - fieldname on which records to be sorted.
Throws:
java.lang.IllegalArgumentException - if any of the max_Record/matchCriteria is not valid.
Method Detail

setGlobalOperand

public void setGlobalOperand(int no)
                      throws java.lang.IllegalArgumentException
Sets the globalOperand field to either any query criteria match or to match all the criteria.

Parameters:
no - the value to set to globalOperand
Throws:
java.lang.IllegalArgumentException - when parameter is passed as neither all nor any match.

setMaxRecord

public void setMaxRecord(int value)

addQuery

public void addQuery(QueryElement qryElement)
Adds a query element to the list present in LogQuery.

Parameters:
qryElement - the query to be added into the list

getQueries

public java.util.ArrayList getQueries()
Returns the full list of query

Returns:
full list of query

getNumRecordsWanted

public int getNumRecordsWanted()

getGlobalOperand

public int getGlobalOperand()
Returns the value of global operand set in the query.

Returns:
the value of global operand set in the query.

setSortingField

public void setSortingField(java.lang.String fieldName)
Set the field name on which records to be sorted.

Parameters:
fieldName - field name on which records to be sorted.

getSortingField

public java.lang.String getSortingField()
Returns the field name on which records to be sorted.

Returns:
the field name on which records to be sorted.


Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.