|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--arlut.csd.ganymede.DBQueryHandler
This class is the query processing engine for the Ganymede database. Static methods in this class are used to test a query tree against an individual object in the database.
The GanymedeSession's
queryDispatch()
method contains most of the query engine's
logic (including namespace-indexed query optimization). This class is just
responsible for applying a recursive QueryNode tree to a particular object.
QueryNode,
Query| Field Summary | |
(package private) static boolean |
debug
|
| Constructor Summary | |
DBQueryHandler()
|
|
| Method Summary | |
private static boolean |
compareIPs(java.lang.Byte[] param1,
java.lang.Byte[] param2)
IP address values are encoded as byte arrays in the Ganymede server.. |
private static boolean |
compareString(arlut.csd.ganymede.QueryDataNode n,
java.lang.String string1,
java.lang.String string2)
string1 is the query value provided by the client, string2 is the value we are testing. |
private static boolean |
compareStringArray(arlut.csd.ganymede.QueryDataNode n,
java.lang.String queryValue,
java.util.Vector values)
|
private static boolean |
compareStrings(arlut.csd.ganymede.QueryDataNode n,
java.lang.String queryValue,
java.lang.String value)
|
private static java.lang.Byte[] |
ipAddrNoPad(java.lang.Byte[] ipaddr)
This helper method extracts the leading octets from the supplied IP address that are not all zeros. |
private static boolean |
ipBeginsWith(java.lang.Byte[] param1,
java.lang.Byte[] param2)
IP address values are encoded as byte arrays in the Ganymede server.. |
private static boolean |
ipEndsWith(java.lang.Byte[] param1,
java.lang.Byte[] param2)
IP address values are encoded as byte arrays in the Ganymede server.. |
static boolean |
matches(arlut.csd.ganymede.GanymedeSession session,
arlut.csd.ganymede.Query q,
arlut.csd.ganymede.DBObject obj)
This method compares an object with a submitted query, returning true if the object matches the query. |
static boolean |
nodeMatch(arlut.csd.ganymede.GanymedeSession session,
arlut.csd.ganymede.QueryNode qN,
arlut.csd.ganymede.DBObject obj)
Recursive static method to compare a Query tree against an object in the database. |
private static short |
s2u(byte b)
This method maps a u2s-encoded signed byte value to an int value between 0 and 255 inclusive. |
private static byte |
u2s(int x)
This method maps an int value between 0 and 255 inclusive to a legal signed byte value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
static final boolean debug
| Constructor Detail |
public DBQueryHandler()
| Method Detail |
public static final boolean matches(arlut.csd.ganymede.GanymedeSession session,
arlut.csd.ganymede.Query q,
arlut.csd.ganymede.DBObject obj)
session - The GanymedeSession performing the query. This parameter is
used to access the database to find the object's label if the query contains
any clauses matching against the object's label.q - The Query being compared to this object.obj - The object being tested.
public static final boolean nodeMatch(arlut.csd.ganymede.GanymedeSession session,
arlut.csd.ganymede.QueryNode qN,
arlut.csd.ganymede.DBObject obj)
session - The GanymedeSession performing the query. This parameter is
used to access the database to find the object's label if the query contains
any clauses matching against the object's label.qN - The QueryNode being compared to this object.obj - The object being tested.
private static boolean compareStrings(arlut.csd.ganymede.QueryDataNode n,
java.lang.String queryValue,
java.lang.String value)
private static boolean compareStringArray(arlut.csd.ganymede.QueryDataNode n,
java.lang.String queryValue,
java.util.Vector values)
private static boolean compareString(arlut.csd.ganymede.QueryDataNode n,
java.lang.String string1,
java.lang.String string2)
private static boolean compareIPs(java.lang.Byte[] param1,
java.lang.Byte[] param2)
private static boolean ipBeginsWith(java.lang.Byte[] param1,
java.lang.Byte[] param2)
private static boolean ipEndsWith(java.lang.Byte[] param1,
java.lang.Byte[] param2)
private static java.lang.Byte[] ipAddrNoPad(java.lang.Byte[] ipaddr)
This helper method extracts the leading octets from the supplied IP address that are not all zeros. I.e., for the address 129.0.116.0, ipAddrNoPad() would return 129.0.116, where for the address 129.116.0.0, ipAddrNoPad() would return 129.116.
Note that, like all Ganymede code dealing with IP addresses, Ganymede is using the u2s() and s2u() methods here to handle encoded unsigned values in the Java signed byte/Byte type/object.
private static final byte u2s(int x)
This method maps an int value between 0 and 255 inclusive to a legal signed byte value.
private static final short s2u(byte b)
This method maps a u2s-encoded signed byte value to an int value between 0 and 255 inclusive.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||