@NotThreadSafe public class PDClient extends Object implements Closeable
| Modifier and Type | Field and Description |
|---|---|
static String |
PATH_INDEXER_10
The fixed part of the URL to the PD server
|
| Constructor and Description |
|---|
PDClient(String sPDHost)
Constructor with a direct PEPPOL Directory URL.
|
PDClient(URI aPDHost)
Constructor with a direct PEPPOL Directory URL.
|
| Modifier and Type | Method and Description |
|---|---|
com.helger.commons.state.ESuccess |
addServiceGroupToIndex(com.helger.peppol.identifier.generic.participant.IParticipantIdentifier aParticipantID) |
void |
close() |
com.helger.commons.state.ESuccess |
deleteServiceGroupFromIndex(com.helger.peppol.identifier.generic.participant.IParticipantIdentifier aParticipantID) |
protected <T> T |
executeRequest(org.apache.http.client.methods.HttpRequestBase aRequest,
org.apache.http.client.ResponseHandler<T> aHandler)
The main execution routine.
|
IPDClientExceptionCallback |
getExceptionHandler()
Get the current installed exception handler.
|
String |
getPDHostURI() |
org.apache.http.HttpHost |
getProxy() |
org.apache.http.auth.Credentials |
getProxyCredentials() |
boolean |
isServiceGroupRegistered(com.helger.peppol.identifier.generic.participant.IParticipantIdentifier aParticipantID)
Gets a list of references to the CompleteServiceGroup's owned by the
specified userId.
|
void |
setExceptionHandler(IPDClientExceptionCallback aExceptionHdl)
Set the exception handler to be used.
|
void |
setHttpClientManager(com.helger.httpclient.HttpClientManager aHttpClientMgr)
Internal method to set a different
HttpClientManager in case the
default one using PDHttpClientFactory is not suitable (any more). |
void |
setProxy(org.apache.http.HttpHost aProxy)
Set the proxy to be used to access the PEPPOL Directory server.
|
void |
setProxyCredentials(org.apache.http.auth.Credentials aProxyCredentials)
Set the proxy Credentials to be used to access the PEPPOL Directory server.
|
public static final String PATH_INDEXER_10
public PDClient(@Nonnull String sPDHost)
sPDHost - The address of the PEPPOL Directory Server including the application
server context path but without the REST interface. May be http or
https. Example: https://directory.peppol.eu/public void close()
close in interface Closeableclose in interface AutoCloseable@Nonnull public IPDClientExceptionCallback getExceptionHandler()
null.setExceptionHandler(IPDClientExceptionCallback)public void setExceptionHandler(@Nonnull IPDClientExceptionCallback aExceptionHdl)
HttpResponseException indicating
that something went wrong with an HTTP request.aExceptionHdl - The exception callback to be invoked. May not be null.getExceptionHandler()@Nonnull public String getPDHostURI()
null. Always has a trailing "/".@Nullable public org.apache.http.HttpHost getProxy()
null by default.public final void setProxy(@Nullable org.apache.http.HttpHost aProxy)
aProxy - May be null to indicate no proxy.@Nullable public org.apache.http.auth.Credentials getProxyCredentials()
null by default.public final void setProxyCredentials(@Nullable org.apache.http.auth.Credentials aProxyCredentials)
aProxyCredentials - May be null to indicate no proxy credentials necessary.public void setHttpClientManager(@Nonnull com.helger.httpclient.HttpClientManager aHttpClientMgr)
HttpClientManager in case the
default one using PDHttpClientFactory is not suitable (any more).aHttpClientMgr - The new HTTP client manager to use. May not be null.@Nonnull @OverrideOnDemand protected <T> T executeRequest(@Nonnull org.apache.http.client.methods.HttpRequestBase aRequest, @Nonnull org.apache.http.client.ResponseHandler<T> aHandler) throws IOException
T - Response typeaRequest - The request to be executed. Never null.aHandler - The response handler to be used. May not be null.null.IOException - On HTTP error@Nonnull public boolean isServiceGroupRegistered(@Nonnull com.helger.peppol.identifier.generic.participant.IParticipantIdentifier aParticipantID)
aParticipantID - Participant ID to query for existence. May not be null.true if the participant is in the index,
false otherwise.@Nonnull public com.helger.commons.state.ESuccess addServiceGroupToIndex(@Nonnull com.helger.peppol.identifier.generic.participant.IParticipantIdentifier aParticipantID)
Copyright © 2015–2018 Philip Helger. All rights reserved.