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, Serializable

public class Policy
extends Object
implements 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 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
          Maximum number of Packages the Policy can define
static int MAX_REDIRECT_STRING_ARRAY
          Maximum number of redirect strings per each redirectable Protocol
static int MAX_SERVICES
          Maximum number of Services the Policy can define
static int MAX_TIMEFRAMES
          Number of time frames the Policy defines
static String PLATFORM
           
static int PROTOCOL_SIGNATURES_REDIRECTABLE_ALL
           
static int PROTOCOL_SIGNATURES_REDIRECTABLE_NONE
           
static int PROTOCOL_SIGNATURES_REDIRECTABLE_SOME
           
 
Constructor Summary
Policy()
          Policy Constructor.
Policy(String descriptionText)
          Deprecated. use Policy()instead.
 
Method Summary
 void fromStream(BufferedReader in, Formatter f)
          Reading this object from a BufferedReader
 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.
 String getProtocolRedirectString(String protocolName)
          Gets the default redirect address for the Protocol.
 String getProtocolRedirectString(String protocolName, int redirectIndex)
          Gets the redirect address for the Protocol in a certain index in its redirect String array.
 QuotaData getQuotaData()
           
 String getRealTimeFrameName(String name)
          Gets the predefined API name for a certain TimeFrame.
 ServiceArray getServiceList()
          Gets this Policy's Service list.
 SubNotificationArray getSubNotifications()
          Deprecated.  
 SubscriberRedirectionArray getSubscriberRedirectionArray()
           
 String[] getTimeFrameNames()
          Gets the time frame names this Policy has assigned the different TimeFrames.
 TimeSlotMatrix getTimeSlotMatrix()
          Deprecated. use CalendarArray.getDefaultTimeSlotMatrix()
 ToSMarkingArray getToSMarkingArray()
           
 String getUpgradeVersion()
           
 ZoneList getZoneList()
          Gets this Policy's IP, IP ranges and host lists array.
 boolean isEnableAllAttackFilters()
           
 boolean isMirroringAttached()
           
 int isProtocolRedirectable(String protocolName)
          Checks if a specific Protocol supports redirecting.
 void refreshQuotaCfg()
          upon quota profile changed this method should be called.
 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(String protocolName, int redirectIndex, String value)
          Sets the address to redirect a certain flow to.
 void setProtocolRedirectString(String protocolName, String value)
          Sets the default address to redirect a certain flow to.
 void setQuotaExternalType(QuotaExternalType type)
          Set Quota External Type.
 void setServiceList(ServiceArray list)
          Method setServiceList
 void setSubNotifications(SubscriberRedirectionArray subNotifications)
           
 void setTimeFrameName(int index, String newName)
          Sets an alias for the specific TimeFrame which has a certain index.
 void setTimeFrameName(TimeFrame frame, String newName)
          Sets an alias for the specific TimeFrame.
 void setTimeFrameNames(String[] newNames)
          set the names of all time frames.
 void setTimeSlotMatrix(TimeSlotMatrix newTimeSlotMatrix)
          Deprecated. use CalendarArray.getDefaultTimeSlotMatrix()
 void setUpgradeVersion(String upgradeVersion)
           
 void toStream(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_PACKAGES

public static int MAX_PACKAGES
Maximum number of Packages the Policy can define


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


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 String PLATFORM
Constructor Detail

Policy

public Policy()
Policy Constructor.


Policy

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

Parameters:
descriptionText -
Method Detail

fromStream

public void fromStream(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

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 String getProtocolRedirectString(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 String getRealTimeFrameName(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

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 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

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 String getProtocolRedirectString(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(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 -

setPolicySettings

public void setPolicySettings(PolicySettings settings)
Method setPolicySettings

Parameters:
settings -

setProtocolRedirectString

public void setProtocolRedirectString(String protocolName,
                                      int redirectIndex,
                                      String value)
                               throws ItemNotFoundException,
                                      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
MalformedURLException - if the string is an illegal URL name

setProtocolRedirectString

public void setProtocolRedirectString(String protocolName,
                                      String value)
                               throws ItemNotFoundException,
                                      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
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,
                             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,
                             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(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(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(String upgradeVersion)

getUpgradeVersion

public String getUpgradeVersion()

getQuotaData

public QuotaData getQuotaData()
Returns:
Quota Data Model

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 © 2011 Cisco Systems, Inc. Confidential.