Cisco Systems, Inc.

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

java.lang.Object
  extended by com.pcube.apps.console.quota.data.QuotaServiceAttachment
All Implemented Interfaces:
Formattable
Direct Known Subclasses:
QuotaServiceAttachemntGy, QuotaServiceAttachmentGx, QuotaServiceAttachmentLegacy

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

Holds Service attachment data such as (in internal mode) which service what type up/down/both...etc

Author:
rbaryana

Constructor Summary
QuotaServiceAttachment(Service service, Policy policy)
           
 
Method Summary
 void attachBucket(QuotaBucketData bucket)
           
 void attachBucket(QuotaBucketData bucket, int timeFarme)
          attach for time frame.
 void cleanAllAttachments(int bucketid)
          clean all buckets from this attachment.
abstract  void copyTo(QuotaServiceAttachment quotaServiceAttchment)
           
abstract  QuotaServiceAttachment duplicate()
           
 int getBucketId()
          (use isAttached to see if attached)
 int getBucketId(int timeFrame)
          (use isAttached to see if attached)
 int getFramedServiceBucketId(int timeFrame)
          In timeframe service, we first look if the timeframe is attached and if not we will return the main service bucket.
 java.lang.String getMyServiceName()
           
 java.lang.String getParentServiceName()
           
abstract  java.lang.String getText()
           
 boolean isAnyAttachmentsExits()
           
 boolean isAttached()
          (Basic Attachment)
 boolean isAttached(int timeFrame)
           
 boolean isBucketAttahed(int id)
           
 boolean isServiceAttachedToBucket(int bukcetid)
          search if bucket is attached to the service of this attahment or to one of its timeframes service rules.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.pcube.apps.engage.common.Formattable
fromStream, toStream
 

Constructor Detail

QuotaServiceAttachment

public QuotaServiceAttachment(Service service,
                              Policy policy)
Method Detail

isAttached

public boolean isAttached()
(Basic Attachment)

Returns:
true if attachment associated with bucket

isAttached

public boolean isAttached(int timeFrame)
Parameters:
index -
Returns:
true if attachment for rule on time frame index associated with bucket

isAnyAttachmentsExits

public boolean isAnyAttachmentsExits()
Returns:
true if the service or one of its attached timeframe rules are configured.

cleanAllAttachments

public void cleanAllAttachments(int bucketid)
clean all buckets from this attachment. (used when user changes the bucket type).

Parameters:
bucketid -

isServiceAttachedToBucket

public boolean isServiceAttachedToBucket(int bukcetid)
search if bucket is attached to the service of this attahment or to one of its timeframes service rules.

Parameters:
bukcetid -
Returns:
true if bucket is attached.

attachBucket

public void attachBucket(QuotaBucketData bucket,
                         int timeFarme)
attach for time frame.

Parameters:
bucket -
timeFarme -

attachBucket

public void attachBucket(QuotaBucketData bucket)

getText

public abstract java.lang.String getText()

duplicate

public abstract QuotaServiceAttachment duplicate()

copyTo

public abstract void copyTo(QuotaServiceAttachment quotaServiceAttchment)

getBucketId

public int getBucketId()
(use isAttached to see if attached)

Returns:
the attached bucket id. if not attached then will return EMPTY_BUCKET.

getBucketId

public int getBucketId(int timeFrame)
(use isAttached to see if attached)

Returns:
the attached bucket id. if not attached then will return EMPTY_BUCKET.

getFramedServiceBucketId

public int getFramedServiceBucketId(int timeFrame)
In timeframe service, we first look if the timeframe is attached and if not we will return the main service bucket. In other words, timeframes rule will get the bucket of its service rule unless it was specificalliy configured.

Parameters:
timeFrame -
Returns:

getParentServiceName

public java.lang.String getParentServiceName()

getMyServiceName

public java.lang.String getMyServiceName()

isBucketAttahed

public boolean isBucketAttahed(int id)

Cisco Systems, Inc.

Copyright © 2013 Cisco Systems, Inc. Confidential.