Cisco Systems, Inc.

com.pcube.apps.engage.policy
Class Policy

java.lang.Object
  extended by com.pcube.apps.engage.policy.Policy
All Implemented Interfaces:
Formattable, IPolicyDirtyMarker, java.io.Serializable

public class Policy
extends java.lang.Object
implements java.io.Serializable, Formattable, IPolicyDirtyMarker

Policy is the whole set of lists, protocols, services and packages that an ISP has defined. The Policy is applied to the Policy Domain's SE boxes and sets their application's parameters to regulate the subscriber's flows.

See Also:
Serialized Form

Field Summary
static int GLOBAL_RULE_PACKAGE
           
static int GLOBAL_RULE_PACKAGE_OLD_INDEX
           
static int MAX_8K_PACKAGES
          Maximum number of Packages the Policy can define
static int MAX_8K_POLICY_APPLY_PACKAGES
           
static int MAX_ADD_ON_GROUPS
           
static int MAX_ADD_ON_PACKAGES
           
static int MAX_ADD_ON_PACKAGES_PER_GROUP
           
static int MAX_BW_CONTROLLERS
          Number of BWControllers a Package has
static int MAX_BW_LIMITERS
          Number of BW limiters a each direction has
static int MAX_BW_LIMITERS_10G
           
static int MAX_CALENDARS
           
static int MAX_PACKAGES
           
static int MAX_POLICY_APPLY_PACKAGES
           
static int MAX_REDIRECT_STRING_ARRAY
          Maximum number of redirect strings per each redirectable Protocol
static int MAX_RULEFRAMES
           
static int MAX_SERVICES
          Maximum number of Services the Policy can define
static int MAX_TIMEFRAMES
          Number of time frames the Policy defines
static java.lang.String NO_OVERRIDE_FOR_ADD_ON_PACKAGE
           
static java.lang.String PLATFORM
           
static int PROTOCOL_SIGNATURES_REDIRECTABLE_ALL
           
static int PROTOCOL_SIGNATURES_REDIRECTABLE_NONE
           
static int PROTOCOL_SIGNATURES_REDIRECTABLE_SOME
           
static int UNKNOWN_SUBSCRIBER_PACKAGE
           
 
Constructor Summary
Policy()
          Policy Constructor.
Policy(java.lang.String descriptionText)
          Deprecated. use Policy()instead.
 
Method Summary
 void fromStream(java.io.BufferedReader in, Formatter f)
          Reading this object from a BufferedReader
 AddOnGroupArray getAddOnGroupList()
           
 int getAddOnTemplatesSize()
           
 boolean getAttackDetectorEnabled()
           
 CalendarArray getCalendarList()
           
 ClassificationConfiguration getClassificationCfg()
           
 NotifyingProperties getCustomNonPersistentProperties()
           
 com.cisco.scabb.client.ui.security.DetectorRepository getDetectorRepository()
           
 DynamicSignaturesScript getDynamicSignatureScript()
           
 long getLastApplyTimestamp()
          Gets the timestamp of the time this Policy was successfully applied to any Policy Domain.
 com.pcube.apps.engage.management.PrimitiveList getListenersDataList()
           
 PackageArray getPackageList()
          Gets this Policy's Package list.
 float getPolicyPqbFormatId()
           
 PolicySettings getPolicySettings()
          Gets this Policy's settings.
 ProtocolFamiliesManager getProtocolFamiliesManager()
          use the ProtocolFamiliesManager to manage the policy's protocol families settings
 ProtocolList getProtocolList()
          Gets this Policy's Protocol list.
 ProtocolRedirectIndexNameArray getProtocolRedirectIndexNameArray()
          Gets the list of the Protocols' redirect index names.
 com.pcube.apps.engage.management.RedirectSetParametersModel getProtocolRedirectParams(int redirectIndex)
          Returns the object of the RedirectSetParametersModel.
 java.lang.String getProtocolRedirectString(java.lang.String protocolName)
          Gets the default redirect address for the Protocol.
 java.lang.String getProtocolRedirectString(java.lang.String protocolName, int redirectIndex)
          Gets the redirect address for the Protocol in a certain index in its redirect String array.
 QuotaData getQuotaData()
           
 java.lang.String getRealRuleFrameName(java.lang.String name)
           
 java.lang.String getRealTimeFrameName(java.lang.String name)
          Gets the predefined API name for a certain TimeFrame.
 java.lang.String[] getRuleFrameNames()
           
 ServiceArray getServiceList()
          Gets this Policy's Service list.
 SubNotificationArray getSubNotifications()
          Deprecated.  
 SubscriberRedirectionArray getSubscriberRedirectionArray()
           
 java.lang.String[] getTimeFrameNames()
          Gets the time frame names this Policy has assigned the different TimeFrames.
 TimeSlotMatrix getTimeSlotMatrix()
          Deprecated. use CalendarArray.getDefaultTimeSlotMatrix()
 ToSMarkingArray getToSMarkingArray()
           
 java.lang.String getUpgradeVersion()
           
 ZoneList getZoneList()
          Gets this Policy's IP, IP ranges and host lists array.
 boolean isEnableAllAttackFilters()
           
 boolean isMirroringAttached()
           
 int isProtocolRedirectable(java.lang.String protocolName)
          Checks if a specific Protocol supports redirecting.
 void refreshQuotaCfg()
          upon quota profile changed this method should be called.
 void setAddOnGroupsList(AddOnGroupArray addOnGroupList)
           
 void setAllAttackFilterEnable(boolean b)
           
 void setAttackDetectorEnabled(boolean enable)
           
 void setDirty(boolean dirty)
           
static void setDirty(Policy policy, boolean dirty)
          Add '*' to title if policy has changed
 void setLastApplyTimestamp(long newLastApplyTimestamp)
          Method setLastApplyTimestamp
 void setPackageList(PackageArray list)
          Method setPackageList
 void setPolicyModified()
           
 void setPolicySettings(PolicySettings settings)
          Method setPolicySettings
 void setProtocolRedirectString(java.lang.String protocolName, int redirectIndex, java.lang.String value)
          Sets the address to redirect a certain flow to.
 void setProtocolRedirectString(java.lang.String protocolName, java.lang.String value)
          Sets the default address to redirect a certain flow to.
 void setQuotaData(QuotaData quotaData)
          Method setQuotaData
 void setQuotaExternalType(QuotaExternalType type)
          Set Quota External Type.
 void setServiceList(ServiceArray list)
          Method setServiceList
 void setSubNotifications(SubscriberRedirectionArray subNotifications)
           
 void setTimeFrameName(int index, java.lang.String newName)
          Sets an alias for the specific TimeFrame which has a certain index.
 void setTimeFrameName(TimeFrame frame, java.lang.String newName)
          Sets an alias for the specific TimeFrame.
 void setTimeFrameNames(java.lang.String[] newNames)
          set the names of all time frames.
 void setTimeSlotMatrix(TimeSlotMatrix newTimeSlotMatrix)
          Deprecated. use CalendarArray.getDefaultTimeSlotMatrix()
 void setUpgradeVersion(java.lang.String upgradeVersion)
           
 void toStream(java.io.PrintStream out, Formatter f)
          Writing this object to a PrintStream
static void updateDirty(Policy policy, boolean newDirty)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_BW_CONTROLLERS

public static int MAX_BW_CONTROLLERS
Number of BWControllers a Package has


MAX_BW_LIMITERS

public static int MAX_BW_LIMITERS
Number of BW limiters a each direction has


MAX_BW_LIMITERS_10G

public static int MAX_BW_LIMITERS_10G

MAX_CALENDARS

public static final int MAX_CALENDARS
See Also:
Constant Field Values

MAX_8K_PACKAGES

public static final int MAX_8K_PACKAGES
Maximum number of Packages the Policy can define

See Also:
Constant Field Values

MAX_8K_POLICY_APPLY_PACKAGES

public static final int MAX_8K_POLICY_APPLY_PACKAGES
See Also:
Constant Field Values

MAX_PACKAGES

public static int MAX_PACKAGES

MAX_POLICY_APPLY_PACKAGES

public static int MAX_POLICY_APPLY_PACKAGES

MAX_ADD_ON_GROUPS

public static int MAX_ADD_ON_GROUPS

MAX_ADD_ON_PACKAGES

public static int MAX_ADD_ON_PACKAGES

MAX_ADD_ON_PACKAGES_PER_GROUP

public static int MAX_ADD_ON_PACKAGES_PER_GROUP

GLOBAL_RULE_PACKAGE

public static int GLOBAL_RULE_PACKAGE

GLOBAL_RULE_PACKAGE_OLD_INDEX

public static int GLOBAL_RULE_PACKAGE_OLD_INDEX

UNKNOWN_SUBSCRIBER_PACKAGE

public static int UNKNOWN_SUBSCRIBER_PACKAGE

MAX_REDIRECT_STRING_ARRAY

public static int MAX_REDIRECT_STRING_ARRAY
Maximum number of redirect strings per each redirectable Protocol


MAX_SERVICES

public static int MAX_SERVICES
Maximum number of Services the Policy can define


MAX_TIMEFRAMES

public static int MAX_TIMEFRAMES
Number of time frames the Policy defines


MAX_RULEFRAMES

public static int MAX_RULEFRAMES

PROTOCOL_SIGNATURES_REDIRECTABLE_ALL

public static int PROTOCOL_SIGNATURES_REDIRECTABLE_ALL

PROTOCOL_SIGNATURES_REDIRECTABLE_SOME

public static int PROTOCOL_SIGNATURES_REDIRECTABLE_SOME

PROTOCOL_SIGNATURES_REDIRECTABLE_NONE

public static int PROTOCOL_SIGNATURES_REDIRECTABLE_NONE

PLATFORM

public static java.lang.String PLATFORM

NO_OVERRIDE_FOR_ADD_ON_PACKAGE

public static java.lang.String NO_OVERRIDE_FOR_ADD_ON_PACKAGE
Constructor Detail

Policy

public Policy()
Policy Constructor.


Policy

public Policy(java.lang.String descriptionText)
Deprecated. use Policy()instead.

Parameters:
descriptionText -
Method Detail

fromStream

public void fromStream(java.io.BufferedReader in,
                       Formatter f)
                throws ImportExportException
Reading this object from a BufferedReader

Specified by:
fromStream in interface Formattable
Parameters:
in - the BufferedReader
f - the formatter used to read this object from the BufferedReader
Throws:
ImportExportException

getCalendarList

public CalendarArray getCalendarList()
Returns:

getToSMarkingArray

public ToSMarkingArray getToSMarkingArray()

getClassificationCfg

public ClassificationConfiguration getClassificationCfg()

getDetectorRepository

public com.cisco.scabb.client.ui.security.DetectorRepository getDetectorRepository()

getCustomNonPersistentProperties

public NotifyingProperties getCustomNonPersistentProperties()
Returns:

getDynamicSignatureScript

public DynamicSignaturesScript getDynamicSignatureScript()
Returns:

getLastApplyTimestamp

public long getLastApplyTimestamp()
Gets the timestamp of the time this Policy was successfully applied to any Policy Domain.

Returns:
the timestamp
See Also:
PolicyAPI

getListenersDataList

public com.pcube.apps.engage.management.PrimitiveList getListenersDataList()

getPackageList

public PackageArray getPackageList()
Gets this Policy's Package list. These Packages are the groups the subscribers belong to, and whose rules and regulations restrict the subscriber.

Returns:
this Policy's Package list

getAddOnTemplatesSize

public int getAddOnTemplatesSize()

getAddOnGroupList

public AddOnGroupArray getAddOnGroupList()

getPolicySettings

public PolicySettings getPolicySettings()
Gets this Policy's settings. These settings are general system settings for the SEs in this Policy's Policy Domain.

Returns:
this Policy's settings

getProtocolFamiliesManager

public ProtocolFamiliesManager getProtocolFamiliesManager()
use the ProtocolFamiliesManager to manage the policy's protocol families settings

Returns:

getProtocolList

public ProtocolList getProtocolList()
Gets this Policy's Protocol list. The Protocols in this list are reffered to by the Policy's Services.

Returns:
this Policy's Protocols list

getProtocolRedirectIndexNameArray

public ProtocolRedirectIndexNameArray getProtocolRedirectIndexNameArray()
Gets the list of the Protocols' redirect index names.

Returns:
the list of the Protocols' redirect index names

getProtocolRedirectString

public java.lang.String getProtocolRedirectString(java.lang.String protocolName,
                                                  int redirectIndex)
                                           throws ItemNotFoundException
Gets the redirect address for the Protocol in a certain index in its redirect String array. Redirection is part of the Protocol's specification, thus exists only for a few predefined Protocols.

Parameters:
protocolName - the queried Protocol
redirectIndex - the index in the redirect String array
Returns:
the redirect address
Throws:
ItemNotFoundException - if there is no such predefined Protocol in this Policy's ProtocolArray, or if the redirect index is out of bound

getProtocolRedirectParams

public com.pcube.apps.engage.management.RedirectSetParametersModel getProtocolRedirectParams(int redirectIndex)
Returns the object of the RedirectSetParametersModel. this Object should be used to set and get the specific parameters of the object. the index should be set according to the redirect String array

Parameters:
redirectIndex - the index in the redirect String array

getRealTimeFrameName

public java.lang.String getRealTimeFrameName(java.lang.String name)
                                      throws ItemNotFoundException
Gets the predefined API name for a certain TimeFrame.

Parameters:
name - this Policy's alias for the TimeFrame
Returns:
the TimeFrame's API name
Throws:
ItemNotFoundException - if there is no such alias in this Policy

getRealRuleFrameName

public java.lang.String getRealRuleFrameName(java.lang.String name)
                                      throws ItemNotFoundException
Throws:
ItemNotFoundException

getServiceList

public ServiceArray getServiceList()
Gets this Policy's Service list. These Services are referred to by this Policy's Package's Rules.

Returns:
this Policy's Service list

getSubscriberRedirectionArray

public SubscriberRedirectionArray getSubscriberRedirectionArray()
Returns:
Returns the subNotifications.

getSubNotifications

public SubNotificationArray getSubNotifications()
Deprecated. 

Returns:
Returns the subNotifications.

getTimeFrameNames

public java.lang.String[] getTimeFrameNames()
Gets the time frame names this Policy has assigned the different TimeFrames. These aliases are solely for convenience of meaningful namings. The returned String array keeps in index X the alias of the TimeFrame index X.

Returns:
the String array of this Policy's time frame names

getRuleFrameNames

public java.lang.String[] getRuleFrameNames()

getTimeSlotMatrix

public TimeSlotMatrix getTimeSlotMatrix()
Deprecated. use CalendarArray.getDefaultTimeSlotMatrix()

Gets this Policy's division of the week into time frames.

Returns:
the weekly time slot matrix

getProtocolRedirectString

public java.lang.String getProtocolRedirectString(java.lang.String protocolName)
                                           throws ItemNotFoundException
Gets the default redirect address for the Protocol. Redirection is part of the Protocol's specification, thus exists only for a few predefined Protocols.

Parameters:
protocolName - the queried Protocol
Returns:
the redirect address
Throws:
ItemNotFoundException - if there is no such predefined Protocol in this Policy's ProtocolArray

getZoneList

public ZoneList getZoneList()
Gets this Policy's IP, IP ranges and host lists array. These lists are reffered to by this Policy's Services.

Returns:
this Policy's array of lists

isProtocolRedirectable

public int isProtocolRedirectable(java.lang.String protocolName)
                           throws ItemNotFoundException
Checks if a specific Protocol supports redirecting. Redirection is part of the Protocol's specification, thus exists only for a few predefined Protocols.

Parameters:
protocolName - the queried Protocol's name
Returns:
true if the Protocol support redirection, false otherwise
Throws:
ItemNotFoundException - if there is no such predefined Protocol in this Policy's ProtocolArray

setLastApplyTimestamp

public void setLastApplyTimestamp(long newLastApplyTimestamp)
Method setLastApplyTimestamp

Parameters:
newLastApplyTimestamp -

setPackageList

public void setPackageList(PackageArray list)
Method setPackageList

Parameters:
list -

setAddOnGroupsList

public void setAddOnGroupsList(AddOnGroupArray addOnGroupList)

setPolicySettings

public void setPolicySettings(PolicySettings settings)
Method setPolicySettings

Parameters:
settings -

setProtocolRedirectString

public void setProtocolRedirectString(java.lang.String protocolName,
                                      int redirectIndex,
                                      java.lang.String value)
                               throws ItemNotFoundException,
                                      java.net.MalformedURLException
Sets the address to redirect a certain flow to. The redirect occurs when a Rule has a ACCESS_BLOCK_AND_REDIRECT access mode for a certain Service which uses the desired Protocol. The setting is done to a certain String in the redirect String array. The Rule chooses which redirect String to use from the redirect String array.

Parameters:
protocolName - the desired Protocol whose activity is to be redirected
redirectIndex - the redirect String index in the Protocol's redirect String array
value - the Protocol's new redirect address
Throws:
ItemNotFoundException - if there is no such predefined Protocol in this Policy's ProtocolArray, or if the redirect index is out of bound
java.net.MalformedURLException - if the string is an illegal URL name

setProtocolRedirectString

public void setProtocolRedirectString(java.lang.String protocolName,
                                      java.lang.String value)
                               throws ItemNotFoundException,
                                      java.net.MalformedURLException
Sets the default address to redirect a certain flow to. The redirect occurs when a Rule has a ACCESS_BLOCK_AND_REDIRECT access mode for a certain Service which uses the desired Protocol.

Parameters:
protocolName - the desired Protocol whose activity is to be redirected
value - the Protocol's new redirect address
Throws:
ItemNotFoundException - if there is no such predefined Protocol in this Policy's ProtocolArray
java.net.MalformedURLException - if the string is an illegal URL name

setServiceList

public void setServiceList(ServiceArray list)
Method setServiceList

Parameters:
list -

setSubNotifications

public void setSubNotifications(SubscriberRedirectionArray subNotifications)
Parameters:
SubscriberRedirectionArray - The conditionalRedirectNotificationsArray to set.

setTimeFrameName

public void setTimeFrameName(int index,
                             java.lang.String newName)
                      throws ItemNotFoundException,
                             DuplicateItemException
Sets an alias for the specific TimeFrame which has a certain index. The alias is solely for meaningful naming convenience.

Parameters:
index - the index of the TimeFrame to which the alias is given
newName - the alias
Throws:
ItemNotFoundException - if there is no such TimeFrame
DuplicateItemException

setTimeFrameName

public void setTimeFrameName(TimeFrame frame,
                             java.lang.String newName)
                      throws ItemNotFoundException,
                             DuplicateItemException
Sets an alias for the specific TimeFrame. The alias is solely for meaningful naming convenience.

Parameters:
frame - the TimeFrame to which the alias is given
newName - the alias
Throws:
ItemNotFoundException - if there is no such TimeFrame
DuplicateItemException

setTimeFrameNames

public void setTimeFrameNames(java.lang.String[] newNames)
set the names of all time frames.

Parameters:
newNames -

setTimeSlotMatrix

public void setTimeSlotMatrix(TimeSlotMatrix newTimeSlotMatrix)
Deprecated. use CalendarArray.getDefaultTimeSlotMatrix()

Sets this Policy's time slot matrix. This matrix divides the week into different time frames, for which the Packages can define specific behavior for each Service.

Parameters:
newTimeSlotMatrix -

toStream

public void toStream(java.io.PrintStream out,
                     Formatter f)
Writing this object to a PrintStream

Specified by:
toStream in interface Formattable
Parameters:
out - the PrintStream
f - the formatter used to write this object

getAttackDetectorEnabled

public boolean getAttackDetectorEnabled()

setAttackDetectorEnabled

public void setAttackDetectorEnabled(boolean enable)

setDirty

public void setDirty(boolean dirty)

setPolicyModified

public void setPolicyModified()
Specified by:
setPolicyModified in interface IPolicyDirtyMarker

isMirroringAttached

public boolean isMirroringAttached()
Returns:
true if mirroring is attached to rule (pre or post) or in span detection.

updateDirty

public static void updateDirty(Policy policy,
                               boolean newDirty)
Parameters:
newDirty -

setDirty

public static void setDirty(Policy policy,
                            boolean dirty)
Add '*' to title if policy has changed

Parameters:
dirty -

getPolicyPqbFormatId

public float getPolicyPqbFormatId()

setUpgradeVersion

public void setUpgradeVersion(java.lang.String upgradeVersion)

getUpgradeVersion

public java.lang.String getUpgradeVersion()

getQuotaData

public QuotaData getQuotaData()
Returns:
Quota Data Model

setQuotaData

public void setQuotaData(QuotaData quotaData)
Method setQuotaData

Parameters:
quotaData -

setQuotaExternalType

public void setQuotaExternalType(QuotaExternalType type)
Set Quota External Type. is Gy or SCE Subscriber API

Parameters:
type -

refreshQuotaCfg

public void refreshQuotaCfg()
upon quota profile changed this method should be called.


setAllAttackFilterEnable

public void setAllAttackFilterEnable(boolean b)

isEnableAllAttackFilters

public boolean isEnableAllAttackFilters()

Cisco Systems, Inc.

Copyright © 2013 Cisco Systems, Inc. Confidential.