org.hops.ext
Class dbcall

java.lang.Object
  extended by org.hops.ext.dbcall

public class dbcall
extends java.lang.Object

Allows access to the AQM or if not connection known simulates the backend access throw the console


Constructor Summary
dbcall(boolean userData, java.lang.String dbfile)
          Creates a new instance of dummy db
 
Method Summary
 attrval consultDB(attrval q, stackp commitments, stackp believes)
          Consults the database.
 stackp queryDB(attrval exequery, java.util.ArrayList requestedData, stackp commitments, stackp believes, PlanSet plans)
          Execute a query in the database.
static void selectRefineAttribute(stackp stack)
          Converts a stackp to a RecognitionObject of HopsAttributes static private RecognitionObject toRecognitionObject( stackp stackin ){ RecognitionObject ro = new RecognitionObject(); HopsAttribute ha; for ( int i=0; i
static boolean validDBParameter(attrval param, PlanSet plans)
          the param is valid if it exists on the plans
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

dbcall

public dbcall(boolean userData,
              java.lang.String dbfile)
Creates a new instance of dummy db

Method Detail

validDBParameter

public static boolean validDBParameter(attrval param,
                                       PlanSet plans)
the param is valid if it exists on the plans

Parameters:
param - the parameter
plans - the DM plans

consultDB

public attrval consultDB(attrval q,
                         stackp commitments,
                         stackp believes)
Consults the database. It is expected to receive a value for the input attribute. This attribute must be then answered to the user in the next interaction.

Parameters:
q - the attribute we are searching
commitments - the commitments stack
believes - the believes stack
Returns:
the q attribute with its value

queryDB

public stackp queryDB(attrval exequery,
                      java.util.ArrayList requestedData,
                      stackp commitments,
                      stackp believes,
                      PlanSet plans)
Execute a query in the database. The result could be any: just one value, or some elements, or whatever.

Parameters:
exequery - the name of the query to execute
requestedData - the data expected to obtain
commitments - the commitments stack
believes - the believes stack
Returns:
the stack of results

selectRefineAttribute

public static void selectRefineAttribute(stackp stack)
Converts a stackp to a RecognitionObject of HopsAttributes static private RecognitionObject toRecognitionObject( stackp stackin ){ RecognitionObject ro = new RecognitionObject(); HopsAttribute ha; for ( int i=0; i