Microsoft Internet Security and Acceleration Server 2000

Saving and Refreshing Objects

Many ISA administration COM objects have methods you can use to save their settings to persistent storage or to refresh their settings from values in persistent storage.

Saving Objects

The Save method stores all settings of an object in persistent storage. It is important to note that you can save no changes unless you call the Save method. For example, if you change the value of a property, you must explicitly save the changes to the object, or the change will not be written to persistent storage.

In the following example, the change made to the name of the schedule will not be saved until the Save method is called on the last line of code.

Dim objFPC As New FPCLib.FPC
' declare schedule collection
Dim MySchedules As FPCSchedules
' declare schedule object
Dim MySchedule As FPCSchedule
' get the schedule collection of the current array
Set MySchedules = objFPC.Arrays.GetContainingArray.PolicyElements.Schedules
' find "Extended Work Hours"
Set MySchedule = MySchedules("Extended Work Hours")
' rename the schedule
MySchedule.Name = "Unusual Work Hours"
' save changes
MySchedule.Save

Note  Some objects do not have a Save method. To save these objects, invoke the Save method of a parent of the object in the hierarchy. An example of this is the FPCCacheDrives.Save method.

Refreshing Objects

If you need to abandon changes you've made to an object — while preserving the object in memory — use the Refresh method. The Refresh method reads the last saved values from persistent storage and applies them to the object and its subordinate objects.

The Refresh method retrieves and applies the last saved settings for an object and any subordinate objects. Use the Refresh method to be sure you have the current values for an object and its subordinate objects.

The Refresh method overwrites any changes made but not saved when it applies values from persistent storage. This can be useful when you want to cancel changes that have been made but not yet saved with the Save method.

In the following example the name of the schedule never changes because the Save method is not called before the Refresh method is called.

Dim objFPC As New FPCLib.FPC
' declare schedule collection
Dim MySchedules As FPCSchedules
' declare schedule object
Dim MySchedule As FPCSchedule
' get the schedule collection of the current array
Set MySchedules = objFPC.Arrays.GetContainingArray.PolicyElements.Schedules
' find "Extended Work Hours"
Set MySchedule = MySchedules("Extended Work Hours")
' rename the schedule
MySchedule.Name = "Unusual Work Hours"
'Refresh, do not save changes
MySchedule.Refresh