Condividi tramite


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.

Gerarchia di ereditarietà

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

Spazio dei nomi  Microsoft.SqlServer.Management.Dmf
Assembly:  Microsoft.SqlServer.Dmf (in Microsoft.SqlServer.Dmf.dll)

Sintassi

'Dichiarazione
<StrongNameIdentityPermissionAttribute(SecurityAction.LinkDemand, PublicKey := "0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8")> _
Public NotInheritable Class PolicyCategory _
    Inherits SfcInstance _
    Implements ISfcCreatable, ICreatable, ISfcDroppable, IDroppable,  _
    ISfcAlterable, IAlterable, ISfcRenamable, IRenamable
'Utilizzo
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

Nel tipo PolicyCategory sono esposti i membri seguenti.

Costruttori

  Nome Descrizione
Metodo pubblico PolicyCategory() () () () Initializes a new instance of the PolicyCategory class.
Metodo pubblico PolicyCategory(PolicyStore, String) Initializes a new instance of the PolicyCategory class.

In alto

Proprietà

  Nome Descrizione
Proprietà protetta AbstractIdentityKey Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Proprietà pubblicaMembro statico DefaultCategory Gets the category to which the policy is assigned by default.
Proprietà pubblica ID Gets the ID value that uniquely identifies the policy category.
Proprietà pubblica IdentityKey Gets the key that uniquely identifies the policy category.
Proprietà pubblica MandateDatabaseSubscriptions Gets or sets the Boolean value that determines whether the database subscriptions are permitted.
Proprietà pubblica Metadata Returns metadata about the instance and its domain. Ereditato da SfcInstance.
Proprietà pubblica Name Gets the name of the policy category.
Proprietà pubblica Parent Gets or sets the parent instance via the keychain.
Proprietà pubblica Properties Returns a collection instance properties. Ereditato da SfcInstance.
Proprietà protetta PropertyStorageProvider Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Proprietà protetta State Returns the state of the SfcInstance object. Ereditato da SfcInstance.
Proprietà pubblica Urn Returns the uniform resource name of the SfcInstance object. Ereditato da SfcInstance.

In alto

Metodi

  Nome Descrizione
Metodo pubblico Alter Updates any PolicyCategory object property changes on the instance of SQL Server.
Metodo protetto AlterImpl Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo protetto CheckObjectCreated Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo protetto CheckObjectState Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo pubblico Create Creates a category for the PolicyCategory class.
Metodo protetto CreateIdentityKey Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo protetto CreateImpl Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo pubblico Discover Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo pubblico Drop Removes the policy category from the instance of SQL Server.
Metodo protetto DropImpl Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo pubblico Equals Ereditato da Object.
Metodo protetto Finalize Ereditato da Object.
Metodo protetto GetChildCollection Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo pubblico GetDomain Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo pubblico GetHashCode Ereditato da Object.
Metodo pubblicoMembro statico GetObjectFactory Gets the object factory for the object.
Metodo pubblico GetPropertySet Returns the set of properties for the SfcInstance object. Ereditato da SfcInstance.
Metodo pubblico GetType Ereditato da Object.
Metodo protetto GetTypeMetadataImpl Indicates the domains that override by returning the right TypeMetadata class directly. Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo protetto InitializeUIPropertyState Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo protetto MarkForDropImpl Returns a value that indicates the existing objects to be dropped. Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo protetto MarkRootAsConnected Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo protetto MemberwiseClone Ereditato da Object.
Metodo protetto MoveImpl Indicates the new parent object to move in an instance. Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo protetto OnPropertyMetadataChanges Invoked whenever the effective value of any SfcInstance metadata is updated. Ereditato da SfcInstance.
Metodo protetto OnPropertyValueChanges Invoked whenever the effective value of any SfcInstance property is updated. Ereditato da SfcInstance.
Metodo protetto PostAlter Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo protetto PostCreate Indicates the default implementor that creates the execution result. Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo protetto PostDrop Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo protetto PostMove Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo protetto PostRename Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo pubblico Refresh Refreshes the object's properties by reading them from the server. Ereditato da SfcInstance.
Metodo pubblico Rename Renames the policy.
Metodo protetto RenameImpl Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo protetto ResetKey Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo pubblico Serialize Serializes the instance to XML. Ereditato da SfcInstance.
Metodo pubblico ToString Returns a string representation of the instance Urn. Ereditato da SfcInstance.
Metodo protetto UpdateUIPropertyState Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Metodo protetto Validate Indicates the basic child object's validation. Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.

In alto

Eventi

  Nome Descrizione
Evento protetto propertyChanged Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Evento pubblico PropertyChanged CLS-compliant event for property changes. Ereditato da SfcInstance.
Evento protetto propertyMetadataChanged Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server. Ereditato da SfcInstance.
Evento pubblico PropertyMetadataChanged CLS-compliant event for property metadata changes. Ereditato da SfcInstance.

In alto

Implementazioni esplicite dell'interfaccia

  Nome Descrizione
Implementazione esplicita dell'interfacciaMetodo privato ISfcAlterable. . :: . .ScriptAlter Alters the script that is used to create the policy. Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server..
Implementazione esplicita dell'interfacciaMetodo privato ISfcCreatable. . :: . .ScriptCreate Creates a script that is used to create the policy. Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server..
Implementazione esplicita dell'interfacciaMetodo privato ISfcDroppable. . :: . .ScriptDrop Drops the script that is used to create the policy. Non fare riferimento direttamente a questo membro nel codice. Supporta l'infrastruttura di SQL Server.
Implementazione esplicita dell'interfacciaMetodo privato ISfcRenamable. . :: . .Rename Renames the policy with the specified key.
Implementazione esplicita dell'interfacciaMetodo privato ISfcRenamable. . :: . .ScriptRename Renames the script that is used to create the policy with the specified key.

In alto

Osservazioni

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

Esempi

C#

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

Protezione dei thread

I membri static (Shared in Visual Basic) pubblici di questo tipo sono affidabili. Non è invece garantita la sicurezza dei membri dell'istanza.