|
LimeWire Consolidated API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.limewire.promotion.AbstractPromotionBinderRequestor
public abstract class AbstractPromotionBinderRequestor
Instances of this class make POST requests to the URL given
for containers, and also add the data given in the UserQueryEvent.
The PromotionBinder that is passed in is created by the injected
PromotionBinderFactory.
| Constructor Summary | |
|---|---|
AbstractPromotionBinderRequestor(PromotionBinderFactory binderFactory)
|
|
| Method Summary | |
|---|---|
protected abstract String |
alterUrl(String url)
Subclasses should alter the final URL in this method, such as adding version information, etc. |
static String |
encode(String string)
|
protected abstract void |
error(Exception e)
Called when an Exception occurs. |
protected abstract String |
getUserAgent()
Returns the User-Agent to send along with the
POST request. |
protected abstract InputStream |
makeRequest(org.apache.http.client.methods.HttpPost request,
org.apache.http.params.HttpParams params)
Called once the PostMethod request is constructed. |
PromotionBinder |
request(String url,
long id,
Set<? extends UserQueryEvent> queries)
The main entry point. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractPromotionBinderRequestor(PromotionBinderFactory binderFactory)
| Method Detail |
|---|
public final PromotionBinder request(String url,
long id,
Set<? extends UserQueryEvent> queries)
POST request to
url and include the proper information we want to store.
request in interface PromotionBinderRequestorPromotionBinder created from the url or null if there is not oneprotected abstract void error(Exception e)
Exception occurs.
e - the Exception that occured.protected abstract String getUserAgent()
User-Agent to send along with the
POST request.
User-Agent to send along with the
POST request.protected abstract String alterUrl(String url)
protected abstract InputStream makeRequest(org.apache.http.client.methods.HttpPost request,
org.apache.http.params.HttpParams params)
throws org.apache.http.HttpException,
IOException
PostMethod request is constructed.
The purpose of the callback is so we can pass a PromotionBindder
created from the PromotionBinderFactory from the passed in bytes
we recieve from the request.
request - POST to send to a server
org.apache.http.HttpException - thrown when a protocol error occurs
IOException - thrown when a protocol I/O occurspublic static String encode(String string)
|
LimeWire Consolidated API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||