|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fosstrak.epcis.captureclient.CaptureClient
public class CaptureClient
This client provides access to an EPCIS Capture Interface. EPCIS events will be sent to the capture interface using HTTP POST requests. This client supports the following authentication options: HTTP BASIC AUTH and HTTPS with client certificate.
| Constructor Summary | |
|---|---|
CaptureClient()
Constructs a new CaptureClient using a default URL and no authentication. |
|
CaptureClient(String url)
Constructs a new CaptureClient using the given URL and no authentication. |
|
CaptureClient(String url,
Object[] authOptions)
Constructs a new CaptureClient using the given URL and authentication options. |
|
| Method Summary | |
|---|---|
int |
capture(Document epcisDoc)
Sends the given EPCIS Document to the EPCIS capture interface. |
int |
capture(InputStream xmlStream)
Sends the XML available from the given InputStream to the EPCIS capture interface. |
int |
capture(String eventXml)
Sends the given XML String to the EPCIS capture interface. |
void |
checkClientTrusted(X509Certificate[] chain,
String authType)
|
void |
checkServerTrusted(X509Certificate[] chain,
String authType)
|
int |
dbReset()
Invokes the non-standardized dbReset operation in the
Fosstrak EPCIS capture interface. |
X509Certificate[] |
getAcceptedIssuers()
|
Object[] |
getAuthOptions()
|
String |
getCaptureUrl()
|
boolean |
verify(String arg0,
SSLSession arg1)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CaptureClient()
public CaptureClient(String url)
url - The URL to the EPCIS Capture Interface.
public CaptureClient(String url,
Object[] authOptions)
authOptions[0] |
authOptions[1] |
authOptions[2] |
AuthenticationType.BASIC |
username | password |
AuthenticationType.HTTPS_WITH_CLIENT_CERT |
keystore file | password |
url - The URL to the EPCIS Capture Interface.authOptions - The authentication options as described above.| Method Detail |
|---|
public int capture(InputStream xmlStream)
throws CaptureClientException
xmlStream - An input stream providing an EPCISDocument with a list of
events.
CaptureClientException - If an error sending the document occurred.
public int capture(String eventXml)
throws CaptureClientException
eventXml - The XML String with the EPCISDocument and a list of events.
CaptureClientException - If an error sending the document occurred.
public int capture(Document epcisDoc)
throws CaptureClientException
epcisDoc - The EPCIS Document with a list of events.
IOException - If an error sending the document occurred.
javax.xml.bind.JAXBException - If an error serializing the given document into XML occurred.
CaptureClientException
public int dbReset()
throws CaptureClientException
dbReset operation in the
Fosstrak EPCIS capture interface. It deletes all event data in the EPCIS
database. This operation is only allowed if the corresponding property is
set in the repository's configuration.
CaptureClientException - If a communication error occurred.public String getCaptureUrl()
public Object[] getAuthOptions()
public void checkClientTrusted(X509Certificate[] chain,
String authType)
throws CertificateException
checkClientTrusted in interface X509TrustManagerCertificateException
public void checkServerTrusted(X509Certificate[] chain,
String authType)
throws CertificateException
checkServerTrusted in interface X509TrustManagerCertificateExceptionpublic X509Certificate[] getAcceptedIssuers()
getAcceptedIssuers in interface X509TrustManager
public boolean verify(String arg0,
SSLSession arg1)
verify in interface HostnameVerifier
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||