مشاركة عبر


PolicyStore Class

The PolicyStore type is the root of the DMF object model.

Inheritance Hierarchy

System.Object
  Microsoft.SqlServer.Management.Sdk.Sfc.SfcInstance
    Microsoft.SqlServer.Management.Dmf.PolicyStore

Namespace:  Microsoft.SqlServer.Management.Dmf
Assembly:  Microsoft.SqlServer.Dmf (in Microsoft.SqlServer.Dmf.dll)

Syntax

'Declaration
<TypeConverterAttribute(GetType(LocalizableTypeConverter))> _
<StrongNameIdentityPermissionAttribute(SecurityAction.LinkDemand, PublicKey := "0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8")> _
Public NotInheritable Class PolicyStore _
    Inherits SfcInstance _
    Implements ISfcAlterable, IAlterable, ISfcDomain, ISfcDomainLite,  _
    ISfcHasConnection, ISfcSerializableUpgrade, ISfcValidate
'Usage
Dim instance As PolicyStore
[TypeConverterAttribute(typeof(LocalizableTypeConverter))]
[StrongNameIdentityPermissionAttribute(SecurityAction.LinkDemand, PublicKey = "0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8")]
public sealed class PolicyStore : SfcInstance, 
    ISfcAlterable, IAlterable, ISfcDomain, ISfcDomainLite, ISfcHasConnection, 
    ISfcSerializableUpgrade, ISfcValidate
[TypeConverterAttribute(typeof(LocalizableTypeConverter))]
[StrongNameIdentityPermissionAttribute(SecurityAction::LinkDemand, PublicKey = L"0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8")]
public ref class PolicyStore sealed : public SfcInstance, 
    ISfcAlterable, IAlterable, ISfcDomain, ISfcDomainLite, ISfcHasConnection, 
    ISfcSerializableUpgrade, ISfcValidate
[<SealedAttribute>]
[<TypeConverterAttribute(typeof(LocalizableTypeConverter))>]
[<StrongNameIdentityPermissionAttribute(SecurityAction.LinkDemand, PublicKey = "0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8")>]
type PolicyStore =  
    class 
        inherit SfcInstance 
        interface ISfcAlterable 
        interface IAlterable 
        interface ISfcDomain 
        interface ISfcDomainLite 
        interface ISfcHasConnection 
        interface ISfcSerializableUpgrade 
        interface ISfcValidate 
    end
public final class PolicyStore extends SfcInstance implements ISfcAlterable, IAlterable, ISfcDomain, ISfcDomainLite, ISfcHasConnection, ISfcSerializableUpgrade, ISfcValidate

The PolicyStore type exposes the following members.

Constructors

  Name Description
Public method PolicyStore() Initializes a new instance of the PolicyStore class.
Public method PolicyStore(SfcConnection) Initializes a new instance of the PolicyStore class.

Top

Properties

  Name Description
Protected property AbstractIdentityKey Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SfcInstance.)
Public property Conditions Represents a collection of Condition objects. Each Condition object represents a policy-based Management condition.
Public property Enabled Gets or sets whether the policy store is enabled.
Public propertyStatic member Facets Represents a collection of FacetInfo objects. Each FacetInfo object represents a policy-based Management registered facet.
Public property HistoryRetentionInDays Gets or sets the number of days the policy store retains history.
Public property IdentityKey Gets the identity key.
Public property LogOnSuccess Gets or sets whether log-on succeeded.
Public property Metadata Returns metadata about the instance and its domain. (Inherited from SfcInstance.)
Public property Name Gets the name of the policy store.
Public property ObjectSets Represents a collection of ObjectSet objects. Each ObjectSet object represents a policy-based Management object set.
Public property Parent Gets or sets the instance parent via the keychain. (Inherited from SfcInstance.)
Public property Policies Represents a collection of Policy objects. Each Policy object represents a policy-based Management policy.
Public property PolicyCategories Represents a collection of PolicyCategory objects. Each PolicyCategory object represents a policy-based Management policy category.
Public property PolicyCategorySubscriptions Represents a collection of PolicyCategorySubscription objects. Each PolicyCategorySubscription object represents a policy-based Management policy category subscription.
Public property Properties Returns a collection instance properties. (Inherited from SfcInstance.)
Public property SqlStoreConnection Gets or sets the SqlStoreConnection object.
Protected property State Returns the state of the SfcInstance object. (Inherited from SfcInstance.)
Public property Urn Returns the uniform resource name of the SfcInstance object. (Inherited from SfcInstance.)

Top

Methods

  Name Description
Public method Alter Alters a previously created PolicyStore object.
Protected method CreateIdentityKey Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SfcInstance.)
Public method CreatePolicyFromFacet(SfcQueryExpression, String, String, String) Creates new policy from an SfcQueryExpression object and names.
Public method CreatePolicyFromFacet(Object, String, String, String, XmlWriter) Creates new policy from an Object and an XmlWriter object.
Public method CreatePolicyFromFacet(SfcQueryExpression, String, String, String, XmlWriter) Creates new policy from an SfcQueryExpression object and an XmlWriter object.
Public method DeserializePolicy Deserializes a single policy and its associated condition from the specified XML reader into the policy store.
Public method Discover Discovers dependency relationships for the specified sink. (Overrides SfcInstance.Discover(ISfcDependencyDiscoveryObjectSink).)
Public method EnumApplicablePolicies Enumerates policy items specified by an SfcQueryExpression object.
Public method EnumApplicablePolicyCategories Enumerates conditions specified by an SfcQueryExpression object.
Public method EnumConditionsOnFacet(String) Returns a list of conditions that are associated with the specified facet.
Public method EnumConditionsOnFacet(String, PolicyStore.EnumerationMode) Enumerates a StringCollection of conditions.
Public methodStatic member EnumDomainFacets Enumerates facets in a domain.
Public method EnumPoliciesOnFacet(String) Returns a list of policies associated with the specified facet.
Public method EnumPoliciesOnFacet(String, PolicyStore.EnumerationMode) Enumerates policy items on a facet.
Public method EnumPolicyCategories Returns an enumerated list of policy category information.
Public method EnumRootConditions Returns a list of root conditions for the specified type.
Public methodStatic member EnumRootFacets Returns a list of root facets for the specified type.
Public method EnumTargetSetConditions(Type) Returns a list of target set conditions for the specified type.
Public method EnumTargetSetConditions(Type, PolicyStore.EnumerationMode) Enumerates conditions on the target.
Public method Equals (Inherited from Object.)
Public method EraseSystemHealthPhantomRecords Deletes system health phantom records specified by a SfcQueryExpression.
Public method GetAggregatedHealthState Deletes system health phantom records specified by a SfcQueryExpression.
Protected method GetChildCollection Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SfcInstance.)
Public method GetDomain Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SfcInstance.)
Public method GetHashCode (Inherited from Object.)
Public method GetPropertySet Returns the set of properties for the SfcInstance object. (Inherited from SfcInstance.)
Public method GetType (Inherited from Object.)
Protected method GetTypeMetadataImpl Indicates the domains that override by returning the right TypeMetadata class directly. Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SfcInstance.)
Public method ImportPolicy Imports a single policy and its associated condition from the given XML reader into the policy store.
Protected method InitializeUIPropertyState Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SfcInstance.)
Public method MarkSystemObject Sets the name of a Policy, Condition, or ObjectSet.
Protected method OnPropertyMetadataChanges Invoked whenever the effective value of any SfcInstance metadata is updated. (Inherited from SfcInstance.)
Protected method OnPropertyValueChanges Invoked whenever the effective value of any SfcInstance property is updated. (Inherited from SfcInstance.)
Public method PurgeHealthState() Removes the health data for a specified tree/subtree.
Public method PurgeHealthState(SfcQueryExpression) Removes the health data for a specified tree/subtree.
Public method Refresh Refreshes the object's properties by reading them from the server. (Inherited from SfcInstance.)
Public method RepairPolicyAutomation The RepairPolicyAutomation method recreates all necessary artifacts for all automated policies.
Protected method ResetKey Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SfcInstance.)
Public method ScriptAlter Alters the script associated with this policy store.
Public method Serialize Serializes the instance to XML. (Inherited from SfcInstance.)
Public method StartSerializationUpgrade Starts a serialization upgrade.
Public method SubscribeToPolicyCategory Subscribes the policy store to the category specified by the policyCategory and target parameters.
Public method ToString Returns the PolicyStore object as a string value. (Overrides SfcInstance.ToString().)
Public method UnsubscribeFromPolicyCategory Unsubscribes the policy store from the category specified by the policyCategory and target parameters.

Top

Events

  Name Description
Public event PropertyChanged CLS-compliant event for property changes. (Inherited from SfcInstance.)
Public event PropertyMetadataChanged CLS-compliant event for property metadata changes. (Inherited from SfcInstance.)

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method ISfcDomain.GetExecutionEngine Gets a new ISfcExecutionEngine object.
Explicit interface implemetationPrivate method ISfcDomain.GetKey Gets a new SfcKey of type determined by the name property of urnFragment parameter.
Explicit interface implemetationPrivate method ISfcDomain.GetType Gets a Type object specified by the typeName parameter.
Explicit interface implemetationPrivate method ISfcDomain.GetTypeMetadata Gets a T:Microsoft.SqlServer.Management.Sdk.Sfc.SfcTypeMetadata object identified by the typeName parameter.
Explicit interface implemetationPrivate method ISfcDomain.UseSfcStateManagement Use the SFC state management to return true.
Explicit interface implemetationPrivate property ISfcDomainLite.DomainInstanceName Gets the name of the domain instance.
Explicit interface implemetationPrivate property ISfcDomainLite.DomainName Gets the domain name.
Explicit interface implemetationPrivate method ISfcDomainLite.GetLogicalVersion Indicates the logical version to get in the domain.
Explicit interface implemetationPrivate property ISfcHasConnection.ConnectionContext Gets the connection context.
Explicit interface implemetationPrivate method ISfcHasConnection.GetConnection() Indicates the connection to get.
Explicit interface implemetationPrivate method ISfcHasConnection.GetConnection(SfcObjectQueryMode) Indicates the connection to get using the SfcObjectQuery mode.
Explicit interface implemetationPrivate method ISfcHasConnection.SetConnection Indicates the connection to set.
Explicit interface implemetationPrivate method ISfcValidate.Validate Validates the Policy objects in the PolicyStore.

Top

Remarks

Using the PolicyStore object you can:

  • Hold a connection to the whole object model.

  • Access the collection of policies, conditions, policy groups, subscriptions and facets that are immediate children of the PolicyStore object.

  • Review the policy execution history.

  • Review applicable policies for a given target type.

  • Subscribe to policies.

  • Serialize and deserialize policies.

  • Create a policy from a facet.

Note

The PolicyStore class implements ISfcDomain, which specifies the connection point to any object domain defined using the Microsoft SFC.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.SqlServer.Management.Dmf Namespace