com.apelon.dts.client.match
Class MatchQuery

java.lang.Object
  extended by com.apelon.apelonserver.client.BasicQuery
      extended by com.apelon.dts.client.match.MatchQuery

public abstract class MatchQuery
extends BasicQuery

A MatchQuery provides access to silos and pattern matching searches within silos. A client can set a limit for resulting search matches using the method in this link: MatchOptions.setLimit(int)

Copyright: Copyright (c) 2003

Company: Apelon, Inc.

Since:
DTS 3.0.0
Version:
DTS 3.0.0
Author:
Apelon, Inc.

Field Summary
 
Fields inherited from class com.apelon.apelonserver.client.BasicQuery
ADMIN, queryHeader
 
Constructor Summary
protected MatchQuery(boolean isValidating)
           
 
Method Summary
static MatchQuery createInstance(ServerConnection sc)
          Creates an instance of MatchQuery.
static MatchQuery createInstance(ServerConnection sc, boolean isValidating)
          Creates an instance of MatchQuery.
 OntylogConcept[] findConceptsWithSiloMatching(String pattern, MatchOptions searchSpec)
          Gets an array of concept objects that represents the search pattern, but with those attributes present that are specified in the AttributteSetDescriptor.
 Silo[] getAllSilos()
          Retrieves all silos known in the knowledgebase.
 Map getIdMap()
          Deprecated. Do not use in application code. For use by Apelon's internal API implementation only. This method will be removed in a future DTS release. Use getAllSilos() instead.
 Map getNameMap()
          Deprecated. Do not use in application code. For use by Apelon's internal API implementation only. This method will be removed in a future DTS release. Use getAllSilos() instead.
 Match[] searchSilo(String pattern, MatchOptions searchSpec)
          Performs a search for the specified pattern using the given search specification and returns an array of matches.
 
Methods inherited from class com.apelon.apelonserver.client.BasicQuery
executeQuery, executeQueryNoParse, getServerConnection, initializeDtds, initializeDtds, ping, setVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatchQuery

protected MatchQuery(boolean isValidating)
Method Detail

findConceptsWithSiloMatching

public OntylogConcept[] findConceptsWithSiloMatching(String pattern,
                                                     MatchOptions searchSpec)
                                              throws DTSException
Gets an array of concept objects that represents the search pattern, but with those attributes present that are specified in the AttributteSetDescriptor.

Parameters:
searchSpec - the search criteria, such as the searched silo, and a limit on returned matches
pattern - the query string (pattern) on which the search is based
Returns:
an array of concepts that contain the search string pattern
Throws:
DTSException - if any error occurs in the method

searchSilo

public Match[] searchSilo(String pattern,
                          MatchOptions searchSpec)
                   throws DTSException
Performs a search for the specified pattern using the given search specification and returns an array of matches.

Parameters:
pattern - the words to search for
searchSpec - the search criteria, such as the searched silo, and a limit on returned matches
Returns:
an array of Matches that matched the search words
Throws:
DTSException - if any error occurs in the method

createInstance

public static MatchQuery createInstance(ServerConnection sc)
                                 throws IllegalArgumentException
Creates an instance of MatchQuery. Depending on the type of ServerConnection object passed in the argument, the server may be local (JDBC), socket, or another implementation. When using a socket connection, the Apelon DTS server must be configured with the following query servers to support MatchQuery: If you're using a JDBC connection, you'll need to add something like the following lines:
  ServerConnectionJDBC scJDBC = new ServerConnectionJDBC(user, password,
    host, port, instance);
  scJDBC.setQueryServer(com.apelon.dts.server.MatchServer.class,
    DTSHeader.MATCHSERVER_HEADER);
  MatchQuery matchQuery = MatchQuery.createInstance(scJDBC);
 

Parameters:
sc - the server connection
Returns:
the created MatchQuery
Throws:
IllegalArgumentException - if a null server connection is passed
See Also:
ServerConnectionJDBC, ServerConnectionSocket, ServerConnectionSecureSocket

createInstance

public static MatchQuery createInstance(ServerConnection sc,
                                        boolean isValidating)
                                 throws IllegalArgumentException
Creates an instance of MatchQuery. Depending on the type of ServerConnection object passed in the first argument, the server may be local (JDBC), socket, or another implementation. The second argument is a boolean value for XML validation. When using a socket connection, the Apelon DTS server must be configured with the following query servers to support MatchQuery: If you're using a JDBC connection, you'll need to add something like the following lines:
  ServerConnectionJDBC scJDBC = new ServerConnectionJDBC(user, password,
    host, port, instance);
  scJDBC.setQueryServer(com.apelon.dts.server.MatchServer.class,
    DTSHeader.MATCHSERVER_HEADER);
  MatchQuery matchQuery = MatchQuery.createInstance(scJDBC,
    true);
 

Parameters:
sc - the server connection
isValidating - true if XML needs to be validated, false otherwise.
Returns:
the created MatchQuery
Throws:
IllegalArgumentException - if a null server connection is passed
See Also:
ServerConnectionJDBC, ServerConnectionSocket, ServerConnectionSecureSocket

getAllSilos

public Silo[] getAllSilos()
                   throws DTSException
Retrieves all silos known in the knowledgebase.

Returns:
An array of all the Silos. Returns an empty array if there are no Silos.
Throws:
DTSException - if an error occurs in the method

getIdMap

public Map getIdMap()
Deprecated. Do not use in application code. For use by Apelon's internal API implementation only. This method will be removed in a future DTS release. Use getAllSilos() instead.

Returns the silo ID Map. The key is silo name, and the value is silo ID.

Returns:
silo ID Map

getNameMap

public Map getNameMap()
Deprecated. Do not use in application code. For use by Apelon's internal API implementation only. This method will be removed in a future DTS release. Use getAllSilos() instead.

Returns the silo name Map. The key is silo ID, and the value is silo name.

Returns:
silo name Map


Copyright © 2011. All Rights Reserved.