Microsoft Internet Security and Acceleration Server 2004 SDK

IFPCPersist::ImportFromFile[C++]

FPCPersist.ImportFromFile [Visual Basic]

[C++]

The ImportFromFile method recursively copies the values of all the properties of the object and of its subobjects from the specified XML file to persistent storage. For a collection, the method also imports all of its elements and their properties from the XML file.

HRESULT ImportFromFile(
  BSTR XmlFileName,
  long OptionalData,
  BSTR EncryptionPassword,
  VARIANT_BOOL CleanCollections,
  VARIANT_BOOL fResetRequiredServices,
  VARIANT_BOOL fReloadConfiguration
);

Parameters

XmlFileName
[in] BSTR that specifies the name of the XML file from which the data will be imported.
OptionalData
[in] A 32-bit integer value that specifies what optional data to include in the import. This value is a bitwise combination of values from the FpcExportImportOptionalData enumerated type. The bits set should not call for the inclusion of optional data in the import that were not included in the export.
EncryptionPassword
[in, optional] BSTR that specifies a password for importing encrypted information. This parameter is an empty string by default. The password is required if the export was performed using an encryption password.
CleanCollections
[in, optional] Boolean value that indicates whether to remove existing objects that are not included in the XML file. The default value is VARIANT_FALSE. If this parameter is set to VARIANT_TRUE in a call to the Import method on any interface other than the IFPCArray interface, the call will fail.
fResetRequiredServices
[in, optional] Boolean value that indicates whether to restart the services that need to be restarted for the changes to take effect. The default value is VARIANT_FALSE.
fReloadConfiguration
[in, optional] Boolean value that indicates whether the call will return only after ISA Server has reloaded the saved configuration with the current changes from persistent storage. The default value is VARIANT_TRUE.

Return Values

This method returns S_OK if the call is successful; otherwise, it returns an error code.

Remarks

ISA Server maintains a bitmask that specifies which services need to be started for the configuration changes to take effect. This bitmask can be retrieved by calling the GetServiceRestartMask method. Calling the ImportFromFile method clears all of the bits in this bitmask even if the fResetRequiredServices parameter is set to VARIANT_FALSE.

If the fReloadConfiguration parameter is set to VARIANT_FALSE the current values of the object's properties will be written to persistent storage without updating the configuration being used by the ISA Server services. The configuration used by each service will not be updated until the service is restarted.

For more information, see About Persistence.

[Visual Basic]

The ImportFromFile method recursively copies the values of all the properties of the object and of its subobjects from the specified XML file to persistent storage. For a collection, the method also imports all of its elements and their properties from the XML file.

Sub ImportFromFile( _
  ByVal XmlFileName As String, _
  ByVal OptionalData As Long, _
  [ ByVal EncryptionPassword As String ], _
  [ ByVal CleanCollections As Boolean ], _
  [ ByVal fResetRequiredServices As Boolean ], _
  [ ByVal fReloadConfiguration As Boolean ] _
)

Parameters

XmlFileName
[in] String that specifies the name of the XML file from which the data will be imported.
OptionalData
[in] A 32-bit integer value that specifies what optional data to include in the import. This value is a bitwise combination of values from the FpcExportImportOptionalData enumerated type. The bits set should not call for the inclusion of optional data in the import that were not included in the export.
EncryptionPassword
[in, optional] String that specifies a password for importing encrypted information. This parameter is an empty string by default. The password is required if the export was performed using an encryption password.
CleanCollections
[in, optional] Boolean value that indicates whether to remove existing objects that are not included in the XML file. The default value is False. If this parameter is set to True in a call to the Import method on any object other than the FPCArray object, the call will fail.
fResetRequiredServices
[in, optional] Boolean value that indicates whether to restart the services that need to be restarted for the changes to take effect. The default value is False.
fReloadConfiguration
[in, optional] Boolean value that indicates whether the call will return only after ISA Server has reloaded the saved configuration with the current changes from persistent storage. The default value is True.

Return Values

This method has no return values. If the call is unsuccessful, an error is raised that can be intercepted by using an error handler.

Remarks

ISA Server maintains a bitmask that specifies which services need to be started for the configuration changes to take effect. This bitmask can be retrieved by calling the GetServiceRestartMask method. Calling the ImportFromFile method clears all of the bits in this bitmask even if the fResetRequiredServices parameter is set to False.

If the fReloadConfiguration parameter is set to False the current values of the object's properties will be written to persistent storage without updating the configuration being used by the ISA Server services. The configuration used by each service will not be updated until the service is restarted.

For more information, see About Persistence.

Requirements

Server: Requires Windows Server 2003 or Windows 2000.
Version: Requires Internet Security and Acceleration Server 2004.
Header: Declared in Msfpccom.idl.
Library: Use Microsoft Internet Security and Acceleration Server 2004 Administration Library.

See Also

FPCPersist