Cisco Systems, Inc.

com.pcube.apps.engage.common
Class BWControllerArray

java.lang.Object
  extended by com.pcube.apps.engage.common.BWControllerArray
All Implemented Interfaces:
Formattable, java.io.Serializable, java.lang.Cloneable

public class BWControllerArray
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable, Formattable

The array of bandwidth controlers. Bandwidth controllers in the array can be modified so that the bandwidth accumulated by them will also be acumulated in the total bandwidth controller.

See Also:
BWController, DeprecatedPackageData, Serialized Form

Field Summary
static int DEFAULT_DOWNSTREAM_BWC_IDX
          default up stream and down stream BWC index *
static java.lang.String DEFAULT_DOWNSTREAM_BWC_NAME
           
static int DEFAULT_UPSTREAM_BWC_IDX
           
static java.lang.String DEFAULT_UPSTREAM_BWC_NAME
           
 boolean isAddOnPackage
           
 
Constructor Summary
BWControllerArray()
          BWControllerArray Constructor.
 
Method Summary
 void addBwcForCombo(BWControllerArray other)
          This method will called to update bwc info in a combo package, whenever there is any add or delete of bwc in any one of packages available in combo
 void addNewBWCController(BWController bwc)
          This method will be called to add BWC in combo package
 int addNewBWController()
          Adds an aggregated BWController.
 BWController addNewBWController(int index)
          Adds an aggregated BWController in a specific index in the BWController array.
 java.lang.Object clone()
          Producing an identical object to this object.
 boolean contains(BWController item)
          Checks if a certain BWController exists in this list.
 boolean contains(java.lang.String bwcName)
          Checks if an BWController with bears the specific name exists in this list.
 BWController findByName(java.lang.String name)
          find the BWC that has the specified name.
 void fromStream(java.io.BufferedReader in, Formatter f)
          Method fromStream
 BWController getAt(int index)
          Gets the BWController this list has in a specific index.
 int getIndexOfItem(java.lang.String name)
          Gets the index of the BWController in this list which has the specific name.
 int getSize()
          Gets the size of this list.
 com.pcube.apps.engage.foundations.VetoableCollectionChangeListener getVetoChangeListener()
           
 boolean isAddOnPackage()
           
 boolean isBWCAdded(int bwcIndex)
          Checks if the BWController in a specific index in the BWController array was added.
 java.util.Iterator iterator()
           
 java.util.Iterator iterator(int direction)
           
 java.util.ListIterator listIterator()
           
 java.util.ListIterator listIterator(int direction)
           
 void remove(BWController bwc)
          This method will remove the corresponding BWC from combo package, when by using the BWController object
 void remove(int index)
          Removes the BWController from a specific index in this list.
 void setAddOnPackage(boolean isAddOnPackage)
           
 void setValueFrom(BWControllerArray other)
          Method setValueFrom
 void setVetoChangeListener(com.pcube.apps.engage.foundations.VetoableCollectionChangeListener vetoChangeListener)
          Only a single listener is currently supported.
 void toStream(java.io.PrintStream out, Formatter f)
          Method toStream
 void updateBwcMappingOnCombo(Package updatedPackage, PackageCombo combo)
          This method will update BWC mapping to Combo Package Base Package (BP) , Add on Package (AP) , Combo Package (CP) Case 1: If BP and AP contains same BWC, then BWC of BP will be removed and BWC of AP will be mapped to CP Case 2: If BP doesn't contains any BWC of AP, then BWC of AP will be directly mapped to CP
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DOWNSTREAM_BWC_IDX

public static final int DEFAULT_DOWNSTREAM_BWC_IDX
default up stream and down stream BWC index *

See Also:
Constant Field Values

DEFAULT_UPSTREAM_BWC_IDX

public static final int DEFAULT_UPSTREAM_BWC_IDX
See Also:
Constant Field Values

DEFAULT_DOWNSTREAM_BWC_NAME

public static final java.lang.String DEFAULT_DOWNSTREAM_BWC_NAME
See Also:
Constant Field Values

DEFAULT_UPSTREAM_BWC_NAME

public static final java.lang.String DEFAULT_UPSTREAM_BWC_NAME
See Also:
Constant Field Values

isAddOnPackage

public boolean isAddOnPackage
Constructor Detail

BWControllerArray

public BWControllerArray()
BWControllerArray Constructor.

Method Detail

clone

public java.lang.Object clone()
Producing an identical object to this object.

Overrides:
clone in class java.lang.Object
Returns:
a newly alocated object similar to this object.

contains

public boolean contains(BWController item)
Checks if a certain BWController exists in this list.

Parameters:
item - the queried BWController
Returns:
true if exists, false otherwise

contains

public boolean contains(java.lang.String bwcName)
Checks if an BWController with bears the specific name exists in this list.

Parameters:
bwcName - the desired BWController's name
Returns:
true if exists, false otherwise

fromStream

public void fromStream(java.io.BufferedReader in,
                       Formatter f)
                throws ImportExportException
Description copied from interface: Formattable
Method fromStream

Specified by:
fromStream in interface Formattable
Throws:
ImportExportException
See Also:
Formattable.fromStream(java.io.BufferedReader, com.pcube.apps.engage.common.Formatter)

getAt

public BWController getAt(int index)
                   throws ItemNotFoundException
Gets the BWController this list has in a specific index.

Parameters:
index - - the index of the desired BWController
Returns:
the BWController at the specified location or null if the location is empty
Throws:
ItemNotFoundException

getIndexOfItem

public int getIndexOfItem(java.lang.String name)
Gets the index of the BWController in this list which has the specific name.

Parameters:
item - the desired BWController's name
Returns:
the BWController's index if exists, -1 otherwise

findByName

public BWController findByName(java.lang.String name)
find the BWC that has the specified name. if no BWC is found returns null

Parameters:
name -
Returns:

getSize

public int getSize()
Gets the size of this list.

Returns:
this list's size

setValueFrom

public void setValueFrom(BWControllerArray other)
                  throws java.beans.PropertyVetoException
Method setValueFrom

Parameters:
other -
Throws:
java.beans.PropertyVetoException

addBwcForCombo

public void addBwcForCombo(BWControllerArray other)
This method will called to update bwc info in a combo package, whenever there is any add or delete of bwc in any one of packages available in combo

Parameters:
other - Updated packages Bandwidth controller array.

addNewBWCController

public void addNewBWCController(BWController bwc)
                         throws com.pcube.apps.engage.foundations.CollectionVetoException
This method will be called to add BWC in combo package

Parameters:
bwc - bwc to add in combo package
Throws:
com.pcube.apps.engage.foundations.CollectionVetoException

updateBwcMappingOnCombo

public void updateBwcMappingOnCombo(Package updatedPackage,
                                    PackageCombo combo)
This method will update BWC mapping to Combo Package Base Package (BP) , Add on Package (AP) , Combo Package (CP) Case 1: If BP and AP contains same BWC, then BWC of BP will be removed and BWC of AP will be mapped to CP Case 2: If BP doesn't contains any BWC of AP, then BWC of AP will be directly mapped to CP

Parameters:
updatedPackage -
combo -

remove

public void remove(BWController bwc)
This method will remove the corresponding BWC from combo package, when by using the BWController object

Parameters:
bwc - object of BWController which is going to remove

toStream

public void toStream(java.io.PrintStream out,
                     Formatter f)
Description copied from interface: Formattable
Method toStream

Specified by:
toStream in interface Formattable
See Also:
Formattable.toStream(java.io.PrintStream, com.pcube.apps.engage.common.Formatter)

addNewBWController

public int addNewBWController()
                       throws com.pcube.apps.engage.foundations.CollectionVetoException
Adds an aggregated BWController.

Returns:
the added BWController index in the BWController array
Throws:
ItemNotFoundException - if there are no BWControllers left to add
com.pcube.apps.engage.foundations.CollectionVetoException

addNewBWController

public BWController addNewBWController(int index)
                                throws com.pcube.apps.engage.foundations.CollectionVetoException
Adds an aggregated BWController in a specific index in the BWController array.

Parameters:
index - the added BWController index in the BWController array
Returns:
the newly created bwc
Throws:
ItemNotFoundException - if the index is out of bound
java.lang.IllegalArgumentException - if the BWController in the index was already added
com.pcube.apps.engage.foundations.CollectionVetoException

remove

public void remove(int index)
            throws com.pcube.apps.engage.foundations.CollectionVetoException
Removes the BWController from a specific index in this list.

Parameters:
index - the removed BWController's index in this list
Throws:
ItemNotFoundException - if this list has no BWController with the desired values
com.pcube.apps.engage.foundations.CollectionVetoException

isBWCAdded

public boolean isBWCAdded(int bwcIndex)
Checks if the BWController in a specific index in the BWController array was added.

Parameters:
bwcIndex - index of the BWController to check
Returns:
true if added, false otherwise
Throws:
ItemNotFoundException - if the index is out of bound

iterator

public java.util.Iterator iterator()

iterator

public java.util.Iterator iterator(int direction)

listIterator

public java.util.ListIterator listIterator(int direction)
Parameters:
direction -
Returns:
an iterator that returns only the BWControllers with the specified direction

listIterator

public java.util.ListIterator listIterator()
Returns:
an instance of a ListIterator

getVetoChangeListener

public com.pcube.apps.engage.foundations.VetoableCollectionChangeListener getVetoChangeListener()
Returns:
Returns the vetoChangeListener.

setVetoChangeListener

public void setVetoChangeListener(com.pcube.apps.engage.foundations.VetoableCollectionChangeListener vetoChangeListener)
Only a single listener is currently supported. To stop listening to events set the listner to null.

Parameters:
vetoChangeListener - The vetoChangeListener to set.

isAddOnPackage

public boolean isAddOnPackage()

setAddOnPackage

public void setAddOnPackage(boolean isAddOnPackage)

Cisco Systems, Inc.

Copyright © 2013 Cisco Systems, Inc. Confidential.