Cisco Systems, Inc.

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

java.lang.Object
  extended by com.pcube.apps.console.quota.data.QuotaProfileData
All Implemented Interfaces:
Formattable
Direct Known Subclasses:
QuotaProfileDataGx, QuotaProfileDataGy, QuotaProfileDataLegacy

public abstract class QuotaProfileData
extends java.lang.Object
implements Formattable

Data struct holding single quota profile. Quota Profile have a type (Gy,Gx,SCESubscriber...etc) and contains the profile buckets configuration and special porifle parameters.

Author:
rbaryana

Field Summary
static java.lang.String DEFAULT_PROFILE_NAME
           
 
Method Summary
abstract  void copyData(QuotaProfileData temp)
          copy the all data from temp profile.
abstract  QuotaProfileData duplicate()
           
 void fromStream(java.io.BufferedReader in, Formatter f)
          Read from PQB (non-Javadoc)
abstract  QuotaVolumeAccountingUnitsData getAccountingUnitsData()
           
 QuotaBucketData[] getAllBuckets()
           
 QuotaBucketData[] getAllUsedBucketsMask()
           
 QuotaServiceAttachmentList getAttachmentList()
           
 QuotaBucketData getBucketById(int idx)
          get bucket at index.
 int getBucketTypeOptimization(int id)
          We return the bucket optimized type, meaning if bucket have only upload or download then we can set the bucket type to only down or up.
 QuotaBucketData getDownloadBucket(Service srv, Rule rule)
           
 QuotaBucketData getDownloadBucket(Service srv, Rule rule, int timeframe)
           
 int getMyId()
           
 java.lang.String getMyName()
           
 int getNumberOfBuckets()
           
 QuotaServiceAttachment[] getQuotaServiceAttachment(Service srv, int timeFrame)
           
 QuotaBucketData getSessionBucket(Service srv, Rule rule)
           
 QuotaBucketData getSessionBucket(Service srv, Rule rule, int timeframe)
           
 QuotaInterfaceType getType()
           
abstract  QuotaBucketData getUnlimitedBucket()
           
 QuotaBucketData getUploadBucket(Service srv, Rule rule)
           
 QuotaBucketData getUploadBucket(Service srv, Rule rule, int timeframe)
           
 long getVolumeAccountingUnits()
           
 boolean isDefault()
           
 boolean isExternal()
           
 boolean isReadOnly()
          read only means not allowed to be changed by user.
 void setMyName(java.lang.String name)
          set profile name
 void setQuotaServiceAttachmentList(QuotaServiceAttachmentList list)
          attachment list contains method copy to, but sometimes is much faster just to keep the new list.
 void setVolumeAccountingUnits(long volumeAccountingUnits)
          Set Volume accounting Units.
 void toStream(java.io.PrintStream out, Formatter f)
          Write all attachments to PQB (non-Javadoc)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PROFILE_NAME

public static final java.lang.String DEFAULT_PROFILE_NAME
See Also:
Constant Field Values
Method Detail

getMyName

public java.lang.String getMyName()
Returns:
profile name

setMyName

public void setMyName(java.lang.String name)
set profile name

Parameters:
name -

isExternal

public boolean isExternal()
Returns:
true if profile is external profile

getBucketById

public QuotaBucketData getBucketById(int idx)
get bucket at index.

Parameters:
idx - normal buckets are 1-16
Returns:
the bucket or null if idx is out of range

getNumberOfBuckets

public int getNumberOfBuckets()
Returns:
number of buckets at profile.

getAllBuckets

public QuotaBucketData[] getAllBuckets()
Returns:
all buckets array.

getType

public QuotaInterfaceType getType()
Returns:
quota profile type.

duplicate

public abstract QuotaProfileData duplicate()
Returns:
a copy of the profile

copyData

public abstract void copyData(QuotaProfileData temp)
copy the all data from temp profile.

Parameters:
temp -

getAttachmentList

public QuotaServiceAttachmentList getAttachmentList()
Returns:
the profile service attachment.

setQuotaServiceAttachmentList

public void setQuotaServiceAttachmentList(QuotaServiceAttachmentList list)
attachment list contains method copy to, but sometimes is much faster just to keep the new list. when there is reason to keep the old list object use this method.

Parameters:
list -

getQuotaServiceAttachment

public QuotaServiceAttachment[] getQuotaServiceAttachment(Service srv,
                                                          int timeFrame)

getDownloadBucket

public QuotaBucketData getDownloadBucket(Service srv,
                                         Rule rule,
                                         int timeframe)
Parameters:
srv -
Returns:
attached download bucket or null if no such

getDownloadBucket

public QuotaBucketData getDownloadBucket(Service srv,
                                         Rule rule)
Parameters:
srv -
Returns:
attached download bucket or null if no such

getUploadBucket

public QuotaBucketData getUploadBucket(Service srv,
                                       Rule rule,
                                       int timeframe)
Parameters:
srv -
Returns:
attached upload bucket or null if no such

getUploadBucket

public QuotaBucketData getUploadBucket(Service srv,
                                       Rule rule)
Parameters:
srv -
Returns:
attached upload bucket or null if no such

getSessionBucket

public QuotaBucketData getSessionBucket(Service srv,
                                        Rule rule)
Parameters:
srv -
Returns:
attached upload session or null if no such

getSessionBucket

public QuotaBucketData getSessionBucket(Service srv,
                                        Rule rule,
                                        int timeframe)
Parameters:
srv -
Returns:
attached upload session or null if no such

isReadOnly

public boolean isReadOnly()
read only means not allowed to be changed by user. not enforced.

Returns:
is read only profile

getMyId

public int getMyId()
Returns:
package unique identifier.

getUnlimitedBucket

public abstract QuotaBucketData getUnlimitedBucket()
Returns:
the unlimited quota bucket (default)

getAllUsedBucketsMask

public QuotaBucketData[] getAllUsedBucketsMask()
Returns:
Only buckets that are attached to services.

getBucketTypeOptimization

public int getBucketTypeOptimization(int id)
We return the bucket optimized type, meaning if bucket have only upload or download then we can set the bucket type to only down or up.

Parameters:
id -
Returns:

getVolumeAccountingUnits

public long getVolumeAccountingUnits()
Returns:
Volume Accounting Units.

setVolumeAccountingUnits

public void setVolumeAccountingUnits(long volumeAccountingUnits)
Set Volume accounting Units.

Parameters:
volumeAccountingUnits -

getAccountingUnitsData

public abstract QuotaVolumeAccountingUnitsData getAccountingUnitsData()
Returns:
the volume acconting units as wrapped object.

isDefault

public boolean isDefault()
Returns:
true if this is the default profile (no quota)

toStream

public void toStream(java.io.PrintStream out,
                     Formatter f)
Write all attachments to PQB (non-Javadoc)

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

fromStream

public void fromStream(java.io.BufferedReader in,
                       Formatter f)
                throws ImportExportException
Read from PQB (non-Javadoc)

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

Cisco Systems, Inc.

Copyright © 2013 Cisco Systems, Inc. Confidential.