com.netbilling.direct
Class V3BatchClient

java.lang.Object
  extended by com.netbilling.net.NetworkClient
      extended by com.netbilling.direct.V3BatchClient

public class V3BatchClient
extends NetworkClient


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

SPECIAL_DYNIP_SEC_CODE

public static final java.lang.String SPECIAL_DYNIP_SEC_CODE
See Also:
Constant Field Values
Constructor Detail

V3BatchClient

public V3BatchClient(java.lang.String server,
                     boolean https,
                     boolean verbosemode)
Create a V3BatchClient.

Parameters:
verbosemode - true for informational outputs
Method Detail

setSpecialParameter

public void setSpecialParameter(java.lang.String name,
                                java.lang.String value)

doStart

public void doStart(java.lang.String accountid,
                    java.lang.String batchid)
             throws PreConnectionException,
                    PostConnectionException,
                    ServerException
Start an already uploaded batch on the server. You must supply the account ID, and the batch ID you received from a previous upload command.

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.

Parameters:
accountid - the account id to use
batchid - the batch id received by a previous upload
Throws:
PreConnectionException
PostConnectionException
ServerException
See Also:
doUpload(java.lang.String, java.io.InputStream, java.lang.StringBuffer), getStatus(java.util.Hashtable, java.lang.String, java.lang.String)

doStop

public void doStop(java.lang.String accountid,
                   java.lang.String batchid)
            throws PreConnectionException,
                   PostConnectionException,
                   ServerException
Stop an already uploaded batch on the server. You must supply the account ID, and the batch ID you received from a previous upload command.

Exceptions are thrown if the command failed.

Parameters:
accountid - the account id to use
batchid - the batch id received by a previous upload
Throws:
PreConnectionException
PostConnectionException
ServerException
See Also:
doUpload(java.lang.String, java.io.InputStream, java.lang.StringBuffer)

doValidate

public java.io.InputStream doValidate(java.lang.String accountid,
                                      java.io.InputStream csvstream)
                               throws PreConnectionException,
                                      PostConnectionException,
                                      ServerException
Validate a batch file given by the stream with the server, using the specified account ID. The returned InputStream contains the received rejects that might result directly from the validate command.

Parameters:
accountid - the account id to use
csvstream - an InputStream object containing the CSV-formatted batch file
Throws:
PreConnectionException
PostConnectionException
ServerException

doUpload

public java.io.InputStream doUpload(java.lang.String accountid,
                                    java.io.InputStream csvstream,
                                    java.lang.StringBuffer batchid)
                             throws PreConnectionException,
                                    PostConnectionException,
                                    ServerException
Upload a batch file given by the stream csvstream to the server, using the specificed account ID.

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.

Parameters:
accountid - the account id to use
csvstream - an InputStream object containing the CSV-formatted batch file
batchid - StringBuffer which will receive a new batch id from the server
Throws:
PreConnectionException
PostConnectionException
ServerException
See Also:
doStart(java.lang.String, java.lang.String), getStatus(java.util.Hashtable, java.lang.String, java.lang.String)

doDownload

public void doDownload(java.lang.String accountid,
                       java.lang.String batchid,
                       java.io.OutputStream csvstream)
                throws PreConnectionException,
                       PostConnectionException,
                       ServerException,
                       java.io.IOException
Download the results of a completed batch from the server, using the specificed account ID and batch ID. The results will be saved to the output stream csvstream.

An exception is thrown if a network error, stream error or server error occured.

Parameters:
accountid - the account id to use
batchid - batch id of the completed batch
csvstream - OutputStream which will receive the results of the processing
Throws:
PreConnectionException
PostConnectionException
ServerException
java.io.IOException

getStatus

public void getStatus(java.util.Hashtable status,
                      java.lang.String accountid,
                      java.lang.String batchid)
               throws PreConnectionException,
                      PostConnectionException,
                      ServerException
Poll the server for the status of a previously uploaded batch ID using the specified account ID.

The results are returned in the supplied hashtable, with the following keys:

Parameters:
status - Hashtable which will receive the results
accountid - the account id to use
batchid - batch id of the batch to check the status of
Throws:
PreConnectionException
PostConnectionException
ServerException
See Also:
doUpload(java.lang.String, java.io.InputStream, java.lang.StringBuffer)

main

public static void main(java.lang.String[] argv)
                 throws java.lang.Exception
Throws:
java.lang.Exception

Version 3.1.1

This is propriatary and confidential unpublished information. Copyright(c) 1999-2019, All rights reserved.