Package com.sun.identity.log
Class LogQuery
- java.lang.Object
-
- com.sun.identity.log.LogQuery
-
public class LogQuery extends Object
LogQuery defines the query format that the 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 thesortbyfield name (optional).
-
-
Field Summary
Fields Modifier and Type Field Description static intALL_RECORDSAll the records that matches query criteria (if any) will be retrieved.static intMATCH_ALL_CONDITIONSmatching condition, values of globalOperand.static intMATCH_ANY_CONDITIONstatic intMOST_RECENT_MAX_RECORDSwhen maximum records asked Most recent maximum number of records to be collected.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddQuery(QueryElement qryElement)Adds a query element to the list present inLogQuery.ArrayListgetColumns()Returns the table column names selected.intgetGlobalOperand()Returns the value of global operand set in the query.intgetNumRecordsWanted()ArrayListgetQueries()Returns the full list of queryStringgetSortingField()Returns the field name on which records to be sorted.voidsetColumns(ArrayList columns)Set the columns to be selected.voidsetGlobalOperand(int no)Sets theglobalOperandfield to either any query criteria match or to match all the criteria.voidsetMaxRecord(int value)voidsetSortingField(String fieldName)Set the field name on which records to be sorted.
-
-
-
Field Detail
-
MATCH_ALL_CONDITIONS
public static final int MATCH_ALL_CONDITIONS
matching condition, values of globalOperand. All the queries to be applied successfully- See Also:
- Constant Field Values
-
MATCH_ANY_CONDITION
public static final int MATCH_ANY_CONDITION
- See Also:
- Constant Field Values
-
MOST_RECENT_MAX_RECORDS
public static final int MOST_RECENT_MAX_RECORDS
when maximum records asked 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 onlymaxrecord.- Parameters:
max_record- is maximum number of most recent records to be returned.
-
LogQuery
public LogQuery(int max_Record, int matchCriteria, String sortingBy) throws IllegalArgumentExceptionCustomized constructor.- Parameters:
max_Record- the maximum number of most recent records to be returnedmatchCriteria- whether all queries or any one to match.sortingBy-fieldnameon which records to be sorted.- Throws:
IllegalArgumentException- if any of themax_Record/matchCriteriais not valid.
-
-
Method Detail
-
setGlobalOperand
public void setGlobalOperand(int no) throws IllegalArgumentExceptionSets theglobalOperandfield to either any query criteria match or to match all the criteria.- Parameters:
no- the value to set toglobalOperand- Throws:
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 inLogQuery.- Parameters:
qryElement- the query to be added into the list
-
getQueries
public 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(String fieldName)
Set the field name on which records to be sorted.- Parameters:
fieldName- field name on which records to be sorted.
-
getSortingField
public String getSortingField()
Returns the field name on which records to be sorted.- Returns:
- the field name on which records to be sorted.
-
setColumns
public void setColumns(ArrayList columns)
Set the columns to be selected. This applies to flatfile logging also; means "fields", rather than "columns" then.- Parameters:
columns- to request.
-
getColumns
public ArrayList getColumns()
Returns the table column names selected. This applies to flatfile logging also; means "fields", rather than "columns" then.- Returns:
- the ArrayList of columns specified.
-
-