com.apelon.dts.client
Class DTSQuery

java.lang.Object
  extended by com.apelon.dts.client.DTSQuery

public class DTSQuery
extends Object

Utility class for getting a DTS Queries.

A DTS Query requires a ServerConnection for initialization. This class works with Socket Server Connection, Secure Socket Server Connection and JDBC Server Connection .

Copyright: Copyright (c) 2004

Company: Apelon, Inc.

Since:
3.4.0
Version:
DTS 3.4.0
Author:
Abhay Sinha

Constructor Summary
DTSQuery()
          Creates DTSQuery object with no Server Connection.
DTSQuery(ServerConnection newSrvrConn)
          Creates DTSQuery object for given ServerConnection.
DTSQuery(ServerConnection newSrvrConn, boolean xmlParserVal)
          Creates DTSQuery object for given ServerConnection and XML Parser Validation value.
 
Method Summary
 void close()
          Disposes of all resources.
 AssociationQuery getAssociationQuery()
          Returns AssociationQuery.
 ClassifyDetailsQuery getClassifyDetailsQuery()
          Returns ClassifyDetailsQuery.
 ClassifyQuery getClassifyQuery()
          Returns ClassifyQuery.
 OntylogClassQuery getClassQuery()
          Returns OntylogClassQuery.
protected  ServerConnection getConnection()
           
 DTSCommonQuery getDTSCommonQuery()
          Returns DTSCommonQuery.
 DTSConceptQuery getDTSConceptQuery()
          Returns DTSConceptQuery.
 MatchQuery getMatchQuery()
          Returns MatchQuery.
 NamespaceQuery getNamespaceQuery()
          Returns NamespaceQuery.
 NavQuery getNavQuery()
          Returns NavQuery.
 OntylogConceptQuery getOntylogConceptQuery()
          Returns OntylogConceptQuery.
 OntylogExtConceptQuery getOntylogExtConceptQuery()
          Returns OntylogExtConceptQuery.
 SearchQuery getSearchQuery()
          Returns SearchQuery.
 SubsetQuery getSubsetQuery()
          Returns SubsetQuery.
 TermQuery getTermQuery()
          Returns TermQuery.
 TermSearchQuery getTermSearchQuery()
          Returns TermSearchQuery.
 ThesaurusConceptQuery getThesaurusQuery()
          Returns ThesaurusConceptQuery.
protected  void initQueryServer(Class queryServerClass, String header)
           
 boolean isOpen()
          Returns ture if the Server Connection is open.
 boolean isXmlParserValidationActive()
           
 void putQueryServerArgs(Class queryServerClass, String[] args)
          Put the agruments which should be passed to the Query Server class.
 void reset()
           
 void setConnection(ServerConnection connection)
          Sets new server connection.
 void setXmlParserValidationActive(boolean b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DTSQuery

public DTSQuery()
Creates DTSQuery object with no Server Connection. XML Parser Validation is set to false. If a query server requires arguments, use this constructor, then call setConnection().

ClassifyServer requires mc.properties path to be passes as argument. This can be done like this:

 ServerConnection sc;

 DTSQuery dtsQuery = new DTSQuery();
 dtsQuery.putQueryServerArgs(ClassifyServer.class, new String[]{"server/mc.properties"})
 dtsQuery.setConnection(sc);
 


DTSQuery

public DTSQuery(ServerConnection newSrvrConn)
Creates DTSQuery object for given ServerConnection. XML Parser Validation is set to false.

Parameters:
newSrvrConn - ServerConnection

DTSQuery

public DTSQuery(ServerConnection newSrvrConn,
                boolean xmlParserVal)
Creates DTSQuery object for given ServerConnection and XML Parser Validation value.

Parameters:
newSrvrConn - ServerConnection
xmlParserVal - XML Parser Validation flag
Method Detail

putQueryServerArgs

public void putQueryServerArgs(Class queryServerClass,
                               String[] args)
Put the agruments which should be passed to the Query Server class. This is used for ServerConnectionJDBC only. For other server connections, the arguments are provided in the ApelonServer properties file.

Parameters:
queryServerClass - QueryServer class
args - Arguments

isOpen

public boolean isOpen()
Returns ture if the Server Connection is open.

Returns:
true if the Server Connection is open, else false.

getDTSCommonQuery

public DTSCommonQuery getDTSCommonQuery()
Returns DTSCommonQuery.

Returns:
DTSCommonQuery
Throws:
IllegalStateException - if the ServerConnection is not open.

getClassQuery

public OntylogClassQuery getClassQuery()
Returns OntylogClassQuery.

Returns:
OntylogClassQuery
Throws:
IllegalStateException - if the ServerConnection is not open.

getNamespaceQuery

public NamespaceQuery getNamespaceQuery()
Returns NamespaceQuery.

Returns:
NamespaceQuery
Throws:
IllegalStateException - if the ServerConnection is not open.

getNavQuery

public NavQuery getNavQuery()
Returns NavQuery.

Returns:
NavQuery
Throws:
IllegalStateException - if the ServerConnection is not open.

getAssociationQuery

public AssociationQuery getAssociationQuery()
Returns AssociationQuery.

Returns:
AssociationQuery
Throws:
IllegalStateException - if the ServerConnection is not open.

getThesaurusQuery

public ThesaurusConceptQuery getThesaurusQuery()
Returns ThesaurusConceptQuery.

Returns:
ThesaurusConceptQuery
Throws:
IllegalStateException - if the ServerConnection is not open.

getTermQuery

public TermQuery getTermQuery()
Returns TermQuery.

Returns:
TermQuery
Throws:
IllegalStateException - if the ServerConnection is not open.

getTermSearchQuery

public TermSearchQuery getTermSearchQuery()
Returns TermSearchQuery.

Returns:
TermSearchQuery
Throws:
IllegalStateException - if the ServerConnection is not open.

getDTSConceptQuery

public DTSConceptQuery getDTSConceptQuery()
Returns DTSConceptQuery.

Returns:
DTSConceptQuery
Throws:
IllegalStateException - if the ServerConnection is not open.

getSearchQuery

public SearchQuery getSearchQuery()
Returns SearchQuery.

Returns:
SearchQuery
Throws:
IllegalStateException - if the ServerConnection is not open.

getMatchQuery

public MatchQuery getMatchQuery()
Returns MatchQuery.

Returns:
MatchQuery
Throws:
IllegalStateException - if the ServerConnection is not open.

getOntylogConceptQuery

public OntylogConceptQuery getOntylogConceptQuery()
Returns OntylogConceptQuery.

Returns:
OntylogConceptQuery
Throws:
IllegalStateException - if the ServerConnection is not open.

getOntylogExtConceptQuery

public OntylogExtConceptQuery getOntylogExtConceptQuery()
Returns OntylogExtConceptQuery.

Returns:
OntylogExtConceptQuery
Throws:
IllegalStateException - if the ServerConnection is not open.

getClassifyQuery

public ClassifyQuery getClassifyQuery()
Returns ClassifyQuery.

Returns:
ClassifyQuery
Throws:
IllegalStateException - if the ServerConnection is not open.

getClassifyDetailsQuery

public ClassifyDetailsQuery getClassifyDetailsQuery()
Returns ClassifyDetailsQuery.

Returns:
ClassifyDetailsQuery
Throws:
IllegalStateException - if the ServerConnection is not open.

getSubsetQuery

public SubsetQuery getSubsetQuery()
Returns SubsetQuery.

Returns:
SubsetQuery
Throws:
IllegalStateException - if the ServerConnection is not open.

isXmlParserValidationActive

public boolean isXmlParserValidationActive()

setXmlParserValidationActive

public void setXmlParserValidationActive(boolean b)

reset

public void reset()

close

public void close()
           throws Exception
Disposes of all resources.

Throws:
Exception

setConnection

public void setConnection(ServerConnection connection)
Sets new server connection.

Parameters:
connection -

initQueryServer

protected void initQueryServer(Class queryServerClass,
                               String header)

getConnection

protected ServerConnection getConnection()


Copyright © 2011. All Rights Reserved.