|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface PACEConnection
This interface defines the methods to use by the clients to create and manage communication with the PACE Server inclusing creating, posting, and joining batches, as well as registering and distributing events to clients.
...
// Create a new PACE connection to the RDU
PACEConnection connection =
PACEConnectionFactory.newInstance(
"localhost", 49187, "admin", "changeme");
// Get a new Batch from the connection object
Batch batch = connection.newBatch();
// Add a new DOCSIS device
List devIds = new ArrayList();
devIds.add(DeviceID.getInstance("1,6,00:00:00:00:00:99",
KeyType.MAC_ADDRESS));
batch.add(DeviceType.DOCSIS, devIds,
"testHost", "testIsp.com", "testOwnerID", "testCoS",
"testDhcpCriteria", null);
// Submit the batch asynchronously to the RDU for processing
batch.postNoStatus();
// Join the batch to get the results.
// NOTE - in real code this would probably be joined by
// NOTE - another thread. Real code to do this would
// NOTE - most likely use batch.post() and not use join()
BatchStatus status = batch.join(batch.getBatchID());
if ( status.isError() )
{
fail(status);
}
else
{
pass(status);
}
// Release the PACEConnection object when finished using it
connection.releaseConnection();
...
ProvAPIEventManager| Method Summary | |
|---|---|
String |
getHost()
Returns the hostName of the RDU to which this PACEConnection connects. |
int |
getPort()
Returns the RDU port number to which this PACEConnection connects. |
String |
getUsername()
Returns the username used in making PACEConnection connect. |
boolean |
isAlive()
Determines whether the connection the RDU has been opened. |
BatchStatus |
joinBatch(String batchID)
Retrieves the results of a previously posted batch. |
BatchStatus |
joinBatch(String batchID,
long timeout)
Retrieves the results of a previously posted batch. |
Batch |
newBatch()
Creates a new batch with a globally-unique batch ID. |
Batch |
newBatch(ActivationMode activation)
Gets a new batch with a globally-unique batch ID and the specified ActivationMode
The ConfirmationMode defaults to
ConfirmationMode.NO_CONFIRMATION
The PublishingMode defaults to
PublishingMode.NO_PUBLISHING
|
Batch |
newBatch(ActivationMode activation,
ConfirmationMode confirmation)
Gets a new batch with a globally-unique batch ID and the specified ActivationMode and
ConfirmationMode
The PublishingMode defaults to
PublishingMode.NO_PUBLISHING
|
Batch |
newBatch(ActivationMode activation,
ConfirmationMode confirmation,
PublishingMode publishing)
Gets a new batch with a globally-unique batch ID and the specified ActivationMode,
ConfirmationMode, and
PublishingMode
|
Batch |
newBatch(ActivationMode activation,
PublishingMode publishing)
Gets a new batch with a globally-unique batch ID with the specified ActivationMode and
PublishingMode
The ConfirmationMode defaults to
ConfirmationMode.NO_CONFIRMATION
|
Batch |
newBatch(PublishingMode publishing)
Gets a new batch with a globally-unique batch ID with the specified PublishingMode
The ActivationMode defaults to
ActivationMode.NO_ACTIVATION
The ConfirmationMode defaults to
ConfirmationMode.NO_CONFIRMATION
|
Batch |
newBatch(String batchID)
Gets a new batch, using a user-supplied batch ID, which must be unique (or the batch will fail to execute when it is posted). |
Batch |
newBatch(String batchID,
ActivationMode activation)
Gets a new batch, using a user-supplied batch ID, which must be unique (or the batch will fail to execute when it is posted) and the specified ActivationMode
The ConfirmationMode defaults to
ConfirmationMode.NO_CONFIRMATION
The PublishingMode defaults to
PublishingMode.NO_PUBLISHING
|
Batch |
newBatch(String batchID,
ActivationMode activation,
ConfirmationMode confirmation)
Gets a new batch, using a user-supplied batch ID, which must be unique (or the batch will fail to execute when it is posted) and the specified ActivationMode and
ConfirmationMode
The PublishingMode defaults to
PublishingMode.NO_PUBLISHING
|
Batch |
newBatch(String batchID,
ActivationMode activation,
ConfirmationMode confirmation,
PublishingMode publishing)
Gets a new batch, using a user-supplied batch ID, which must be unique (or the batch will fail to execute when it is posted) and the specified ActivationMode,
ConfirmationMode, and
PublishingMode
|
Batch |
newBatch(String batchID,
ActivationMode activation,
PublishingMode publishing)
Gets a new batch, using a user-supplied batch ID, which must be unique (or the batch will fail to execute when it is posted) and the specified ActivationMode and
PublishingMode
The ConfirmationMode defaults to
ConfirmationMode.NO_CONFIRMATION
|
Batch |
newBatch(String batchID,
PublishingMode publishing)
Gets a new batch, using a user-supplied batch ID, which must be unique (or the batch will fail to execute when it is posted) and the specified PublishingMode
The ActivationMode defaults to
ActivationMode.NO_ACTIVATION
The ConfirmationMode defaults to
ConfirmationMode.NO_CONFIRMATION
|
boolean |
openConnection()
Open a connection to the RDU. |
BatchStatus |
postBatch(Batch batch)
Sends a batch to the RDU for execution. |
BatchStatus |
postBatch(Batch batch,
long timeout)
Sends a batch to the RDU for execution. |
void |
postBatchNoStatus(Batch batch)
Sends a batch to the RDU for execution. |
void |
releaseConnection()
Release this RDU connection. |
| Method Detail |
|---|
boolean openConnection()
PACEConnectionException - if this method is called after
PACEConnection.releaseConnection has been called.
AuthenticationException - if the authentication parameters
specified when creating the
connection are invalid.void releaseConnection()
String getHost()
int getPort()
String getUsername()
boolean isAlive()
Note: The value is an instantaneous value of the PACEConnection state when the isAlive() method is called.
Batch newBatch()
The ActivationMode defaults to
ActivationMode.NO_ACTIVATION
The ConfirmationMode defaults to
ConfirmationMode.NO_CONFIRMATION
The PublishingMode defaults to
PublishingMode.NO_PUBLISHING
Batch newBatch(String batchID)
The ActivationMode defaults to
ActivationMode.NO_ACTIVATION
The ConfirmationMode defaults to
ConfirmationMode.NO_CONFIRMATION
The PublishingMode defaults to
PublishingMode.NO_PUBLISHING
batchID - user-supplied batch ID
Batch newBatch(ActivationMode activation)
ActivationMode
The ConfirmationMode defaults to
ConfirmationMode.NO_CONFIRMATION
The PublishingMode defaults to
PublishingMode.NO_PUBLISHING
activation - the ActivationMode for this batch.
Batch newBatch(String batchID,
ActivationMode activation)
ActivationMode
The ConfirmationMode defaults to
ConfirmationMode.NO_CONFIRMATION
The PublishingMode defaults to
PublishingMode.NO_PUBLISHING
batchID - user-supplied batch IDactivation - the ActivationMode for this batch.
Batch newBatch(ActivationMode activation,
ConfirmationMode confirmation)
ActivationMode and
ConfirmationMode
The PublishingMode defaults to
PublishingMode.NO_PUBLISHING
activation - the ActivationMode for this batch.confirmation - the ConfirmationMode for this batch.
Batch newBatch(String batchID,
ActivationMode activation,
ConfirmationMode confirmation)
ActivationMode and
ConfirmationMode
The PublishingMode defaults to
PublishingMode.NO_PUBLISHING
batchID - user-supplied batch IDactivation - the ActivationMode for this batch.confirmation - the ConfirmationMode for this batch.
Batch newBatch(PublishingMode publishing)
PublishingMode
The ActivationMode defaults to
ActivationMode.NO_ACTIVATION
The ConfirmationMode defaults to
ConfirmationMode.NO_CONFIRMATION
publishing - the PublishingMode for this batch.
Batch newBatch(String batchID,
PublishingMode publishing)
PublishingMode
The ActivationMode defaults to
ActivationMode.NO_ACTIVATION
The ConfirmationMode defaults to
ConfirmationMode.NO_CONFIRMATION
batchID - user-supplied batch IDpublishing - the PublishingMode for this batch.
Batch newBatch(ActivationMode activation,
PublishingMode publishing)
ActivationMode and
PublishingMode
The ConfirmationMode defaults to
ConfirmationMode.NO_CONFIRMATION
activation - the ActivationMode for this batch.publishing - the PublishingMode for this batch.
Batch newBatch(String batchID,
ActivationMode activation,
PublishingMode publishing)
ActivationMode and
PublishingMode
The ConfirmationMode defaults to
ConfirmationMode.NO_CONFIRMATION
batchID - user-supplied batch IDactivation - the ActivationMode for this batch.publishing - the PublishingMode for this batch.
Batch newBatch(ActivationMode activation,
ConfirmationMode confirmation,
PublishingMode publishing)
ActivationMode,
ConfirmationMode, and
PublishingMode
activation - the ActivationMode for this batch.confirmation - the ConfirmationMode for this batch.publishing - the PublishingMode for this batch.
Batch newBatch(String batchID,
ActivationMode activation,
ConfirmationMode confirmation,
PublishingMode publishing)
ActivationMode,
ConfirmationMode, and
PublishingMode
batchID - user-supplied batch IDactivation - the ActivationMode for this batch.confirmation - the ConfirmationMode for this batch.publishing - the PublishingMode for this batch.
BatchStatus postBatch(Batch batch)
throws ProvisioningException
If the batch submitted is was marked as a
reliable batch and the connection to
the RDU is interrupted, the connection will reestablish and obtain the
results for the batch. Otherwise, an unrecognized batch ID error
will be returned in the BatchStatus error message.
Note: There is a limitation as to the number of batch results
the RDU will store. In order to prevent the RDU from consuming all
available resources, the RDU will store the most recent 1000 batch
results that were marked to be reliable and have not been retrieved.
If the batch results are dropped and the results are later asked for,
an unrecognized batch ID error will be returned in the
BatchStatus error message.
batch - the Batch to send to the RDU for processing
ProvisioningException - If there is an error communicating with
the RDU. This exception is NOT thrown
if there is an error while processing the
specified batch. That type of error is
reflected in the
BatchStatus
object returned.
BatchListener.BATCH_COMPLETE
BatchStatus postBatch(Batch batch,
long timeout)
throws ProvisioningException
BatchStatusCode.BATCH_POST_TIMEOUT.
Even though the batch post timed out, the RDU is still processing the
batch and will fire a
BatchListener.BATCH_COMPLETE event
when it finishes processing the batch. After the timeout, the results
may also be retrieved using the
PACEConnection.joinBatch(String) or
PACEConnection.joinBatch(String, long) method.
If the batch submitted is was marked as a
reliable batch and the connection to
the RDU is interrupted before the timeout is reached, the connection
will attempt to reestablish the connection and obtain the results for
the batch. Otherwise, an unrecognized batch ID error will be returned in
the BatchStatus error message if the connection is
interrupted.
If the conneciton to the RDU is interrupted and cannot be reestablished
before the timeout parameter expires, then a BatchStatus object will be
returned with the status code set to
BatchStatusCode.BATCH_POST_TIMEOUT
Note: There is a limitation as to the number of batch results
the RDU will store. In order to prevent the RDU from consuming all
available resources, the RDU will store the most recent 1000 batch
results that were marked to be reliable and have not been retrieved.
If the batch results are dropped and the results are later asked for,
an unrecognized batch ID error will be returned in the
BatchStatus error message.
batch - the Batch to send to the RDU for processingtimeout - the maximum time to wait for a reply in milliseconds.
ProvisioningException - If there is an error communicating with
the RDU. This exception is NOT thrown
if there is an error while processing the
specified batch. That type of error is
reflected in the
BatchStatus
object returned.
BatchListener.BATCH_COMPLETE
void postBatchNoStatus(Batch batch)
throws ProvisioningException
BatchListener.BATCH_COMPLETE event
or by calling the
PACEConnection.joinBatch(String) or
PACEConnection.joinBatch(String, long)
method with the batch ID of the batch submitted.
batch - the Batch to send to the RDU for processing
ProvisioningException - If there is an error communicating with
the RDU. This exception is NOT thrown
if there is an error while processing the
specified batch. That type of error is
reflected in the
BatchStatus
object.
BatchListener.BATCH_COMPLETE
BatchStatus joinBatch(String batchID)
throws ProvisioningException
Note: There is a limitation as to the number of batch results the RDU will store. In order to prevent the RDU from consuming all available resources, the RDU will store the most recent 1000 batch results that were marked to be reliable and have not been retrieved. If the batch results are no longer stored by the RDU, then an a ProvisioningException is thrown with a message describing that the RDU does not know about the specified batch ID.
batchID - ID of the Batch to retrieve the results for
ProvisioningException - If there was a problem communicating with
the RDU or if the specified batch ID is
unknown to the RDU. This could occur if
the posted batch was not specified to be
reliable and the RDU was restarted after
the batch was posted but before the
results were retrieved.
BatchListener.BATCH_COMPLETE
BatchStatus joinBatch(String batchID,
long timeout)
throws ProvisioningException
BatchStatusCode.BATCH_POST_TIMEOUT.
Even though the join timed out, the RDU is still processing the
batch and will still fire a
BatchListener.BATCH_COMPLETE event
when it finishes processing the batch.
Note: There is a limitation as to the number of batch results the RDU will store. In order to prevent the RDU from consuming all available resources, the RDU will store the most recent 1000 batch results that were marked to be reliable and have not been retrieved. If the batch results are no longer stored by the RDU, then an a ProvisioningException is thrown with a message describing that the RDU does not know about the specified batch ID.
batchID - ID of the Batch to retrieve the results fortimeout - the time to wait for a reply in milliseconds
ProvisioningException - If there was a problem communicating with
the RDU or if the specified batch ID is
unknown to the RDU. This could occur if
the posted batch was not specified to be
reliable and the RDU was restarted after
the batch was posted but before the
results were retrieved.
BatchListener.BATCH_COMPLETE
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||