Partager via


Classe PolicyCategory

Represents a category that classifies policies in SQL Server Policy-Based Management. Policy Categories are used to group policies together to which target objects can subscribe.

Hiérarchie d'héritage

System. . :: . .Object
  Microsoft.SqlServer.Management.Sdk.Sfc. . :: . .SfcInstance
    Microsoft.SqlServer.Management.Dmf..::..PolicyCategory

Espace de noms :  Microsoft.SqlServer.Management.Dmf
Assembly :  Microsoft.SqlServer.Dmf (en Microsoft.SqlServer.Dmf.dll)

Syntaxe

'Déclaration
<StrongNameIdentityPermissionAttribute(SecurityAction.LinkDemand, PublicKey := "0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8")> _
Public NotInheritable Class PolicyCategory _
    Inherits SfcInstance _
    Implements ISfcCreatable, ICreatable, ISfcDroppable, IDroppable,  _
    ISfcAlterable, IAlterable, ISfcRenamable, IRenamable
'Utilisation
Dim instance As PolicyCategory
[StrongNameIdentityPermissionAttribute(SecurityAction.LinkDemand, PublicKey = "0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8")]
public sealed class PolicyCategory : SfcInstance, 
    ISfcCreatable, ICreatable, ISfcDroppable, IDroppable, ISfcAlterable, 
    IAlterable, ISfcRenamable, IRenamable
[StrongNameIdentityPermissionAttribute(SecurityAction::LinkDemand, PublicKey = L"0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8")]
public ref class PolicyCategory sealed : public SfcInstance, 
    ISfcCreatable, ICreatable, ISfcDroppable, IDroppable, ISfcAlterable, 
    IAlterable, ISfcRenamable, IRenamable
[<SealedAttribute>]
[<StrongNameIdentityPermissionAttribute(SecurityAction.LinkDemand, PublicKey = "0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8")>]
type PolicyCategory =  
    class
        inherit SfcInstance
        interface ISfcCreatable
        interface ICreatable
        interface ISfcDroppable
        interface IDroppable
        interface ISfcAlterable
        interface IAlterable
        interface ISfcRenamable
        interface IRenamable
    end
public final class PolicyCategory extends SfcInstance implements ISfcCreatable, ICreatable, ISfcDroppable, IDroppable, ISfcAlterable, IAlterable, ISfcRenamable, IRenamable

Le type PolicyCategory expose les membres suivants.

Constructeurs

  Nom Description
Méthode publique PolicyCategory() () () () Initializes a new instance of the PolicyCategory class.
Méthode publique PolicyCategory(PolicyStore, String) Initializes a new instance of the PolicyCategory class.

Haut de la page

Propriétés

  Nom Description
Propriété protégée AbstractIdentityKey Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Propriété publiqueMembre statique DefaultCategory Gets the category to which the policy is assigned by default.
Propriété publique ID Gets the ID value that uniquely identifies the policy category.
Propriété publique IdentityKey Gets the key that uniquely identifies the policy category.
Propriété publique MandateDatabaseSubscriptions Gets or sets the Boolean value that determines whether the database subscriptions are permitted.
Propriété publique Metadata Returns metadata about the instance and its domain. (hérité de SfcInstance.)
Propriété publique Name Gets the name of the policy category.
Propriété publique Parent Gets or sets the parent instance via the keychain.
Propriété publique Properties Returns a collection instance properties. (hérité de SfcInstance.)
Propriété protégée PropertyStorageProvider Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Propriété protégée State Returns the state of the SfcInstance object. (hérité de SfcInstance.)
Propriété publique Urn Returns the uniform resource name of the SfcInstance object. (hérité de SfcInstance.)

Haut de la page

Méthodes

  Nom Description
Méthode publique Alter Updates any PolicyCategory object property changes on the instance of SQL Server.
Méthode protégée AlterImpl Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode protégée CheckObjectCreated Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode protégée CheckObjectState Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode publique Create Creates a category for the PolicyCategory class.
Méthode protégée CreateIdentityKey Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode protégée CreateImpl Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode publique Discover Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode publique Drop Removes the policy category from the instance of SQL Server.
Méthode protégée DropImpl Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode publique Equals (hérité de Object.)
Méthode protégée Finalize (hérité de Object.)
Méthode protégée GetChildCollection Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode publique GetDomain Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode publique GetHashCode (hérité de Object.)
Méthode publiqueMembre statique GetObjectFactory Gets the object factory for the object.
Méthode publique GetPropertySet Returns the set of properties for the SfcInstance object. (hérité de SfcInstance.)
Méthode publique GetType (hérité de Object.)
Méthode protégée GetTypeMetadataImpl Indicates the domains that override by returning the right TypeMetadata class directly. Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode protégée InitializeUIPropertyState Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode protégée MarkForDropImpl Returns a value that indicates the existing objects to be dropped. Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode protégée MarkRootAsConnected Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode protégée MemberwiseClone (hérité de Object.)
Méthode protégée MoveImpl Indicates the new parent object to move in an instance. Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode protégée OnPropertyMetadataChanges Invoked whenever the effective value of any SfcInstance metadata is updated. (hérité de SfcInstance.)
Méthode protégée OnPropertyValueChanges Invoked whenever the effective value of any SfcInstance property is updated. (hérité de SfcInstance.)
Méthode protégée PostAlter Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode protégée PostCreate Indicates the default implementor that creates the execution result. Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode protégée PostDrop Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode protégée PostMove Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode protégée PostRename Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode publique Refresh Refreshes the object's properties by reading them from the server. (hérité de SfcInstance.)
Méthode publique Rename Renames the policy.
Méthode protégée RenameImpl Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode protégée ResetKey Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode publique Serialize Serializes the instance to XML. (hérité de SfcInstance.)
Méthode publique ToString Returns a string representation of the instance Urn. (hérité de SfcInstance.)
Méthode protégée UpdateUIPropertyState Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Méthode protégée Validate Indicates the basic child object's validation. Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)

Haut de la page

Événements

  Nom Description
Événement protégé propertyChanged Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Événement public PropertyChanged CLS-compliant event for property changes. (hérité de SfcInstance.)
Événement protégé propertyMetadataChanged Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SfcInstance.)
Événement public PropertyMetadataChanged CLS-compliant event for property metadata changes. (hérité de SfcInstance.)

Haut de la page

Implémentations d'interfaces explicites

  Nom Description
Implémentation d'interface expliciteMéthode privée ISfcAlterable. . :: . .ScriptAlter Alters the script that is used to create the policy. Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server..
Implémentation d'interface expliciteMéthode privée ISfcCreatable. . :: . .ScriptCreate Creates a script that is used to create the policy. Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server..
Implémentation d'interface expliciteMéthode privée ISfcDroppable. . :: . .ScriptDrop Drops the script that is used to create the policy. Ne référencez pas directement ce membre dans votre code. Il prend en charge l'infrastructure SQL Server.
Implémentation d'interface expliciteMéthode privée ISfcRenamable. . :: . .Rename Renames the policy with the specified key.
Implémentation d'interface expliciteMéthode privée ISfcRenamable. . :: . .ScriptRename Renames the script that is used to create the policy with the specified key.

Haut de la page

Notes

Using the PolicyCategory object you can:

  • Create a policy category to which target objects can subscribe.

  • Specify the policy category to use in a subscription

Exemples

C#

PolicyCategorySubscription policyCatSub = new PolicyCategorySubscription(ps);
policyCatSub.PolicyCategory = category;
policyCatSub.TargetType = targetType;
policyCatSub.Target = targetObject;
policyCatSub.Create();

Sécurité des threads

Tous les membres publics static (Shared dans Visual Basic) de ce type sont thread-safe. Tous les membres de l'instance ne sont pas garantis comme étant thread-safe.