fr.cnes.sitools.common.model
Class ResourceCollectionFilter

java.lang.Object
  extended by fr.cnes.sitools.common.model.ResourceCollectionFilter

public final class ResourceCollectionFilter
extends java.lang.Object

Base class for filter parameters.

Author:
jp.boignard (AKKA Technologies)

Constructor Summary
ResourceCollectionFilter(int startIndex, int limitNum, java.lang.String queryStr)
          Constructor with pagination and query string parameters.
ResourceCollectionFilter(org.restlet.Request req)
          Constructor with Request.
 
Method Summary
 int getFilterMode()
          Gets the filterMode value
 int getLimit()
          Gets the limit value.
 java.lang.String getMode()
          Gets the mode value
 java.lang.String getOrder()
          Gets the order value.
 java.lang.String getParent()
          Gets the parent value.
 java.lang.String getQuery()
          Gets the query value.
 org.restlet.Request getRequest()
          Gets the request value
 java.lang.String getSort()
          Gets the sort value.
 int getStart()
          Gets the start value.
 java.lang.Integer getTotalCount()
          Gets the totalCount value
 void setFilterMode(int filterMode)
          Sets the value of filterMode
 void setLimit(int lim)
          Sets the value of limit.
 void setMode(java.lang.String mode)
          Sets the value of mode
 void setOrder(java.lang.String ord)
          Sets the value of order.
 void setParent(java.lang.String par)
          Sets the value of parent.
 void setQuery(java.lang.String que)
          Sets the value of query.
 void setRequest(org.restlet.Request request)
          Sets the value of request
 void setSort(java.lang.String srt)
          Sets the value of sort.
 void setStart(int startVal)
          Sets the value of start.
 void setTotalCount(java.lang.Integer totalCount)
          Sets the value of totalCount
 java.lang.String toSQL(java.lang.String req, java.lang.String fieldName)
          TODO design a jdbc.ResourceFilterWrapper wrapper to sql syntax.
 java.lang.String toSqlCount(java.lang.String req, java.lang.String fieldName)
          To SQL count
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceCollectionFilter

public ResourceCollectionFilter(org.restlet.Request req)
Constructor with Request.

Parameters:
req - request for the filter

ResourceCollectionFilter

public ResourceCollectionFilter(int startIndex,
                                int limitNum,
                                java.lang.String queryStr)
Constructor with pagination and query string parameters.

Parameters:
startIndex - index of first element
limitNum - number of elements
queryStr - a string term
Method Detail

getFilterMode

public int getFilterMode()
Gets the filterMode value

Returns:
the filterMode

setFilterMode

public void setFilterMode(int filterMode)
Sets the value of filterMode

Parameters:
filterMode - the filterMode to set

toSQL

public java.lang.String toSQL(java.lang.String req,
                              java.lang.String fieldName)
TODO design a jdbc.ResourceFilterWrapper wrapper to sql syntax.

Parameters:
req - SQL request
fieldName - the name of the field concerned with the "like" request
Returns:
request with filter clauses

toSqlCount

public java.lang.String toSqlCount(java.lang.String req,
                                   java.lang.String fieldName)
To SQL count

Parameters:
req - request
fieldName - field name
Returns:
request

getQuery

public java.lang.String getQuery()
Gets the query value.

Returns:
the query

setQuery

public void setQuery(java.lang.String que)
Sets the value of query.

Parameters:
que - the query to set

getLimit

public int getLimit()
Gets the limit value.

Returns:
the limit

setLimit

public void setLimit(int lim)
Sets the value of limit.

Parameters:
lim - the limit to set

getStart

public int getStart()
Gets the start value.

Returns:
the start

setStart

public void setStart(int startVal)
Sets the value of start.

Parameters:
startVal - the start to set

getParent

public java.lang.String getParent()
Gets the parent value.

Returns:
the parent

setParent

public void setParent(java.lang.String par)
Sets the value of parent.

Parameters:
par - the parent to set

getSort

public java.lang.String getSort()
Gets the sort value.

Returns:
the sort

setSort

public void setSort(java.lang.String srt)
Sets the value of sort.

Parameters:
srt - the sort to set

getOrder

public java.lang.String getOrder()
Gets the order value.

Returns:
the order

setOrder

public void setOrder(java.lang.String ord)
Sets the value of order.

Parameters:
ord - the order to set

getTotalCount

public java.lang.Integer getTotalCount()
Gets the totalCount value

Returns:
the totalCount

setTotalCount

public void setTotalCount(java.lang.Integer totalCount)
Sets the value of totalCount

Parameters:
totalCount - the totalCount to set

setRequest

public void setRequest(org.restlet.Request request)
Sets the value of request

Parameters:
request - the request to set

getRequest

public org.restlet.Request getRequest()
Gets the request value

Returns:
the request

setMode

public void setMode(java.lang.String mode)
Sets the value of mode

Parameters:
mode - the mode to set

getMode

public java.lang.String getMode()
Gets the mode value

Returns:
the mode


Copyright © 2010-2013 CNES. All Rights Reserved.