Table of Contents

Add-CompactType

Note

This feature is only available in NCache Enterprise edition.

Add-CompactType cmdlet enables the user to register a custom object for compact serialization for the given caches. It enables the users to add a class to cache configuration with some of the attributes marked as non-compact whereas the rest are compact serialized.

Add-ComapctType -AssemblyPath [-CacheName] -Class [-NoLogo] [-NonCompactAttributes] [-Password] [-Port] [-Server] [-UserId]

These properties are explained in detail in the Properties section.

Examples

  • This command configures the object class Customers compact serializable for a cache named demoCache.

    Add-CompactType -CacheName demoCache -AssemblyPath C:\\Data.dll -Class
    Data.Customer
    
  • This command configures the object class Customers compact serializable for a cache named demoCache and marks the attributes CustomerID and FirstName as non-compact.

    Add-CompactType -CacheName demoCache -AssemblyPath C:\\Data.dll -Class
    Data.Customer -NonCompactAttributes CustomerID'$'FirstName
    
  • This command configures the object class Customers compact serializable for a cache named demoCache and marks the attributes CustomerID and FirstName as non-compact on server node 20.200.21.11.

    Add-CompactType demoCache -AssemblyPath C:\\Data.dll -Class Data.Customer
    -NonCompactAttributes CustomerID'$'FirstName –Server 20.200.21.11
    

Properties

Note: The parameters with asterisk (*) on their names are the required parameters and the rest are optional.

Parameters Data Types Description Default Value
-AssemblyPath* <String> Specifies the path of the assembly which needs to be configured as a compact type. -
-CacheName* <String> Specifies the name of the cache for which data sharing is to be disabled. -
-Class* <String> Specifies the class which needs to be serialized. -
-NonCompactAttributes <String> Specifies the attributes of the class which don’t need to be serialized with a delimiter ‘$’ -
-Server <String> Specifies the NCache server name where the NCache service is running. -
-Port <Integer> Specifies the server port where NCache server is listening. 8250
-UserId <String> Specifies the User Id used to authorize a user if security is enabled on cache server. This User Id must be the same as the active directory user credentials. -
-Password <String> Specifies the password against the user Id; to authorize a user if security is enabled on cache server. This password must be the same as active directory password. -
-NoLogo <SwitchParameter> Suppresses display of the logo banner. False