Cisco Systems, Inc.

com.pcube.apps.engage
Class PolicyAPI

java.lang.Object
  extended by com.pcube.apps.engage.PolicyAPI

public class PolicyAPI
extends java.lang.Object

PolicyAPI exposes Policy API functions . All of these functions get/set data located in the SE, therefore require being connected to the SE device.

See Also:
Engage

Field Summary
static int DC_DEFAULT_RPC_PORT
          Comment for DC_DEFAULT_RPC_PORT
static int DC_UPDATE_METHOD_RPC
          Comment for DC_UPDATE_METHOD_RPC
static boolean isFlavorsAllowedInAsymmetric
           
static int MAX_PORT_BASED_FILTERS
           
static int MAX_PORT_BASED_FILTERS_10K
           
 
Method Summary
static long applyIncrementalPolicy(Connection connection, Policy policy, Policy retrievedPolicy, java.util.Properties applySettings, java.lang.String msgPrefix)
           
static long applyPolicy(Connection connection, Policy newPolicy)
          Applies the Service Configuration to the sepecified SE.
static long applyPolicy(Connection connection, Policy newPolicy, boolean updateDc, java.util.Properties dcIpRemap, int dcUpdateMethod, boolean isPqbSaveReqd, int rpcPort, boolean forceTemplateVirtualLinkValues)
           
static long applyPolicy(Connection connection, Policy newPolicy, boolean updateDc, java.util.Properties dcIpRemap, int dcUpdateMethod, int rpcPort)
          Applies the Service Configuration to the sepecified SE.
static long applyPolicy(Connection connection, Policy newPolicy, boolean updateDc, java.util.Properties dcIpRemap, int dcUpdateMethod, int rpcPort, boolean forceTemplateVirtualLinkValues)
          Applies the Service Configuration to the sepecified SE.
static long applyPolicy(Connection connection, Policy newPolicy, byte applyFlag)
          Deprecated. use applyPolicy(Connection, Policy)instead
static long applyPolicy(Connection connection, Policy policy, java.util.Properties applySettings)
           
static long applyPolicy(Connection connection, Policy policy, java.util.Properties applySettings, java.lang.String msgPrefix)
           
static Policy loadDefaultPolicy()
           
static Policy loadDefaultSplitFlowPolicy()
           
static Policy loadPolicy(java.io.File pqbfile)
          load service configuration from a .pqb file
static Policy retrievePolicy(Connection connection)
          Retrieving the Service Configuration.
static void savePolicy(Policy policy, java.io.File pqbfile)
          save a service configuration to a .pqb file
static void setAsymmetricFlavorMode(boolean asymmetricFlavorMode)
          This method been used during the preference confirmation dialog to validate the policies
static Policy synchronizedRetrievePolicy(Connection connection)
          Retrieving the Service Configuration.
static void updateValuesIni(java.lang.String dcAddress, java.lang.String seAddress, Policy policy)
          Updating the DC with the SE device's policy data (values ini).
static void updateValuesIni(java.lang.String dcAddress, java.lang.String seAddress, Policy policy, int dcUpdateMethod, int rpcPort)
          Updating the DC with the SE device's policy data (values ini).
static java.util.ArrayList validatePolicy(Policy policy)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DC_UPDATE_METHOD_RPC

public static final int DC_UPDATE_METHOD_RPC
Comment for DC_UPDATE_METHOD_RPC

See Also:
Constant Field Values

DC_DEFAULT_RPC_PORT

public static final int DC_DEFAULT_RPC_PORT
Comment for DC_DEFAULT_RPC_PORT

See Also:
Constant Field Values

MAX_PORT_BASED_FILTERS

public static int MAX_PORT_BASED_FILTERS

MAX_PORT_BASED_FILTERS_10K

public static int MAX_PORT_BASED_FILTERS_10K

isFlavorsAllowedInAsymmetric

public static boolean isFlavorsAllowedInAsymmetric
Method Detail

applyPolicy

public static long applyPolicy(Connection connection,
                               Policy newPolicy)
                        throws ElementManagementException,
                               ApplyException,
                               IncompatibleLicenseException
Applies the Service Configuration to the sepecified SE.

Parameters:
connection - the Connection which keeps a handle to the connection to the SE
newPolicy - the Policy to apply
Returns:
@see Engage#APPLY_FLAG_OVERWRITE
Throws:
ElementManagementException
ApplyException
IncompatibleLicenseException
See Also:
Engage.APPLY_FLAG_NO_OVERWRITE

applyPolicy

public static long applyPolicy(Connection connection,
                               Policy policy,
                               java.util.Properties applySettings)
                        throws ElementManagementException,
                               ApplyException,
                               IncompatibleLicenseException
Throws:
ElementManagementException
ApplyException
IncompatibleLicenseException

applyPolicy

public static long applyPolicy(Connection connection,
                               Policy policy,
                               java.util.Properties applySettings,
                               java.lang.String msgPrefix)
                        throws ElementManagementException,
                               ApplyException,
                               IncompatibleLicenseException
Throws:
ElementManagementException
ApplyException
IncompatibleLicenseException

applyIncrementalPolicy

public static long applyIncrementalPolicy(Connection connection,
                                          Policy policy,
                                          Policy retrievedPolicy,
                                          java.util.Properties applySettings,
                                          java.lang.String msgPrefix)
                                   throws ElementManagementException,
                                          ApplyException,
                                          IncompatibleLicenseException
Throws:
ElementManagementException
ApplyException
IncompatibleLicenseException

applyPolicy

public static long applyPolicy(Connection connection,
                               Policy newPolicy,
                               boolean updateDc,
                               java.util.Properties dcIpRemap,
                               int dcUpdateMethod,
                               int rpcPort)
                        throws ElementManagementException,
                               ApplyException,
                               IncompatibleLicenseException
Applies the Service Configuration to the sepecified SE.

Parameters:
connection - the Connection which keeps a handle to the connection to the SE
newPolicy - the Policy to apply
updateDc - whether the DC for the specified SE should be updated with the specified service configuration values
dcIpRemap - a map from DC IP address as configured in the SE, to actual D addresses
dcUpdateMethod - which method should be used to connect to the DC
rpcPort - port number for DC RPC connection
Returns:
operation timestamp
Throws:
ElementManagementException
ApplyException
IncompatibleLicenseException
See Also:
DC_UPDATE_METHOD_RPC, #DC_UPDATE_METHOD_SQL, DC_DEFAULT_RPC_PORT

applyPolicy

public static long applyPolicy(Connection connection,
                               Policy newPolicy,
                               boolean updateDc,
                               java.util.Properties dcIpRemap,
                               int dcUpdateMethod,
                               int rpcPort,
                               boolean forceTemplateVirtualLinkValues)
                        throws ElementManagementException,
                               ApplyException,
                               IncompatibleLicenseException
Applies the Service Configuration to the sepecified SE.

Parameters:
connection - the Connection which keeps a handle to the connection to the SE
newPolicy - the Policy to apply
updateDc - whether the DC for the specified SE should be updated with the specified service configuration values
dcIpRemap - a map from DC IP address as configured in the SE, to actual D addresses
dcUpdateMethod - which method should be used to connect to the DC
rpcPort - port number for DC RPC connection
forceTemplateVirtualLinkValues - for Virtual Links mode Policy, whether to force configure the values of the template Virtual Link for the virtual links defined in the applied SCE
Returns:
operation timestamp
Throws:
ElementManagementException
ApplyException
IncompatibleLicenseException
See Also:
DC_UPDATE_METHOD_RPC, #DC_UPDATE_METHOD_SQL, DC_DEFAULT_RPC_PORT

applyPolicy

public static long applyPolicy(Connection connection,
                               Policy newPolicy,
                               boolean updateDc,
                               java.util.Properties dcIpRemap,
                               int dcUpdateMethod,
                               boolean isPqbSaveReqd,
                               int rpcPort,
                               boolean forceTemplateVirtualLinkValues)
                        throws ElementManagementException,
                               ApplyException,
                               IncompatibleLicenseException
Throws:
ElementManagementException
ApplyException
IncompatibleLicenseException

applyPolicy

public static long applyPolicy(Connection connection,
                               Policy newPolicy,
                               byte applyFlag)
                        throws ElementManagementException,
                               ApplyException,
                               IncompatibleLicenseException,
                               java.io.IOException
Deprecated. use applyPolicy(Connection, Policy)instead

Applying the Service Configuration

Parameters:
connection - the Connection which keeps a handle to the connection to the SE
newPolicy - the Policy to apply
applyFlag - the flag stating if the apply should overwrite previously applied Policies.
Returns:
@see Engage#APPLY_FLAG_OVERWRITE
Throws:
ElementManagementException
ApplyException
IncompatibleLicenseException
java.io.IOException
See Also:
Engage.APPLY_FLAG_NO_OVERWRITE

synchronizedRetrievePolicy

public static Policy synchronizedRetrievePolicy(Connection connection)
                                         throws java.io.IOException,
                                                ElementManagementException,
                                                ApplyException
Retrieving the Service Configuration.

Parameters:
connection - the Connection which keeps a handle to the connection to the SE
Returns:
the Policy in the SE device
Throws:
java.io.IOException
ElementManagementException
ApplyException

retrievePolicy

public static Policy retrievePolicy(Connection connection)
                             throws java.io.IOException,
                                    ElementManagementException,
                                    ApplyException
Retrieving the Service Configuration.

Parameters:
connection - the Connection which keeps a handle to the connection to the SE
Returns:
the Policy in the SE device
Throws:
java.io.IOException
ElementManagementException
ApplyException

updateValuesIni

public static void updateValuesIni(java.lang.String dcAddress,
                                   java.lang.String seAddress,
                                   Policy policy)
                            throws ApplyException
Updating the DC with the SE device's policy data (values ini).

Parameters:
dcAddress - the address of the DC to update
seAddress - the address of the SE device who enforces the given Policy
policy - the Policy
Throws:
ApplyException

updateValuesIni

public static void updateValuesIni(java.lang.String dcAddress,
                                   java.lang.String seAddress,
                                   Policy policy,
                                   int dcUpdateMethod,
                                   int rpcPort)
                            throws ApplyException
Updating the DC with the SE device's policy data (values ini).

Parameters:
dcAddress - the address of the DC to update
seAddress - the address of the SE device who enforces the given Policy
policy - the Policy
dcUpdateMethod -
rpcPort -
Throws:
ApplyException

validatePolicy

public static java.util.ArrayList validatePolicy(Policy policy)
Parameters:
policy -
Returns:

loadPolicy

public static Policy loadPolicy(java.io.File pqbfile)
                         throws ImportExportException,
                                java.io.IOException
load service configuration from a .pqb file

Parameters:
pqbfile -
Returns:
Throws:
ImportExportException
java.io.IOException

savePolicy

public static void savePolicy(Policy policy,
                              java.io.File pqbfile)
                       throws java.io.FileNotFoundException,
                              ImportExportException
save a service configuration to a .pqb file

Parameters:
pqbfile -
Throws:
ImportExportException
java.io.FileNotFoundException
ImportExportException
java.io.IOException

loadDefaultPolicy

public static Policy loadDefaultPolicy()
                                throws ImportExportException
Returns:
the default service configuration
Throws:
ImportExportException

loadDefaultSplitFlowPolicy

public static Policy loadDefaultSplitFlowPolicy()
                                         throws ImportExportException
Throws:
ImportExportException

setAsymmetricFlavorMode

public static void setAsymmetricFlavorMode(boolean asymmetricFlavorMode)
This method been used during the preference confirmation dialog to validate the policies

Parameters:
asymmetricFlavorMode -

Cisco Systems, Inc.

Copyright © 2013 Cisco Systems, Inc. Confidential.