uninstallPolling();
stateCache.clear();
scpdUtil = null;
-
- super.dispose();
}
/**
// clear auth cache and force re-auth
AuthenticationStore authStore = httpClient.getAuthenticationStore();
- authStore.clearAuthentications();
- authStore.clearAuthenticationResults();
+ URI endpointUri = URI.create(endpointBaseURL);
+ Authentication authentication = authStore.findAuthentication("Digest", endpointUri,
+ Authentication.ANY_REALM);
+ if (authentication != null) {
+ authStore.removeAuthentication(authentication);
+ }
+ Authentication.Result authResult = authStore.findAuthenticationResult(endpointUri);
+ if (authResult != null) {
+ authStore.removeAuthenticationResult(authResult);
+ }
authStore.addAuthentication(new DigestAuthentication(new URI(endpointBaseURL), Authentication.ANY_REALM,
config.user, config.password));
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.net.URI;
import java.time.Duration;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jetty.client.HttpClient;
+import org.eclipse.jetty.client.api.Authentication;
import org.eclipse.jetty.client.api.ContentResponse;
import org.eclipse.jetty.client.api.Request;
import org.eclipse.jetty.client.util.BytesContentProvider;
if (response.getStatus() == HttpStatus.UNAUTHORIZED_401) {
// retry once if authentication expired
logger.trace("Re-Auth needed.");
- httpClient.getAuthenticationStore().clearAuthenticationResults();
+ Authentication.Result authResult = httpClient.getAuthenticationStore()
+ .findAuthenticationResult(URI.create(endpointBaseURL));
+ if (authResult != null) {
+ httpClient.getAuthenticationStore().removeAuthenticationResult(authResult);
+ }
request = prepareSOAPRequest(soapRequest).timeout(timeout, TimeUnit.SECONDS);
response = request.send();
}
@SuppressWarnings("unused")
private State processTamListURL(State state, Tr064ChannelConfig channelConfig) throws PostProcessingException {
try {
- ContentResponse response = httpClient.newRequest(state.toString()).timeout(timeout, TimeUnit.MILLISECONDS)
+ ContentResponse response = httpClient.newRequest(state.toString()).timeout(timeout, TimeUnit.SECONDS)
.send();
String responseContent = response.getContentAsString();
int messageCount = responseContent.split("<New>1</New>").length - 1;