jgd
Class BaseJGDQuery

java.lang.Object
  extended by jgd.BaseJGDQuery
All Implemented Interfaces:
IJGDQuery
Direct Known Subclasses:
JGDQuery

public abstract class BaseJGDQuery
extends java.lang.Object
implements IJGDQuery


Field Summary
protected  java.lang.String desktopURL
          Base URL for GDS access
protected  java.lang.String fileType
          File type for GDS.
static int FLAG_FILTER_BY_ALL
          Flags constants : filter by all
static int FLAG_FILTER_BY_CHATS
          Flags constants : filter by chats
static int FLAG_FILTER_BY_FILES
          Flags constants : filter by files
static int FLAG_FILTER_BY_MAILS
          Flags constants : filter by mails
static int FLAG_FILTER_BY_WEB
          Flags constants : filter by web
static int FLAG_SORTED_BY_DATE
          Flags constants : sorted by date (default - if not given)
static int FLAG_SORTED_BY_RELEVANCE
          Flags constants : sorted by relevance
protected  java.lang.Integer flags
          flags used in GDS for filtering search results.
protected  java.lang.Integer num
          maximum number of results you'd like returned, to your query.
private static int PAGE_SIZE
           
protected  java.lang.String queryString
          Query string
protected  Results results
          Last results
protected  java.lang.Integer start
          position you want the results to start from.
 
Constructor Summary
BaseJGDQuery(java.lang.String queryString)
          Constructor of a query
 
Method Summary
private  void addFlag(int flag)
          Add a binary flag to the flags of query
abstract  IJGDResults execute()
           
abstract  java.lang.String executeXML()
           
abstract  java.lang.String getDesktopURL()
           
 java.lang.String getFileType()
          File type for GDS.
 java.lang.Integer getFlags()
          flags used in GDS for filtering search results.
 Results getLastResult()
          Last results.
 java.lang.Integer getNum()
          maximum number of results you'd like returned, to your query.
 java.lang.String getQueryString()
          Query string
 java.lang.Integer getStart()
          position you want the results to start from.
abstract  java.lang.String getURL()
           
private  void removeFilterFlags()
          Remove all filter flags
private  void removeFlag(int flag)
          Remove a binary flag from the flags of query
protected  void resetFlags()
          Reset a initial flags value
abstract  void setDesktopURL(java.lang.String desktopURL)
           
 void setFileType(java.lang.String fileType)
          File type for GDS.
 void setFilterByAll()
          Filter by all, this is, reset any filter.
 void setFilterByChats()
          Filter by chats
 void setFilterByFiles()
          Filter by files
 void setFilterByMails()
          Filter by mails
 void setFilterByWeb()
          Filter by web history
 void setFlags(java.lang.Integer flags)
          flags used in GDS for filtering search results.
 void setNum(java.lang.Integer integer)
          maximum number of results you'd like returned, to your query.
 void setQueryString(java.lang.String string)
          Query string
 void setSortedByDate()
          Sorted By Date
 void setSortedByRelevance()
          Sorted By Relevance
 void setStart(java.lang.Integer integer)
          position you want the results to start from.
abstract  void writeLastResultInXML(java.io.OutputStream o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FLAG_SORTED_BY_DATE

public static final int FLAG_SORTED_BY_DATE
Flags constants : sorted by date (default - if not given)

See Also:
Constant Field Values

FLAG_SORTED_BY_RELEVANCE

public static final int FLAG_SORTED_BY_RELEVANCE
Flags constants : sorted by relevance

See Also:
Constant Field Values

FLAG_FILTER_BY_ALL

public static final int FLAG_FILTER_BY_ALL
Flags constants : filter by all

See Also:
Constant Field Values

FLAG_FILTER_BY_WEB

public static final int FLAG_FILTER_BY_WEB
Flags constants : filter by web

See Also:
Constant Field Values

FLAG_FILTER_BY_FILES

public static final int FLAG_FILTER_BY_FILES
Flags constants : filter by files

See Also:
Constant Field Values

FLAG_FILTER_BY_CHATS

public static final int FLAG_FILTER_BY_CHATS
Flags constants : filter by chats

See Also:
Constant Field Values

FLAG_FILTER_BY_MAILS

public static final int FLAG_FILTER_BY_MAILS
Flags constants : filter by mails

See Also:
Constant Field Values

PAGE_SIZE

private static final int PAGE_SIZE
See Also:
Constant Field Values

queryString

protected java.lang.String queryString
Query string


num

protected java.lang.Integer num
maximum number of results you'd like returned, to your query.
By default, an search response will only return the first ten results.


start

protected java.lang.Integer start
position you want the results to start from. First item is 0


flags

protected java.lang.Integer flags
flags used in GDS for filtering search results.
Document at http://sourceforge.net/docman/display_doc.php?docid=29090&group_id=124229


results

protected Results results
Last results


desktopURL

protected java.lang.String desktopURL
Base URL for GDS access


fileType

protected java.lang.String fileType
File type for GDS. Example: "doc"

Constructor Detail

BaseJGDQuery

public BaseJGDQuery(java.lang.String queryString)
             throws JGDError
Constructor of a query

Parameters:
queryString - Query string for search
Throws:
JGDError - Error in init query
Method Detail

setDesktopURL

public abstract void setDesktopURL(java.lang.String desktopURL)

getDesktopURL

public abstract java.lang.String getDesktopURL()

executeXML

public abstract java.lang.String executeXML()
                                     throws JGDError
Throws:
JGDError

writeLastResultInXML

public abstract void writeLastResultInXML(java.io.OutputStream o)
                                   throws JGDError
Throws:
JGDError

getURL

public abstract java.lang.String getURL()
                                 throws JGDError
Throws:
JGDError

execute

public abstract IJGDResults execute()
                             throws JGDError
Specified by:
execute in interface IJGDQuery
Throws:
JGDError

getNum

public java.lang.Integer getNum()
maximum number of results you'd like returned, to your query.
By default, an search response will only return the first ten results.


getQueryString

public java.lang.String getQueryString()
Query string


getStart

public java.lang.Integer getStart()
position you want the results to start from. First item is 0


setNum

public void setNum(java.lang.Integer integer)
Description copied from interface: IJGDQuery
maximum number of results you'd like returned, to your query.
By default, an search response will only return the first ten results.

Specified by:
setNum in interface IJGDQuery

setQueryString

public void setQueryString(java.lang.String string)
Description copied from interface: IJGDQuery
Query string

Specified by:
setQueryString in interface IJGDQuery

setStart

public void setStart(java.lang.Integer integer)
Description copied from interface: IJGDQuery
position you want the results to start from. First item is 0

Specified by:
setStart in interface IJGDQuery

setFlags

public void setFlags(java.lang.Integer flags)
flags used in GDS for filtering search results.
Document at http://sourceforge.net/docman/display_doc.php?docid=29090&group_id=124229

Examples:
8 sorted by date (default - if not given)
40 sorted by relevance


getFlags

public java.lang.Integer getFlags()
flags used in GDS for filtering search results.
Document at http://sourceforge.net/docman/display_doc.php?docid=29090&group_id=124229

Examples:
8 sorted by date (default - if not given)
40 sorted by relevance


getLastResult

public Results getLastResult()
Last results. return Last results, or null if not exists


getFileType

public java.lang.String getFileType()
File type for GDS. Example: "doc"


setFileType

public void setFileType(java.lang.String fileType)
File type for GDS. Example: "doc"


setSortedByRelevance

public void setSortedByRelevance()
Sorted By Relevance


setSortedByDate

public void setSortedByDate()
Sorted By Date


setFilterByAll

public void setFilterByAll()
Filter by all, this is, reset any filter.


setFilterByWeb

public void setFilterByWeb()
Filter by web history


setFilterByFiles

public void setFilterByFiles()
Filter by files


setFilterByChats

public void setFilterByChats()
Filter by chats


setFilterByMails

public void setFilterByMails()
Filter by mails


addFlag

private void addFlag(int flag)
Add a binary flag to the flags of query

Parameters:
flag - Binary flag

removeFlag

private void removeFlag(int flag)
Remove a binary flag from the flags of query

Parameters:
flag - Binary flag

resetFlags

protected void resetFlags()
Reset a initial flags value


removeFilterFlags

private void removeFilterFlags()
Remove all filter flags



Copyright © 2007