|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Batch
The Batch object gives access to all the Provisioning API commands in BPR. It may be posted only once; attempting to add calls or re-post the batch after it has already been posted will result in a runtime exception.
// Obtain an authenticated PACE connection to the RDU
PACEConnection connection =
PACEConnectionFactory.getInstance(
"localhost", 49187, "admin", "changeme");
// Get a new batch from the connection
Batch batch = connection.newBatch();
// Make a call to add a DOCSIS Modem to the database
// Since the Batch object implements the IPDevice interface, the "add"
// method exists on the batch object
List devIds = new ArrayList();
devIds.add(new MACAddress("1,6,00:00:00:00:00:99"));
devIds.add(new DUID("00:03:00:01:00:02:FC:A5:DC:1C"));
String dhcpCriteria = "unprovisioned-docsis";
batch.add(DeviceType.DOCSIS, devIds,
"testHost", "testIsp.com", "testOwnerID", "testCoS", dhcpCriteria, null);
// Add more API calls to the batch as desired on IPDevice or other API
// implemented by the Batch object
// post the batch to get the results
BatchStatus status = batch.post();
// Process the results
if (status.isError())
{
....
}
As you can see, this newer method does not require object to be cast to
the various interfaces. It is recommended that new code be written using
this method whenever possible. Please note that the old and new methods
can be used interchangably, even within the same batch, without any
side effects.
BatchStatus,
PACEConnection,
PACEConnectionFactory| Method Summary | |
|---|---|
void |
addAPICall(com.cisco.provisioning.cpe.internal.APICall call)
Adds an APICall object to the batch's list of method calls. |
boolean |
createdByClient()
Indicates whether the Batch was created by the client API rather than a BPR server. |
void |
ensureConsistency(List oidRevNumbers)
Sends a list of OID revision numbers to validate before processing the batch. |
void |
forceBatchReliable()
Force the batch to be reliable. |
ActivationMode |
getActivationMode()
Gets the ActivationMode of this batch |
com.cisco.provisioning.cpe.internal.APICall |
getAPICall(int index)
Gets an APICall object from the batch's list of method calls. |
int |
getAPICallCount()
Gets the count of APICall objects stored in the batch. |
String |
getBatchID()
Gets the batch ID associated with this batch. |
int |
getBatchPriority()
Returns an int value specifying the priority of this batch. |
ConfirmationMode |
getConfirmationMode()
Gets the ConfirmationMode of this batch. |
List |
getOIDRevNumbersToValidate()
Returns the list of OID revision numbers that are to be validated by the RDU before processing the batch. |
PublishingMode |
getPublishingMode()
Gets the PublishingMode of this batch. |
String |
getUsername()
Returns the username used in making PACEConnection connection. |
boolean |
isBatchReliable()
Indicates whether the Batch will be completed even if the RDU goes down while the batch is processing or waiting to be processed. |
BatchStatus |
post()
Sends this batch to the RDU for execution. |
BatchStatus |
post(long timeout)
Sends this batch to the RDU for execution. |
void |
postNoStatus()
Sends this batch to the RDU for execution. |
boolean |
wasPosted()
Indicates whether this batch has been posted yet. |
| Methods inherited from interface com.cisco.provisioning.cpe.api.IPDevice |
|---|
add, addDeviceType, addNode, addNodeType, changeClassOfService, changeDefaults, changeDeviceID, changeDHCPCriteria, changeDomainName, changeHostName, changeNodeName, changeNodeProperties, changeNodeTypeProperties, changeOwnerID, changeProperties, delete, deleteDeviceType, deleteNode, deleteNodeType, getAllBehindDevice, getAllDeviceTypes, getAllForIPAddress, getAllForIPAddress, getAllForOwnerID, getAllNodeTypes, getDefaults, getDetails, getNodeProperties, getNodeTypeProperties, performOperation, regenConfigs, relateToIPDevice, relateToNode, searchDevice, searchNode, unregister, unrelateFromIPDevice, unrelateFromNode |
| Method Detail |
|---|
boolean createdByClient()
boolean isBatchReliable()
ActivationMode.AUTOMATIC or the
PublishingMode is
PublishingMode.PUBLISHING_NO_CONFIRMATION or
PublishingMode.PUBLISHING_CONFIRMATION or if
the Batch.forceReliableBatch method
was called on this batch.
Note: A reliable batch incurs extra processing overhead on the RDU. It forces at least one extra disk write per batch and therefore takes longer to process.
void forceBatchReliable()
Note: A reliable batch incurs extra processing overhead on the RDU. It forces at least one extra disk write per batch and therefore takes longer to process.
String getBatchID()
ActivationMode getActivationMode()
ActivationMode of this batch
ConfirmationMode getConfirmationMode()
ConfirmationMode of this batch.
PublishingMode getPublishingMode()
PublishingMode of this batch.
boolean wasPosted()
void ensureConsistency(List oidRevNumbers)
IPDevice.getDetails(DeviceID, List)
method using the key
GenericObjectKeys.OID_REVISION_NUMBER.
oidRevNumbers - List of OID rev number String object to validate
in the RDU before processing the batch.String getUsername()
List getOIDRevNumbersToValidate()
Batch.ensureConsistency method.
void addAPICall(com.cisco.provisioning.cpe.internal.APICall call)
Note: This method is for BPR-internal use only -- it should not be called by BPR API clients.
call - the APICall object being added to the batch.int getAPICallCount()
Note: This method is for BPR-internal use only -- it should not be called by BPR API clients.
com.cisco.provisioning.cpe.internal.APICall getAPICall(int index)
Note: This method is for BPR-internal use only -- it should not be called by BPR API clients.
index - the index of the APICall object being retrieved from
the batch.
BatchStatus post()
throws ProvisioningException
PACEConnection.postBatch(Batch).
If this batch is 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.
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 post(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.
This method is equivalent to calling
PACEConnection.postBatch(Batch, long).
If this batch 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.
timeout - 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 this
batch. That type of error is
reflected in the
BatchStatus
object returned.
BatchListener.BATCH_COMPLETE
void postNoStatus()
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.
ProvisioningException - If there is an error communicating with
the RDU. This exception is NOT thrown
if there is an error while processing this
batch. That type of error is
reflected in the
BatchStatus
object.
BatchListener.BATCH_COMPLETE
int getBatchPriority()
ActivationMode specified on the batch. This
value is used by the RDU to prioritize and schedule batch execution
to optimize system throughput.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||