Search in sources :

Example 6 with UnsubscribeRequest

use of it.unibo.arces.wot.sepa.commons.request.UnsubscribeRequest in project SEPA by arces-wot.

the class GenericClient method unsubscribe.

public void unsubscribe(String subID, long timeout, long nRetry) throws SEPASecurityException, SEPAPropertiesException, SEPAProtocolException, InterruptedException {
    if (!subscriptions.containsKey(subID))
        return;
    synchronized (subLock) {
        if (req != null)
            subLock.wait();
        req = new UnsubscribeRequest(subID, (appProfile.isSecure() ? appProfile.getAuthenticationProperties().getBearerAuthorizationHeader() : null), timeout, nRetry);
        subscriptions.get(subID).unsubscribe((UnsubscribeRequest) req);
    }
}
Also used : UnsubscribeRequest(it.unibo.arces.wot.sepa.commons.request.UnsubscribeRequest)

Aggregations

UnsubscribeRequest (it.unibo.arces.wot.sepa.commons.request.UnsubscribeRequest)6 SubscribeRequest (it.unibo.arces.wot.sepa.commons.request.SubscribeRequest)3 UpdateRequest (it.unibo.arces.wot.sepa.commons.request.UpdateRequest)2 ErrorResponse (it.unibo.arces.wot.sepa.commons.response.ErrorResponse)2 Response (it.unibo.arces.wot.sepa.commons.response.Response)2 JsonObject (com.google.gson.JsonObject)1 JsonParseException (com.google.gson.JsonParseException)1 JsonParser (com.google.gson.JsonParser)1 SEPASecurityException (it.unibo.arces.wot.sepa.commons.exceptions.SEPASecurityException)1 SSLSecurityManager (it.unibo.arces.wot.sepa.commons.protocol.SSLSecurityManager)1 QueryRequest (it.unibo.arces.wot.sepa.commons.request.QueryRequest)1 RegistrationRequest (it.unibo.arces.wot.sepa.commons.request.RegistrationRequest)1 Request (it.unibo.arces.wot.sepa.commons.request.Request)1 QueryResponse (it.unibo.arces.wot.sepa.commons.response.QueryResponse)1 SubscribeResponse (it.unibo.arces.wot.sepa.commons.response.SubscribeResponse)1 UpdateResponse (it.unibo.arces.wot.sepa.commons.response.UpdateResponse)1 ScheduledRequest (it.unibo.arces.wot.sepa.engine.scheduling.ScheduledRequest)1 IOException (java.io.IOException)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 URI (java.net.URI)1