public final class ImportClient
extends java.lang.Object
ImportClient handles sending Requests to the SwKBT server and
interpreting the Responses.| Constructor and Description |
|---|
ImportClient(java.lang.String urlSpec)
ImportClient Constructor
|
ImportClient(java.lang.String host,
int port)
ImportClient Constructor
URL created will be in the form https://host:port/ibm/SwKBT/
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getBaseUrl()
Method to get the baseUrl.
|
void |
getCanonical(java.lang.String filename,
java.lang.String sourceDir)
Get the SwKBT export file.
|
java.lang.String |
getGUID()
Sends a file scheduling request to SwKBT to get the GUID.
|
java.lang.String |
getStatus(java.lang.String guid)
Sends a status request to SwKBT for the given request GUID.
|
java.lang.String |
getURLEncodedString(java.util.Map requestProps)
Returns a URL-encoded string of the given request properties
|
void |
logProperties(java.util.Properties props) |
void |
pollStatus(java.lang.String guid,
int seconds,
int timeout)
Periodically sends requests for status from the SWKBT server.
|
java.io.InputStream |
send(java.lang.String url)
Send the requested data to the SwKBT server
|
java.io.InputStream |
send(java.lang.String url2,
java.lang.String url1)
Send the requested data to the SwKBT server
|
public ImportClient(java.lang.String urlSpec)
throws java.lang.IllegalArgumentException
urlSpec - URL identifier (ie., protocol://host:port/uri throws
IllegalArgumentException if urlSpec is null
throws MalformedURLException if a URL cannot be
created from input paramtersjava.lang.IllegalArgumentExceptionpublic ImportClient(java.lang.String host,
int port)
throws java.lang.IllegalArgumentException
host - hostname of the server to connect toport - port numberjava.lang.IllegalArgumentExceptionpublic java.lang.String getURLEncodedString(java.util.Map requestProps)
throws MXSystemException
requestProps - the Map containing the request propertiesMXSystemExceptionpublic java.lang.String getGUID()
throws MXSystemException
MXSystemExceptionpublic java.lang.String getStatus(java.lang.String guid)
throws MXSystemException
guid - Request token gotten from scheduleCanonicaljava.lang.Exceptionjava.lang.IllegalArgumentException - if fileName is null or doesn't point to a
fileMXSystemException - if there were errors during import processingpublic void logProperties(java.util.Properties props)
public void pollStatus(java.lang.String guid,
int seconds,
int timeout)
throws MXSystemException
guid - Guid returned from getCanonicalseconds - Seconds between retriestimeout - Total number of retriesMXSystemException - for errors during pollingpublic void getCanonical(java.lang.String filename,
java.lang.String sourceDir)
throws MXSystemException
guid - Request token from scheduleCanonicalfilename - Filename to use. Zip file will be saved with this name & .zipsourceDir - Directory to save the file inMXSystemExceptionpublic java.io.InputStream send(java.lang.String url)
throws MXSystemException
uri - the URI to post datarequestProps - the Map containing the request propertiesheaders - the HTTP headersMXSystemExceptionpublic java.io.InputStream send(java.lang.String url2,
java.lang.String url1)
throws MXSystemException
url2 - the URI to post data for canonical 2.0url1 - the URI to post data for canonical 1.0requestProps - the Map containing the request propertiesheaders - the HTTP headersMXSystemExceptionpublic java.lang.String getBaseUrl()