com.cisco.provisioning.cpe.api
Class DeviceOperation

java.lang.Object
  extended by com.cisco.provisioning.cpe.api.DeviceOperation
All Implemented Interfaces:
Serializable

public final class DeviceOperation
extends Object
implements Serializable

The DeviceOperation class is used to represent various operations to perform on a device, including generation the device's configuration, resetting the device, and enabling SNMP v3 access to the device.

See Also:
Serialized Form

Field Summary
static DeviceOperation CHANGE_PROVISIONING_GROUP
          Reserved for future use.
static DeviceOperation ENABLE_SNMPV3_ACCESS
          Specifies a device operation to enable SNMP v3 access to a remote device.
static DeviceOperation GENERATE_CONFIGURATION
          Specifies a device operation to generate configuration for a device.
static DeviceOperation INCREMENTAL_UPDATE
          An operation which allows for the setting of MIB Variable(s) on a remote device.
static DeviceOperation RESET
          Specifies a device operation to reset a device.
static long serialVersionUID
          Description of the Field
 
Method Summary
 boolean equals(Object obj)
          Determines if this device operation object is equal to the specified object.
 int hashCode()
          The hash code of this object.
 String toString()
          Returns a String description of this device operation
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Description of the Field

See Also:
Constant Field Values

GENERATE_CONFIGURATION

public static final DeviceOperation GENERATE_CONFIGURATION
Specifies a device operation to generate configuration for a device.

Note : The constant should be used with ActivationMode.NO_ACTIVATION, otherwise IPDevice.performOperation(DeviceOperation, DeviceID, Map) will return the error CommandStatusCode.CMD_ERROR_VALIDATE.

Sample Usage:
       ...
      Batch batch = conn.newBatch(ActivationMode.NO_ACTIVATION);
      batch.performOperation(DeviceOperation.GENERATE_CONFIGURATION,
                             new MACAddress("1,6,00:00:00:00:00:99"),
                               null);
      BatchStatus status = batch.post();
      if ( status.isError() )
      {
          fail(status);
      }
      else
      {
          pass(status);
      }
       ...
 


RESET

public static final DeviceOperation RESET
Specifies a device operation to reset a device.

Note : The constant should be used with ActivationMode.AUTOMATIC, otherwise IPDevice.performOperation will return the error CommandStatusCode.CMD_ERROR_VALIDATE.

This command may return BatchStatusCode.BATCH_WARNING or BatchStatusCode#BATCH_FAILED_DISRUPTION depending on the ConfirmationMode and the status of the reset operation.

Sample Usage:
       ...
      Batch batch = conn.newBatch(ActivationMode.AUTOMATIC);
      batch.performOperation(DeviceOperation.RESET,
                             new MACAddress("1,6,00:00:00:00:00:99"),
                             null);
      BatchStatus status = batch.post();
      if ( status.isError() )
      {
          fail(status);
      }
      else
      {
          pass(status);
      }
       ...
 


ENABLE_SNMPV3_ACCESS

public static final DeviceOperation ENABLE_SNMPV3_ACCESS
Specifies a device operation to enable SNMP v3 access to a remote device. Currently, only PacketCable MTA's are supported.

The auth and priv passwords for the user (USM table entry) created by this API are specified by setting SNMPPropertyKeys.CLONING_AUTH_PASSWORD and SNMPPropertyKeys.CLONING_PRIV_PASSWORD properties respectively in the rdu.properties configuration file.

Sample Usage:
       ...
      // The goal here is to create a new user on the MTA indicated
      // by the MAC address.  The other param needed here is the new
      // user name, which is passed in the Map.

      // Create a batch
      Batch batch = conn.newBatch();
      // Create a map which will contain one element - the
      // name of the new user to be created on the MTA
      HashMap map = new HashMap();
      map.put( SNMPPropertyKeys.CLONING_USERNAME, "newUser" );
      // The first param is the actual device operation to perform.
      batch.performOperation(DeviceOperation.ENABLE_SNMPV3_ACCESS,
                             new MACAddress("1,6,00:00:00:00:00:99"), map);
      BatchStatus status = batch.post();
      if ( status.isError() )
      {
          fail(status);
      }
      else
      {
          pass(status);
      }
      ...
 

See Also:
SNMPPropertyKeys

INCREMENTAL_UPDATE

public static final DeviceOperation INCREMENTAL_UPDATE
An operation which allows for the setting of MIB Variable(s) on a remote device. Currently, only PacketCable MTA's are supported.

Note : Changes made to writable MIB variables using this API will not be permanent and will not be updated in the system configuration for the device.

Sample Usage:
     ...
     // The goal here is to set a MIB variable on the MTA.  In this
     // example we will be setting the pktcMtaDevEnabled variable,
     // which is used to indicate if the voice status is enabled or
     // disabled.

     // Create a batch
     Batch batch = conn.newBatch();
    // Create a map which will contain one element - the list of SNMP
    // variables to set on the MTA
    HashMap map = new HashMap();
    SnmpVarList list = new SnmpVarList();
    // An SnmpVariable represents a oid/value/type triple.
    SnmpVariable variable = new SnmpVariable(
          ".1.3.6.1.4.1.4491.2.2.1.1.1.7.0", //pktcMtaDevEnabled OID
          "1",
          SnmpType.INTEGER );
    list.add( variable );
    map.put( SNMPPropertyKeys.SNMPVAR_LIST, list );
    // The first param is the actual device operation to perform.
    batch.performOperation(DeviceOperation.INCREMENTAL_UPDATE,
                           new MACAddress("1,6,00:00:00:00:00:99"), map);
    BatchStatus status = batch.post();
    if ( status.isError() )
    {
        fail(status);
    }
    else
    {
        pass(status);
    }
    ...
 


CHANGE_PROVISIONING_GROUP

public static final DeviceOperation CHANGE_PROVISIONING_GROUP
Reserved for future use.

Method Detail

hashCode

public int hashCode()
The hash code of this object. See Object.hashCode for more information

Overrides:
hashCode in class Object
Returns:
The hascode of this object

equals

public boolean equals(Object obj)
Determines if this device operation object is equal to the specified object.

Overrides:
equals in class Object
Parameters:
obj - Description of the Parameter
Returns:
true if the specified object is equal to this object. false if the objects are not equal.

toString

public String toString()
Returns a String description of this device operation

Overrides:
toString in class Object
Returns:
a String description of this device operation