T
- the very type of ContactSourceService which performs the
ContactQuerypublic abstract class AsyncContactQuery<T extends ContactSourceService> extends AbstractContactQuery<T>
Modifier and Type | Field and Description |
---|---|
protected java.util.regex.Pattern |
query
The Pattern for which the associated
ContactSourceService is being queried.
|
QUERY_CANCELED, QUERY_COMPLETED, QUERY_ERROR, QUERY_IN_PROGRESS
Modifier | Constructor and Description |
---|---|
protected |
AsyncContactQuery(T contactSource,
java.util.regex.Pattern query)
Initializes a new AsyncContactQuery instance which is to perform
a specific query on behalf of a specific contactSource.
|
protected |
AsyncContactQuery(T contactSource,
java.util.regex.Pattern query,
boolean isSorted)
Initializes a new AsyncContactQuery instance which is to perform
a specific query on behalf of a specific contactSource.
|
Modifier and Type | Method and Description |
---|---|
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 boolean |
addQueryResult(SourceContact sourceContact,
boolean showMoreEnabled)
Adds a specific SourceContact to the list of
SourceContacts to be returned by this ContactQuery in
response to
getQueryResults() . |
protected boolean |
addQueryResults(java.util.Set<? extends SourceContact> sourceContacts)
Adds a set of SourceContact instances to the list of
SourceContacts to be returned by this ContactQuery in
response to
getQueryResults() . |
protected java.lang.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.
|
java.util.List<SourceContact> |
getQueryResults()
Gets the List of SourceContacts which match this
ContactQuery.
|
java.lang.String |
getQueryString()
Returns the query string, this query was created for.
|
protected boolean |
phoneNumberMatches(java.lang.String phoneNumber)
Determines whether a specific String phone number matches the
query of this AsyncContactQuery. |
protected boolean |
removeQueryResult(SourceContact sourceContact)
Removes a specific SourceContact from the list of
SourceContacts.
|
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.
|
addContactQueryListener, cancel, fireContactChanged, fireContactReceived, fireContactReceived, fireContactRemoved, fireQueryStatusChanged, getContactSource, getStatus, removeContactQueryListener, setStatus
protected final java.util.regex.Pattern query
protected AsyncContactQuery(T contactSource, java.util.regex.Pattern query, boolean isSorted)
contactSource
- the ContactSourceService which is to
perform the new ContactQuery instancequery
- the Pattern for which contactSource is
being queriedisSorted
- indicates if the results of this query should be sortedprotected AsyncContactQuery(T contactSource, java.util.regex.Pattern query)
contactSource
- the ContactSourceService which is to
perform the new ContactQuery instancequery
- the Pattern for which contactSource is
being queriedprotected boolean addQueryResult(SourceContact sourceContact, boolean showMoreEnabled)
getQueryResults()
.sourceContact
- the SourceContact to be added to the
queryResults of this ContactQueryshowMoreEnabled
- indicates whether show more label should be shown
or not.protected boolean addQueryResult(SourceContact sourceContact)
getQueryResults()
.sourceContact
- the SourceContact to be added to the
queryResults of this ContactQueryprotected boolean removeQueryResult(SourceContact sourceContact)
sourceContact
- the SourceContact to be removed from the
queryResults of this ContactQueryprotected boolean addQueryResults(java.util.Set<? extends SourceContact> sourceContacts)
getQueryResults()
.sourceContacts
- the set of SourceContact to be added to
the queryResults of this ContactQueryprotected java.lang.String getPhoneNumberQuery()
query
of this AsyncContactQuery as a
String which represents a phone number (if possible).public int getQueryResultCount()
public java.util.List<SourceContact> getQueryResults()
ContactQuery.getQueryResults()
public java.lang.String getQueryString()
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 executionprotected boolean phoneNumberMatches(java.lang.String phoneNumber)
query
of this AsyncContactQuery.phoneNumber
- the String which represents the phone number
to match to the query of this AsyncContactQuery
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.