com.apelon.dts.client.common
Class DTSCommonQuery

java.lang.Object
  extended by com.apelon.apelonserver.client.BasicQuery
      extended by com.apelon.dts.client.common.DTSCommonQuery
All Implemented Interfaces:
com.apelon.common.license.client.LicenseQuery

public abstract class DTSCommonQuery
extends BasicQuery
implements com.apelon.common.license.client.LicenseQuery

This class provides method to get common DTS data.

It provides a method to retreive schema version for a DTS schema

Copyright: Copyright (c) 2004

Company: Apelon, Inc.

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

Field Summary
 
Fields inherited from class com.apelon.apelonserver.client.BasicQuery
ADMIN, queryHeader
 
Constructor Summary
protected DTSCommonQuery()
           
protected DTSCommonQuery(boolean isValidating)
           
 
Method Summary
 void cancelRequest(long requestId)
           
 void checkDTSSchema()
          Check that the correct DTS schema is installed.
static DTSCommonQuery createInstance(ServerConnection sc)
          Creates an instance of DTSCommonQuery.
static DTSCommonQuery createInstance(ServerConnection sc, boolean isValidating)
          Creates an instance of DTSCommonQuery.
 String fetchStatus(long requestId)
           
 long generateRequestId()
           
 String[] getAllLicenses(String condition)
          Gets all licenses from the server.
 String getLicense(String source)
          Gets the license for a given source.
 String getSchemaVersion(String schemaName)
          Returns the version of the given schema name.
 
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

DTSCommonQuery

protected DTSCommonQuery()

DTSCommonQuery

protected DTSCommonQuery(boolean isValidating)
Method Detail

createInstance

public static DTSCommonQuery createInstance(ServerConnection sc)
                                     throws IllegalArgumentException
Creates an instance of DTSCommonQuery. 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 server to support DTSCommonQuery: 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);
  DTSCommonQuery dtsQuery =
    DTSCommonQuery.createInstance(scJDBC);
      sc.setQueryServer(Class.forName("com.apelon.dts.server.DTSCommonServer"),
     DTSHeader.DTSCOMMONSERVER_HEADER);

 

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

createInstance

public static DTSCommonQuery createInstance(ServerConnection sc,
                                            boolean isValidating)
                                     throws IllegalArgumentException
Creates an instance of DTSCommonQuery. 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 server to support DTSCommonQuery: If you're using a JDBC connection, you'll need to add something like the following lines:
  ServerConnection sc = new ServerConnectionJDBC(user, password,
    host, port, instance);
  DTSCommonQuery dtsQuery =
    DTSCommonQuery.createInstance(sc);
  sc.setQueryServer(Class.forName("com.apelon.dts.server.DTSCommonServer"),
    DTSHeader.DTSCOMMONSERVER_HEADER);

 

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

checkDTSSchema

public void checkDTSSchema()
                    throws DTSException,
                           DTSValidationException
Check that the correct DTS schema is installed.

Throws:
DTSException - The exception if schema is not correct.
DTSValidationException

getSchemaVersion

public String getSchemaVersion(String schemaName)
                        throws DTSException
Returns the version of the given schema name.

Parameters:
schemaName - Schema Name
Returns:
version of the schema name. If the version is not found, it will return null.
Throws:
DTSException

generateRequestId

public long generateRequestId()
                       throws DTSException
Throws:
DTSException

cancelRequest

public void cancelRequest(long requestId)
                   throws DTSException
Throws:
DTSException

fetchStatus

public String fetchStatus(long requestId)
                   throws DTSException
Throws:
DTSException

getLicense

public String getLicense(String source)
                  throws ApelonException,
                         DTSException
Gets the license for a given source. The source should be Namespace ID as String.

Specified by:
getLicense in interface com.apelon.common.license.client.LicenseQuery
Parameters:
source - the Namespace ID for which the license is to be retrieved
Returns:
String the string describing the license text
Throws:
DTSException - error
ApelonException - error
Since:
DTS 3.3.0

getAllLicenses

public String[] getAllLicenses(String condition)
                        throws ApelonException,
                               DTSException
Gets all licenses from the server. If no condition exists, then pass in a empty String.

Specified by:
getAllLicenses in interface com.apelon.common.license.client.LicenseQuery
Parameters:
condition - condition - if none exists, pass empty
Returns:
String [] an array of Strings describing the licenses
Throws:
DTSException - error
ApelonException - error
Since:
DTS 3.3.0


Copyright © 2011. All Rights Reserved.