gov.nih.nci.cagrid.data.cql.cacore
Class SubclassCheckCache

java.lang.Object
  extended by gov.nih.nci.cagrid.data.cql.cacore.SubclassCheckCache

public class SubclassCheckCache
extends java.lang.Object

SubclassCheckCache Checks that a given class has or does not have a class property in the caCORE backend data source. This property is only present for classes which have subclasses stored in the database as well.

Version:
$Id$
Author:
David W. Ervin

Field Summary
static java.lang.String CABIO_URL
           
static java.lang.String CLASS_PROPERTY_NOT_FOUND_ERROR
           
 
Constructor Summary
SubclassCheckCache()
           
 
Method Summary
static boolean hasClassProperty(java.lang.String className, gov.nih.nci.system.applicationservice.ApplicationService queryService)
          Executes a test query against the application service to see if the specified type has a class discriminator parameter, which indicates that it has subclass instances available in the data source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CABIO_URL

public static final java.lang.String CABIO_URL
See Also:
Constant Field Values

CLASS_PROPERTY_NOT_FOUND_ERROR

public static final java.lang.String CLASS_PROPERTY_NOT_FOUND_ERROR
See Also:
Constant Field Values
Constructor Detail

SubclassCheckCache

public SubclassCheckCache()
Method Detail

hasClassProperty

public static boolean hasClassProperty(java.lang.String className,
                                       gov.nih.nci.system.applicationservice.ApplicationService queryService)
                                throws QueryProcessingException
Executes a test query against the application service to see if the specified type has a class discriminator parameter, which indicates that it has subclass instances available in the data source. If an exception indicating the type has no class discriminator is thrown, this method returns false. If the query succedes, the method returns true. In this case, this is a somewhat expensive operation on the first call using that class name. All subsequent calls with the same class name are cached and return in order log(n) time, where n is the number of unique class names checked with this method.

Parameters:
className - The name of the class to test
queryService - The application service to submit the test query to
Returns:
True if the class discriminator is present, false otherwise
Throws:
QueryProcessingException