com.j_spaces.core.client
Class RegExQuery<T>

java.lang.Object
  extended by com.j_spaces.core.client.RegExQuery<T>
All Implemented Interfaces:
Query<T>, Serializable, Entry

Deprecated. - use SQLQuery with 'rlike'

@Deprecated
public class RegExQuery<T>
extends Object
implements Query<T>

The RegExQuery class is used to query the space using the Java Regular Expression syntax. For more information about Java regular expression syntax - see:

See Also:
Serialized Form

Constructor Summary
RegExQuery()
          Deprecated. Empty constructor.
RegExQuery(Entry entry, String[] attributeName, String[] regExpression)
          Deprecated. Constructor to initialize Regular Expression Query with Entry, from which class name is extracted.
RegExQuery(String className, String[] attributeName, String[] regExpression)
          Deprecated. Constructor to initialize Regular Expression Query with Entry class name.
RegExQuery(T object, String[] attributeName, String[] regExpression)
          Deprecated. Constructor to initialize Regular Expression Query with Entry, from which class name is extracted.
 
Method Summary
 ExternalEntry getExternalEntry()
          Deprecated. Returns a reference to the ExternalEntry set for this query.
 T getObject()
          Deprecated. Extract the POJO for the current query.
 boolean isExternalEntry()
          Deprecated. Check is ExternalEntry.
 void setClassName(String className)
          Deprecated. Sets the template class name of an entry to be queried.
 void setQuery(String wherePart)
          Deprecated. Sets the Query WHERE statement (without the WHERE keyword).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegExQuery

public RegExQuery(String className,
                  String[] attributeName,
                  String[] regExpression)
Deprecated. 
Constructor to initialize Regular Expression Query with Entry class name.

Parameters:
className - - The class name to be queried
attributeName - - The field name array attribute to be queried.
regExpression - - The regular expression. Every item in the array should match the

Usage Example:

 RegExQuery regExQuery = new RegExQuery(MyEntry.class.getName(), new String[]{"m_string"}, new String[]{"a*b"});
 Entry result[] = space.readMultiple(regExQuery, null, Integer.MAX_VALUE);
 ...
 


relevant item in the attributeName array.

Setting up a Notification Delegator for the Regular Expression Query

 String querystr = "a?b";
 System.out.println("Register Notification for RegExQuery:" + querystr);
 RegExQuery m_Template = new RegExQuery(new MyEntry(), new String[]{"m_string"}, new String[]{querystr});
 NotifyDelegator delegator = new NotifyDelegator(space, m_Template, null, this, Lease.FOREVER, null, false, NotifyModifiers.NOTIFY_ALL);
 System.out.println("Notification registered. Registration id: "
         + delegator.getEventRegistration().getID()
         + " ; Sequence number: "
         + delegator.getEventRegistration().getSequenceNumber());
 

RegExQuery

public RegExQuery(Entry entry,
                  String[] attributeName,
                  String[] regExpression)
Deprecated. 
Constructor to initialize Regular Expression Query with Entry, from which class name is extracted.

Parameters:
entry - - Entry or an instance of ExternalEntry to be queried by its class name.
attributeName - - the field name array attribute to be queried.
regExpression - - the regular expression to be matched with every item in the attributeName array

Usage Example:

 RegExQuery regExQuery = new RegExQuery(MyEntry, new String[]{"m_string"}, new String[]{"a*b"});
 Entry result = space.take(regExQuery, null, JavaSpace.NO_WAIT);
 if (result==null)
     System.out.println("No match found for query: "+regExQuery);
 else
     System.out.println("Found entry: " +result);
 

RegExQuery

public RegExQuery(T object,
                  String[] attributeName,
                  String[] regExpression)
Deprecated. 
Constructor to initialize Regular Expression Query with Entry, from which class name is extracted.

Parameters:
object - - POJO or an instance of ExternalEntry to be queried by its class name.
attributeName - - the field name array attribute to be queried.
regExpression - - the regular expression to be matched with every item in the attributeName array

Usage Example:

 RegExQuery regExQuery = new RegExQuery(MyEntry, new String[]{"m_string"}, new String[]{"a*b"});
 Entry result = space.take(regExQuery, null, JavaSpace.NO_WAIT);
 if (result==null)
     System.out.println("No match found for query: "+regExQuery);
 else
     System.out.println("Found entry: " +result);
 

RegExQuery

public RegExQuery()
Deprecated. 
Empty constructor.

Method Detail

getExternalEntry

public ExternalEntry getExternalEntry()
Deprecated. 
Returns a reference to the ExternalEntry set for this query.

Returns:
ExternalEntry

isExternalEntry

public boolean isExternalEntry()
Deprecated. 
Check is ExternalEntry.

Returns:
true if ExternalEntry

setClassName

public void setClassName(String className)
Deprecated. 
Sets the template class name of an entry to be queried.

Specified by:
setClassName in interface Query<T>
Parameters:
className - The Entry class name to be set.

setQuery

public void setQuery(String wherePart)
Deprecated. 
Sets the Query WHERE statement (without the WHERE keyword).

Specified by:
setQuery in interface Query<T>
Parameters:
wherePart - WHERE statement

getObject

public T getObject()
Deprecated. 
Extract the POJO for the current query.

Returns:
Returns the POJO or null value if this sql query represent Entry object.