Policy Class

Definition

This is the non-generated part of the Policy class.

public sealed class Policy : Microsoft.SqlServer.Management.Sdk.Sfc.SfcInstance, Microsoft.SqlServer.Management.Common.IAlterable, Microsoft.SqlServer.Management.Common.ICreatable, Microsoft.SqlServer.Management.Common.IDroppable, Microsoft.SqlServer.Management.Common.IRenamable, Microsoft.SqlServer.Management.Sdk.Sfc.ISfcAlterable, Microsoft.SqlServer.Management.Sdk.Sfc.ISfcCreatable, Microsoft.SqlServer.Management.Sdk.Sfc.ISfcDroppable, Microsoft.SqlServer.Management.Sdk.Sfc.ISfcRenamable, Microsoft.SqlServer.Management.Sdk.Sfc.ISfcValidate
type Policy = class
    inherit SfcInstance
    interface ISfcCreatable
    interface ICreatable
    interface ISfcDroppable
    interface IDroppable
    interface ISfcAlterable
    interface IAlterable
    interface ISfcRenamable
    interface IRenamable
    interface ISfcValidate
Public NotInheritable Class Policy
Inherits SfcInstance
Implements IAlterable, ICreatable, IDroppable, IRenamable, ISfcAlterable, ISfcCreatable, ISfcDroppable, ISfcRenamable, ISfcValidate
Inheritance
Implements

Constructors

Policy()

Default constructor used for deserialization. VSTS 55852.

Policy(PolicyStore, String)

Instantiates a new Policy object.

Fields

HelpLinkStringMaxLength

Limit on the length of HelpLink property. Note that this is the max hyperlink length accepted by IE.

HelpTextStringMaxLength

Limit on the length of HelpText property specified by user.

Properties

AbstractIdentityKey (Inherited from SfcInstance)
AutomatedPolicyEvaluationMode
CategoryId
Condition
CreateDate
CreatedBy
DateModified
Description
Enabled
EvaluationHistories
HasScript

Shows if any of the conditions referenced by this policy references a t-sql or wql script

HelpLink
HelpText
ID
IdentityKey
IsSystemObject
KeyChain

Returns the identity path of the object

(Inherited from SfcInstance)
Metadata (Inherited from SfcInstance)
ModifiedBy
Name
ObjectSet
Parent
PolicyCategory
Properties (Inherited from SfcInstance)
PropertyStorageProvider

This property returns the default implementation of SFC for ISfcPropertyStorageProvider interface, it can be overriden in the child classes to return another storage provider (i.e. flat properties list)

(Inherited from SfcInstance)
RootCondition
ScheduleUid
State (Inherited from SfcInstance)
Urn

Create a new Urn string on each request and return it.

(Inherited from SfcInstance)

Methods

Alter()

Persists all changes made to this object.

AlterImpl() (Inherited from SfcInstance)
CheckObjectCreated()

To be called from domain for when an API requires the object to be Created Stronger than CheckObjectState

(Inherited from SfcInstance)
CheckObjectState()

To be called from domain for any access to the object

(Inherited from SfcInstance)
Create()

Creates the object on the server.

CreateIdentityKey() (Inherited from SfcInstance)
CreateImpl() (Inherited from SfcInstance)
Discover(ISfcDependencyDiscoveryObjectSink)
Drop()

Drops the object and removes it from the collection.

DropImpl() (Inherited from SfcInstance)
Evaluate(AdHocPolicyEvaluationMode, ISfcConnection[])
Evaluate(AdHocPolicyEvaluationMode, Object[])
Evaluate(AdHocPolicyEvaluationMode, SfcQueryExpression, ISfcConnection[])
GetChildCollection(String)

Get the child collection in this instance for the given element name string.

(Inherited from SfcInstance)
GetDomain() (Inherited from SfcInstance)
GetObjectFactory()
GetPropertySet() (Inherited from SfcInstance)
GetTypeMetadataImpl() (Inherited from SfcInstance)
InitializeUIPropertyState()

Overridable from the child objects who care about initializing their states (dynamic metadata which is currently the ".Enabled" property)

(Inherited from SfcInstance)
MarkForDropImpl(Boolean) (Inherited from SfcInstance)
MarkRootAsConnected() (Inherited from SfcInstance)
MoveImpl(SfcInstance) (Inherited from SfcInstance)
OnPropertyMetadataChanges(SfcPropertyMetadataChangedEventArgs) (Inherited from SfcInstance)
OnPropertyValueChanges(PropertyChangedEventArgs) (Inherited from SfcInstance)
PostAlter(Object) (Inherited from SfcInstance)
PostCreate(Object) (Inherited from SfcInstance)
PostDrop(Object) (Inherited from SfcInstance)
PostMove(Object) (Inherited from SfcInstance)
PostRename(Object) (Inherited from SfcInstance)
ProduceConfigureScript(Object)
Refresh()

refreshes the object's properties by reading them from the server

(Inherited from SfcInstance)
Rename(String)

Renames the object on the server.

RenameImpl(SfcKey) (Inherited from SfcInstance)
ResetKey() (Inherited from SfcInstance)
ScriptAlter()

Scripts all changes made to this object.

ScriptAlterWithObjectSet()

Scripts Alter Policy with dependent ObjectSet. Doesn't include referenced Conditions.

ScriptCreate()

Scripts creation of the object on the server.

ScriptCreateWithDependencies()

Scripts Create Policy with all dependencies, including ObjectSet and all referenced Conditions

ScriptCreateWithObjectSet()

Scripts Create Policy with dependent ObjectSet. Doesn't include referenced Conditions.

ScriptDrop()

Scripts deletion of the object

ScriptDropWithObjectSet()

Scripts Drop Policy with dependent ObjectSet. Doesn't include referenced Conditions.

Serialize(XmlWriter) (Inherited from SfcInstance)
ToString() (Inherited from SfcInstance)
UpdateUIPropertyState() (Inherited from SfcInstance)
UsesFacet(String)

Returns a boolean indicating if this policy's Condition uses the given facet.

Validate()

Basic child object's validation

(Inherited from SfcInstance)
Validate(String)

Policy validation Unlike ISfcValidate.Validate, this method will throw the first exception it encounters If Evaluation of this method doesn't produce any exceptions, validation passed

Events

ConnectionProcessingFinished

Event that gets fired after the policy execution has ended.

ConnectionProcessingStarted

Event fired before the policy execution starts for one connection.

PolicyEvaluationFinished

Event that gets fired after the policy execution has ended.

PolicyEvaluationStarted

Event fired before the policy execution starts.

propertyChanged (Inherited from SfcInstance)
PropertyChanged (Inherited from SfcInstance)
propertyMetadataChanged (Inherited from SfcInstance)
PropertyMetadataChanged (Inherited from SfcInstance)
TargetProcessed

Event fired after a target has been processed.

Explicit Interface Implementations

ISfcRenamable.Rename(SfcKey)

Renames the object on the server.

ISfcRenamable.ScriptRename(SfcKey)
ISfcValidate.Validate(String, Object[])

ISfcValidate implementation for Policy

Applies to