|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.service.contactsource.AbstractContactQuery<T>
net.java.sip.communicator.service.contactsource.AsyncContactQuery<T>
T - the very type of ContactSourceService which performs the
ContactQuerypublic abstract class AsyncContactQuery<T extends ContactSourceService>
Provides an abstract implementation of a ContactQuery which runs in a separate Thread.
| Field Summary | |
|---|---|
protected Pattern |
query
The Pattern for which the associated ContactSourceService is being queried. |
| Fields inherited from interface net.java.sip.communicator.service.contactsource.ContactQuery |
|---|
QUERY_CANCELED, QUERY_COMPLETED, QUERY_ERROR, QUERY_IN_PROGRESS |
| Constructor Summary | |
|---|---|
protected |
AsyncContactQuery(T contactSource,
Pattern query)
Initializes a new AsyncContactQuery instance which is to perform a specific query on behalf of a specific contactSource. |
| Method Summary | |
|---|---|
protected boolean |
addQueryResult(SourceContact sourceContact)
Adds a specific SourceContact to the list of SourceContacts to be returned by this ContactQuery in response to getQueryResults(). |
protected String |
getPhoneNumberQuery()
Gets the query of this AsyncContactQuery as a
String which represents a phone number (if possible). |
int |
getQueryResultCount()
Gets the number of SourceContacts which match this ContactQuery. |
List<SourceContact> |
getQueryResults()
Gets the List of SourceContacts which match this ContactQuery. |
String |
getQueryString()
Returns the query string, this query was created for. |
protected abstract String |
normalizePhoneNumber(String phoneNumber)
Normalizes a String phone number by converting alpha characters to their respective digits on a keypad and then stripping non-digit characters. |
protected abstract boolean |
phoneNumberMatches(String phoneNumber)
Determines whether a specific String phone number matches the query of this AsyncContactQuery. |
protected abstract void |
run()
Performs this ContactQuery in a background Thread. |
void |
start()
Starts this AsyncContactQuery. |
protected void |
stopped(boolean completed)
Notifies this AsyncContactQuery that it has stopped performing in the associated background Thread. |
| Methods inherited from class net.java.sip.communicator.service.contactsource.AbstractContactQuery |
|---|
addContactQueryListener, cancel, fireContactReceived, fireQueryStatusChanged, getContactSource, getStatus, removeContactQueryListener, setStatus |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Pattern query
| Constructor Detail |
|---|
protected AsyncContactQuery(T contactSource,
Pattern query)
contactSource - the ContactSourceService which is to
perform the new ContactQuery instancequery - the Pattern for which contactSource is
being queried| Method Detail |
|---|
protected boolean addQueryResult(SourceContact sourceContact)
getQueryResults().
sourceContact - the SourceContact to be added to the
queryResults of this ContactQuery
protected String getPhoneNumberQuery()
query of this AsyncContactQuery as a
String which represents a phone number (if possible).
public int getQueryResultCount()
public List<SourceContact> getQueryResults()
ContactQuery.getQueryResults()public String getQueryString()
protected abstract String normalizePhoneNumber(String phoneNumber)
phoneNumber - a String which represents a phone number to
normalize
protected abstract boolean phoneNumberMatches(String phoneNumber)
query of this AsyncContactQuery.
phoneNumber - the String which represents the phone number
to match to the query of this AsyncContactQuery
protected abstract void run()
public void start()
protected void stopped(boolean completed)
completed - true if this ContactQuery has
successfully completed, false if an error has been encountered
during its execution
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||