Cisco Systems, Inc.

com.pcube.apps.console.quota.data
Class QuotaProfileList

java.lang.Object
  extended by com.pcube.apps.console.quota.data.QuotaProfileList

public class QuotaProfileList
extends java.lang.Object

Data struct for holding and managing all profiles. Support basic actions such as adding/removing...etc. Keeps name uniqueness..etc.

Author:
rbaryana

Constructor Summary
QuotaProfileList()
           
 
Method Summary
 void addProfile(QuotaProfileData newProfile)
          add new profile.
 void copyData(QuotaProfileList list)
          update all profiles according to list
 QuotaProfileList duplicate()
          create full duplicate of profile list.
 QuotaProfileData[] getAllProfiles()
           
 QuotaProfileData[] getAllProfiles(QuotaProfileListFilter filter)
           
 QuotaProfileData getProfile(int idx)
           
 QuotaProfileData getProfileByName(java.lang.String name)
          profile name is unique identifier.
 boolean isProfileNameExists(java.lang.String name)
          checks if profile name is already used.
 boolean isProfileNameExists(java.lang.String name, QuotaProfileData data)
           
 void removeProfile(QuotaProfileData removeProfile)
          remove profile from list.
 int size()
           
 void updateNames()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuotaProfileList

public QuotaProfileList()
Method Detail

addProfile

public void addProfile(QuotaProfileData newProfile)
                throws QuotaDataException
add new profile. profile name must be unique or else exception will be thrown.

Parameters:
newProfile -
Throws:
QuotaDataException - (name uniqueness violation)

removeProfile

public void removeProfile(QuotaProfileData removeProfile)
remove profile from list.

Parameters:
removeProfile -

isProfileNameExists

public boolean isProfileNameExists(java.lang.String name)
checks if profile name is already used.

Parameters:
name -
Returns:
true if name is used by existing profile.

isProfileNameExists

public boolean isProfileNameExists(java.lang.String name,
                                   QuotaProfileData data)

getAllProfiles

public QuotaProfileData[] getAllProfiles()
Returns:
all exitisng profiles as arrays.

getAllProfiles

public QuotaProfileData[] getAllProfiles(QuotaProfileListFilter filter)
Parameters:
filter -
Returns:
all quota profiles that pass the filter.

size

public int size()
Returns:
number of total profiles.

getProfile

public QuotaProfileData getProfile(int idx)
Parameters:
idx -
Returns:
the profile at idx location. mat return null for illegal value

duplicate

public QuotaProfileList duplicate()
                           throws QuotaDataException
create full duplicate of profile list. (changing the duplication object in any way will change the original)

Returns:
duplicated list
Throws:
QuotaDataException

copyData

public void copyData(QuotaProfileList list)
update all profiles according to list

Parameters:
list -

getProfileByName

public QuotaProfileData getProfileByName(java.lang.String name)
profile name is unique identifier.

Parameters:
name - - the profile name
Returns:
the profile if exists or null if no such profile.

updateNames

public void updateNames()

Cisco Systems, Inc.

Copyright © 2013 Cisco Systems, Inc. Confidential.