Issue #2566 Update BandwidthGraphDataAdaptor to handle case when there are no reservations.
Change-Id: Ie9eb7e3e1a5bc8ac4a8ccf9532686d97f584bf1c Former-commit-id:1c027db49b
[formerly6515d6a9e5
] [formerly112649eff2
] [formerly96dc3b65b1
[formerly112649eff2
[formerly 14171c13dd5f127df0b90a5db9a9e11b301ffc5f]]] Former-commit-id:96dc3b65b1
Former-commit-id: 0737955a8aef371ea08edc7e3c56b368da7ef030 [formerly79efc3b53a
] Former-commit-id:3f5c25ff46
This commit is contained in:
parent
eb2ae25b0b
commit
d81e245314
1 changed files with 15 additions and 8 deletions
|
@ -61,6 +61,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalPlan;
|
|||
* Jul 11, 2013 2106 djohnson Use priority straight from the BandwidthSubscription.
|
||||
* Sep 20, 2013 2397 bgonzale Add Map of Bucket Descriptions to BandwidthGraphData.
|
||||
* Nov 27, 2013 2545 mpduff Get data by network
|
||||
* Dec 11, 2013 2566 bgonzale handle case when there are no reservations.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -130,12 +131,14 @@ class BandwidthGraphDataAdapter {
|
|||
final List<BandwidthReservation> bandwidthReservations = retrievalPlan
|
||||
.getBandwidthReservationsForBucket(bucket);
|
||||
|
||||
for (BandwidthReservation reservation : bandwidthReservations) {
|
||||
if (!reservations.containsKey(reservation.getId())) {
|
||||
reservations.put(reservation.getId(),
|
||||
new ArrayList<BandwidthReservation>());
|
||||
if (bandwidthReservations != null) {
|
||||
for (BandwidthReservation reservation : bandwidthReservations) {
|
||||
if (!reservations.containsKey(reservation.getId())) {
|
||||
reservations.put(reservation.getId(),
|
||||
new ArrayList<BandwidthReservation>());
|
||||
}
|
||||
reservations.get(reservation.getId()).add(reservation);
|
||||
}
|
||||
reservations.get(reservation.getId()).add(reservation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -177,9 +180,13 @@ class BandwidthGraphDataAdapter {
|
|||
|
||||
List<Long> binStartTimes = new ArrayList<Long>();
|
||||
binStartTimes.add(retrieval.getStartTime().getTimeInMillis());
|
||||
for (BandwidthReservation reservation : reservations.get(retrieval
|
||||
.getIdentifier())) {
|
||||
binStartTimes.add(reservation.getBandwidthBucket());
|
||||
List<BandwidthReservation> retrievalReservations = reservations
|
||||
.get(retrieval.getIdentifier());
|
||||
|
||||
if (retrievalReservations != null) {
|
||||
for (BandwidthReservation reservation : retrievalReservations) {
|
||||
binStartTimes.add(reservation.getBandwidthBucket());
|
||||
}
|
||||
}
|
||||
window.setBinStartTimes(binStartTimes);
|
||||
windowData.addTimeWindow(window);
|
||||
|
|
Loading…
Add table
Reference in a new issue