|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.netbilling.net.NetworkClient com.netbilling.direct.V3BatchClient
public class V3BatchClient
Field Summary | |
---|---|
static java.lang.String |
SPECIAL_DYNIP_SEC_CODE
|
Fields inherited from class com.netbilling.net.NetworkClient |
---|
PROTOCOL_HTTP, PROTOCOL_HTTPS |
Constructor Summary | |
---|---|
V3BatchClient(java.lang.String server,
boolean https,
boolean verbosemode)
Create a V3BatchClient. |
Method Summary | |
---|---|
void |
doDownload(java.lang.String accountid,
java.lang.String batchid,
java.io.OutputStream csvstream)
Download the results of a completed batch from the server, using the specificed account ID and batch ID. |
void |
doStart(java.lang.String accountid,
java.lang.String batchid)
Start an already uploaded batch on the server. |
void |
doStop(java.lang.String accountid,
java.lang.String batchid)
Stop an already uploaded batch on the server. |
java.io.InputStream |
doUpload(java.lang.String accountid,
java.io.InputStream csvstream,
java.lang.StringBuffer batchid)
Upload a batch file given by the stream csvstream to the server, using the specificed account ID. |
java.io.InputStream |
doValidate(java.lang.String accountid,
java.io.InputStream csvstream)
Validate a batch file given by the stream with the server, using the specified account ID. |
void |
getStatus(java.util.Hashtable status,
java.lang.String accountid,
java.lang.String batchid)
Poll the server for the status of a previously uploaded batch ID using the specified account ID. |
static void |
main(java.lang.String[] argv)
|
void |
setSpecialParameter(java.lang.String name,
java.lang.String value)
|
Methods inherited from class com.netbilling.net.NetworkClient |
---|
getPort, getProtocol, getServer, getURL, setPath, setPort, setProtocol, setServer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SPECIAL_DYNIP_SEC_CODE
Constructor Detail |
---|
public V3BatchClient(java.lang.String server, boolean https, boolean verbosemode)
verbosemode
- true for informational outputsMethod Detail |
---|
public void setSpecialParameter(java.lang.String name, java.lang.String value)
public void doStart(java.lang.String accountid, java.lang.String batchid) throws PreConnectionException, PostConnectionException, ServerException
The function will throw an exception if the command failed. You must call getStatus later to poll the server for completion of the actual batch.
accountid
- the account id to usebatchid
- the batch id received by a previous upload
PreConnectionException
PostConnectionException
ServerException
doUpload(java.lang.String, java.io.InputStream, java.lang.StringBuffer)
,
getStatus(java.util.Hashtable, java.lang.String, java.lang.String)
public void doStop(java.lang.String accountid, java.lang.String batchid) throws PreConnectionException, PostConnectionException, ServerException
Exceptions are thrown if the command failed.
accountid
- the account id to usebatchid
- the batch id received by a previous upload
PreConnectionException
PostConnectionException
ServerException
doUpload(java.lang.String, java.io.InputStream, java.lang.StringBuffer)
public java.io.InputStream doValidate(java.lang.String accountid, java.io.InputStream csvstream) throws PreConnectionException, PostConnectionException, ServerException
accountid
- the account id to usecsvstream
- an InputStream object containing the CSV-formatted batch file
PreConnectionException
PostConnectionException
ServerException
public java.io.InputStream doUpload(java.lang.String accountid, java.io.InputStream csvstream, java.lang.StringBuffer batchid) throws PreConnectionException, PostConnectionException, ServerException
The function returns a batch ID that should be used by subsequent commands for controlling and checking on the particular uploaded batch.
The returned InputStream contains the received rejects that might result directly from the upload command.
If the connection fails, Pre or PostConnectionException is thrown. If the server returns an error, ServerException is thrown.
accountid
- the account id to usecsvstream
- an InputStream object containing the CSV-formatted batch filebatchid
- StringBuffer which will receive a new batch id from the server
PreConnectionException
PostConnectionException
ServerException
doStart(java.lang.String, java.lang.String)
,
getStatus(java.util.Hashtable, java.lang.String, java.lang.String)
public void doDownload(java.lang.String accountid, java.lang.String batchid, java.io.OutputStream csvstream) throws PreConnectionException, PostConnectionException, ServerException, java.io.IOException
An exception is thrown if a network error, stream error or server error occured.
accountid
- the account id to usebatchid
- batch id of the completed batchcsvstream
- OutputStream which will receive the results of the processing
PreConnectionException
PostConnectionException
ServerException
java.io.IOException
public void getStatus(java.util.Hashtable status, java.lang.String accountid, java.lang.String batchid) throws PreConnectionException, PostConnectionException, ServerException
The results are returned in the supplied hashtable, with the following keys:
status
- Hashtable which will receive the resultsaccountid
- the account id to usebatchid
- batch id of the batch to check the status of
PreConnectionException
PostConnectionException
ServerException
doUpload(java.lang.String, java.io.InputStream, java.lang.StringBuffer)
public static void main(java.lang.String[] argv) throws java.lang.Exception
java.lang.Exception
|
Version 3.1.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |