com.cisco.provisioning.cpe.api
Interface LeaseResults


public interface LeaseResults

This interface represents the results from the IPDevice.getDetails(DeviceID, List) call. The interface contains information about the leases found for the request and errors that occurred while retrieving the information.


Field Summary
static byte CNR_STATE_ERROR_RETURNED
          Indicates the Network Registrar sent an error code back or there is no binding
static byte CNR_STATE_LEASE_NOT_IN_USE
          Indicates the Network Registrar server returned saying the lease is not in use.
static byte CNR_STATE_LEASE_RETURNED
          Indicates the Network Registrar server returned lease for this request.
static byte CNR_STATE_NO_RESPONSE
          Indicates the Network Registrar server did not respond to this request.
static byte CNR_STATE_OFFLINE
          Indicates the Network Registrar server was offline at the time of this request.
static byte CNR_STATE_UNKNOWN_SERVER
          Indicates the Network Registrar server requested is not known.
 
Method Summary
 LeaseResults filterForProvGroup(int indexInList)
          Returns a new LeaseResults object that is specific to the requested provisioning group.
 LeaseResults filterForProvGroup(String provGroupID)
          Returns a new LeaseResults object that is specific to the requested provisioning group.
 List<String> getAllCNRServers()
          Returns a List of the Network Registrar server IP addresses that were applicable to the lease request performed.
 List<String> getAllProvGroups()
          Returns a List of all the provisioning groups returned in this lease request.
 byte getCNRServerState(int indexInList)
          Returns a byte indicating the Network Registrar server state for this lease request.
 byte getCNRServerState(String cnrServer)
          Returns a byte indicating the Network Registrar server state for this lease request.
 List<Map<String,Object>> getLeases()
          Returns a List of the active leases that match the criteria for the requested lease.
 Map<String,Object> getSingleLease()
          Returns a single lease that was found for the lease request.
 boolean isActive()
          Returns true if the requested lease is currently in use on the network in at least one location.
 boolean isPartialAnswer()
          Returns true if not all of queried Network Registrar servers responded to the request for lease information.
 boolean isV4()
          Return true if the lease result is for an IPv4 device.
 boolean isV6()
          Returns true if the lease result is for an IPv6 device.
 

Field Detail

CNR_STATE_UNKNOWN_SERVER

static final byte CNR_STATE_UNKNOWN_SERVER
Indicates the Network Registrar server requested is not known.

See Also:
Constant Field Values

CNR_STATE_LEASE_RETURNED

static final byte CNR_STATE_LEASE_RETURNED
Indicates the Network Registrar server returned lease for this request.

See Also:
Constant Field Values

CNR_STATE_LEASE_NOT_IN_USE

static final byte CNR_STATE_LEASE_NOT_IN_USE
Indicates the Network Registrar server returned saying the lease is not in use.

See Also:
Constant Field Values

CNR_STATE_OFFLINE

static final byte CNR_STATE_OFFLINE
Indicates the Network Registrar server was offline at the time of this request.

See Also:
Constant Field Values

CNR_STATE_NO_RESPONSE

static final byte CNR_STATE_NO_RESPONSE
Indicates the Network Registrar server did not respond to this request.

See Also:
Constant Field Values

CNR_STATE_ERROR_RETURNED

static final byte CNR_STATE_ERROR_RETURNED
Indicates the Network Registrar sent an error code back or there is no binding

See Also:
Constant Field Values
Method Detail

getAllProvGroups

List<String> getAllProvGroups()
Returns a List of all the provisioning groups returned in this lease request. The List contains the provGroupID that can be passed to filterForProvGroup if it is desirable to get the results specific to a given provisioning group.


filterForProvGroup

LeaseResults filterForProvGroup(int indexInList)
Returns a new LeaseResults object that is specific to the requested provisioning group. The argument to this command is the provisioning group at the specified index in the getAllProvGroups(...) method call. This command can be used to find out results specific to a given provisioning group, for example, to find out what Network Registrar servers were offline in the given provisioning group, call this and then use the getCNRServersWithError.

This method will return null if called for a provisioning group that does not exist.


filterForProvGroup

LeaseResults filterForProvGroup(String provGroupID)
Returns a new LeaseResults object that is specific to the requested provisioning group. The argument to this command is the ID of the provisioning group, however, this method is significantly less efficient than the indexInList version. If at all possible, the indexInList version should be used. This command can be used to find out results specific to a given provisioning group, for example, to find out what Network Registrar servers were offline in the given provisioning group, call this and then use the getCNRServersWithError.

This method will return null if called for a provisioning group that does not exist.


isActive

boolean isActive()
Returns true if the requested lease is currently in use on the network in at least one location. If this call returns false, the isPartialResult() method should be called to find out if all of the necessary Network Registrar servers responded for this to be considered an authoritative answer.

If this method is called on a LeaseResults filtered for a particular provisioning group, this method will return true only if the lease is in use in that designated group.


isPartialAnswer

boolean isPartialAnswer()
Returns true if not all of queried Network Registrar servers responded to the request for lease information.

If this method is called on a LeaseResults filtered for a particular provisioning group, this method will return true only if the lease information was not complete in that designated group.


isV4

boolean isV4()
Return true if the lease result is for an IPv4 device.

Returns:
boolean

isV6

boolean isV6()
Returns true if the lease result is for an IPv6 device.

Returns:
boolean

getLeases

List<Map<String,Object>> getLeases()
Returns a List of the active leases that match the criteria for the requested lease. The leases returned may optionally have information from the device database in the RDU if the lease matched in Network Registrar referenced a valid device object by MAC address in the database. The list will contain a Map object for each lease found.

If this method is called on a LeaseResults filtered for a particular provisioning group, this method will return the lease objects for that designated group.


getSingleLease

Map<String,Object> getSingleLease()
                                  throws MultipleLeasesException
Returns a single lease that was found for the lease request. This call should only be used when it is guaranteed that an IP address is not used in more than one location on the network. If multiple IP addresses are found for the specified lease request, this call will result in the MultipleLeaseException being thrown. If the lease corresponds to a valid device in the database, the information from the device will also be returned in the Map. If no lease is available, null will be returned from this call.

If this method is called on a LeaseResults filtered for a particular provisioning group, this method will return the lease information in that designated group.

Throws:
MultipleLeasesException

getAllCNRServers

List<String> getAllCNRServers()
Returns a List of the Network Registrar server IP addresses that were applicable to the lease request performed. This set will contain both Network Registrar servers that responded and those that had different errors. To find out what happened with a given Network Registrar server, call getCNRServerState(...) with the index of the Network Registrar server in the list.

If this method is called on a LeaseResults filtered for a particular provisioning group, this method will return the Network Registrar servers only applicable to that provisioning group.


getCNRServerState

byte getCNRServerState(int indexInList)
Returns a byte indicating the Network Registrar server state for this lease request. Pass in the index of the Network Registrar server in the List returned from getAllCNRServers(). The following are the constants returned from this call:

If this method is called on a LeaseResults filtered for a particular provisioning group, this method will return the Network Registrar servers only applicable to that provisioning group.


getCNRServerState

byte getCNRServerState(String cnrServer)
Returns a byte indicating the Network Registrar server state for this lease request. This version accepts the IP address instead of requiring the indexInList but it is significantly less efficient than the indexInList method. If it is at all possible to use the indexInList version, that one should be used. Pass in the String ipAddress of the Network Registrar server in the List returned from getAllCNRServers(). The following are the constants returned from this call:

If this method is called on a LeaseResults filtered for a particular provisioning group, this method will return the Network Registrar servers only applicable to that provisioning group.