com.indexdata.masterkey.pazpar2.client
Class Pazpar2Session

java.lang.Object
  extended by com.indexdata.masterkey.pazpar2.client.Pazpar2Session

public class Pazpar2Session
extends Object

A Pazpar2 session object holding a Pazpar2 session ID and the target settings (if any) for the session.

Pazpar2Session also keeps track of changes to the ClientCommand from one SP search request to the next.

(A repeated search (lack of change to the search) should omit another request to Pazpar2 A change of a torus query should re-initialize the entire session A change of a record filter should reset the record filtering)

Note that Pazpar2Session is cached on the HTTP Session so setting new attributes on this object should be done with caution.

Author:
jakub

Constructor Summary
Pazpar2Session()
           
 
Method Summary
 String getLatestQueryString()
           
 ClientCommand getSearchCommand()
           
 String getSessionId()
           
 boolean recordFilterChanged()
          Compares the record filtering on the current search with the previous search
 boolean recordFilterTargetCriteriaChanged()
          Compares the target criteria associated with a record filter on the current search with the previous search.
 void resetQuery()
           
 boolean searchChanged()
          Compares the current search with the previous search
 void setSearchCommand(ClientCommand command)
          If the command is a search it is inserted as latest command and the hitherto latest search command is now previous.
 void setSessionId(String sessionId)
           
 boolean torusQueryChanged()
          Compares the torus query on the current search with the previous search
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pazpar2Session

public Pazpar2Session()
Method Detail

setSearchCommand

public void setSearchCommand(ClientCommand command)
If the command is a search it is inserted as latest command and the hitherto latest search command is now previous.

Parameters:
command -

getSearchCommand

public ClientCommand getSearchCommand()

getLatestQueryString

public String getLatestQueryString()

searchChanged

public boolean searchChanged()
Compares the current search with the previous search

Returns:
true if any part of the query string changed since last search request

resetQuery

public void resetQuery()

recordFilterChanged

public boolean recordFilterChanged()
Compares the record filtering on the current search with the previous search

Returns:
true if any part of the filter query string changed since last search request

recordFilterTargetCriteriaChanged

public boolean recordFilterTargetCriteriaChanged()
Compares the target criteria associated with a record filter on the current search with the previous search.

Returns:
true if the target criteria changed since last search request

getSessionId

public String getSessionId()

setSessionId

public void setSessionId(String sessionId)

torusQueryChanged

public boolean torusQueryChanged()
Compares the torus query on the current search with the previous search

Returns:
true if the torus query changed since last search request.


Copyright © 2012. All Rights Reserved.