|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.netbilling.net.NetworkClient
com.netbilling.direct.IdGenerator
public class IdGenerator
This class allows you to obtain unique ID numbers from the servers. It's recomended that you obtain a transaction ID prior to submitting the transaction for processing. This will allow you to later determine what happened to the transaction, even if you encounter a network error while waiting for the transaction response.
| Nested Class Summary | |
|---|---|
static class |
IdGenerator.IdGeneratorException
Failed to obtain ID number, the exception object will contain more information. |
| Field Summary |
|---|
| Fields inherited from class com.netbilling.net.NetworkClient |
|---|
PROTOCOL_HTTP, PROTOCOL_HTTPS |
| Constructor Summary | |
|---|---|
IdGenerator()
Create a new instance object of this class. |
|
| Method Summary | |
|---|---|
java.lang.String |
obtainNewId()
Returns 1 new unique ID. |
protected int |
obtainNewIds(java.lang.String[] out,
int num)
Obtain one or more unique ID number from the server. |
void |
setPerformanceMode(boolean yes)
When using performance mode, a separate thread will be spawned. |
void |
setTimeout_ms(int milli_seconds)
Set the network timeout for calls to obtainNewIds() in milli seconds. |
| 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 |
| Constructor Detail |
|---|
public IdGenerator()
NetworkClient.setProtocol(java.lang.String),
NetworkClient.setServer(java.lang.String),
setPerformanceMode(boolean)| Method Detail |
|---|
public void setTimeout_ms(int milli_seconds)
public void setPerformanceMode(boolean yes)
NOTE: When using performance mode, you should only have 1 instance of this class, or you will end up with one background thread for each object instance.
obtainNewId()
protected int obtainNewIds(java.lang.String[] out,
int num)
throws IdGenerator.IdGeneratorException
IdGenerator.IdGeneratorException
public java.lang.String obtainNewId()
throws IdGenerator.IdGeneratorException
IdGenerator.IdGeneratorException
|
Version 3.1.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||