jpl.mipl.mdms.FileService.komodo.services.query.server
Class QSessionData

java.lang.Object
  extended by jpl.mipl.mdms.FileService.komodo.services.query.server.QSessionData

public class QSessionData
extends Object

Purpose: This class encapsulates the data used for a FEIq session. This includes the user information, filetype capabilities, query blob, and a results collection.

   Copyright 2007, California Institute of Technology.
   ALL RIGHTS RESERVED.
   U.S. Government Sponsorship acknowledge. 2007.
   
 ============================================================================
 Modification History :
 ----------------------

 Date              Who              What
 ----------------------------------------------------------------------------
 05/31/2007        Nick             Initial Release
 ============================================================================
 

Version:
$Id: QSessionData.java,v 1.8 2007/09/21 22:49:34 ntt Exp $
Author:
Nicholas Toole (Nicholas.T.Toole@jpl.nasa.gov)

Field Summary
protected  long creationTime
           
protected  Map<String,Capability> filetypeCaps
           
protected  List<String> filetypes
           
protected  String id
           
protected  int maximumResultCount
           
protected  String password
           
protected  QueryList queryBlob
           
protected  Object queryServiceObject
           
protected  QResultQueueManager resultsMap
           
protected  String serverGroup
           
protected  QSession session
           
protected  boolean subscribe
           
protected  QueryConstraints systemQuery
           
protected  String user
           
 
Method Summary
protected  void _setFiletypes(String[] filetypes)
           
 boolean addResult(QResult result)
           
protected  void addResultNoWait(QResult result)
          Adds a result to the result queue based on the filetype of the result.
 long getCreationTime()
           
 Capability getFiletypeCapability(String filetype)
           
 String[] getFiletypes()
          Returns an array of filetype names
 Long getFiletypeTime(String filetype)
           
 String getId()
          Returns the session identifier
 int getMaximumResultCount()
          Returns the current maximum result count.
 String getPassword()
           
 QueryList getQueryBlob()
           
 Object getQueryServiceObject()
           
 QResultQueueManager getResultsManager()
           
 String getServerGroup()
           
 QSession getSession()
           
 QueryConstraints getSystemQuery()
           
 String getUser()
           
 boolean ingestResult(QResult result, Closeable caller)
          Adds a result to the result queue based on the filetype of the result.
protected  void init()
           
 boolean isSubscribe()
           
 void reset()
           
 void setFiletypeCapability(String filetype, Capability capability)
           
 void setFiletypes(String[] filetypes)
          Assigns an array of filetype names for this session.
 void setFiletypeTime(String filetype, Long time)
           
 void setMaximumResultCount(int maximumResultCount)
          Sets the maximum result count.
 void setQueryBlob(QueryList queryBlob)
           
 void setQueryServiceObject(Object queryServiceObject)
           
 void setSession(QSession session)
           
 void setSubscribe(boolean subscribe)
           
 void setSystemQuery(QueryConstraints systemQuery)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected String id

filetypes

protected List<String> filetypes

filetypeCaps

protected Map<String,Capability> filetypeCaps

resultsMap

protected QResultQueueManager resultsMap

queryBlob

protected QueryList queryBlob

systemQuery

protected QueryConstraints systemQuery

queryServiceObject

protected Object queryServiceObject

session

protected QSession session

serverGroup

protected String serverGroup

user

protected String user

password

protected String password

creationTime

protected long creationTime

subscribe

protected boolean subscribe

maximumResultCount

protected int maximumResultCount
Method Detail

init

protected void init()

getId

public String getId()
Returns the session identifier

Returns:
session id

getFiletypes

public String[] getFiletypes()
Returns an array of filetype names

Returns:
the filetypes

setFiletypes

public void setFiletypes(String[] filetypes)
Assigns an array of filetype names for this session.

Parameters:
filetypes - the filetypes to set

_setFiletypes

protected void _setFiletypes(String[] filetypes)

getFiletypeTime

public Long getFiletypeTime(String filetype)
Returns:
the filetypeTimes

setFiletypeTime

public void setFiletypeTime(String filetype,
                            Long time)
Parameters:
filetypeTimes - the filetypeTimes to set

getFiletypeCapability

public Capability getFiletypeCapability(String filetype)
Returns:
the filetypeTimes

setFiletypeCapability

public void setFiletypeCapability(String filetype,
                                  Capability capability)
Parameters:
filetypeTimes - the filetypeTimes to set

getQueryBlob

public QueryList getQueryBlob()
Returns:
the queryBlob

setQueryBlob

public void setQueryBlob(QueryList queryBlob)
Parameters:
queryBlob - the queryBlob to set

getSystemQuery

public QueryConstraints getSystemQuery()
Returns:
the internal system query

setSystemQuery

public void setSystemQuery(QueryConstraints systemQuery)
Parameters:
systemQuery - the internal system query

getQueryServiceObject

public Object getQueryServiceObject()
Returns:
the queryServiceObject

setQueryServiceObject

public void setQueryServiceObject(Object queryServiceObject)
Parameters:
queryServiceObject - the queryServiceObject to set

getCreationTime

public long getCreationTime()
Returns:
the creationTime

getPassword

public String getPassword()
Returns:
the password

getServerGroup

public String getServerGroup()
Returns:
the serverGroup

getUser

public String getUser()
Returns:
the user

reset

public void reset()

setSession

public void setSession(QSession session)

getSession

public QSession getSession()

addResultNoWait

protected void addResultNoWait(QResult result)
Adds a result to the result queue based on the filetype of the result. The last modification time is also examined, and if the latest, is used to update the internal system query.

Parameters:
result - Result to be added

ingestResult

public boolean ingestResult(QResult result,
                            Closeable caller)
Adds a result to the result queue based on the filetype of the result. The last modification time is also examined, and if the latest, is used to update the internal system query. Note: If the size of all results reaches the maximum allowable value, then this method will block until room has been made for the result.

Parameters:
result - Result to be added
caller - Closeable impl that, when closed, signals that result ingestion should be aborted

addResult

public boolean addResult(QResult result)

getMaximumResultCount

public int getMaximumResultCount()
Returns the current maximum result count.

Returns:
the maximumResultCount

setMaximumResultCount

public void setMaximumResultCount(int maximumResultCount)
                           throws IllegalArgumentException
Sets the maximum result count. This value is used to limit the number of results received by this instance. Once the limit is reached, producers will enter a while-yield loop until a consumer makes room.

Parameters:
maximumResultCount - the maximumResultCount to set
Throws:
IllegalArgumentException

isSubscribe

public boolean isSubscribe()
Returns:
the subscribe

setSubscribe

public void setSubscribe(boolean subscribe)
Parameters:
subscribe - the subscribe to set

getResultsManager

public QResultQueueManager getResultsManager()