AxMmServer.HighAvailability
In C#, VB.Net, C++ and other compiled languages the namespace for most classes is AXMMCFGLib instead of AxMmServer. For interpreted languages like VBScript, JavaScript or Powershell it is AxMmServer.
Property | Type | Read/Write | Description |
LastError | Number | Read | Completion code of the last called function |
PrimaryHeartBeat | Date | Read/Write | Last heartbeat time for the primary server |
SecondaryHeartBeat | Date | Read/Write | Last heartbeat time for the secondary server |
ActiveServer | String | Read/Write | The currently active server |
PrimaryServerName | String | Read/Write | The hostname of the primary server |
SecondaryServerName | String | Read/Write | The hostname of the secondary server |
Method | Description |
Load | Load the highavailability object |
Save | Save the highavailability object |
HasUpdate | Check if any property value has changed |
NotifyUpdate | Notify that a property value has changed |
StartChangeListening | Start listening for changes |
StopChangeListening | Stop listening for changes |
LastError property
Completion code of the last called function. To find the error description of a given error code, go to the online error codes codes page.
Example:
Set objHa = CreateObject("AxMmServer.HighAvailability")
objHa.Load
WScript.Echo "Load: " & objHa.LastError
...
PrimaryHeartBeat property
This is the time of the last recorded heartbeat of the primary server.
The primary server updates this value every few seconds. Refer to the check interval in the server options on the ‘High Availability’ tab for the interval time.
Example:
Set objHa = CreateObject("AxMmServer.HighAvailability")
objHa.Load
WScript.Echo "Load: " & objHa.LastError
WScript.Echo objHa.ActiveServer
WScript.Echo objHa.PrimaryHeartBeat
WScript.Echo objHa.SecondaryHeartBeat
...
SecondaryHeartBeat property
This is the time of the last recorded heartbeat of the secondary server.
The secondary server updates this value every few seconds. Refer to the check interval in the server options on the ‘High Availability’ tab for the interval time.
Example:
Set objHa = CreateObject("AxMmServer.HighAvailability")
objHa.Load
WScript.Echo "Load: " & objHa.LastError
WScript.Echo objHa.ActiveServer
WScript.Echo objHa.PrimaryHeartBeat
WScript.Echo objHa.SecondaryHeartBeat
...
ActiveServer property
This is the hostname of the currently active server.
This will always be the primary server while the primary server is reachable by the secondary server. If the secondary server can’t reach the primary server this will be the secondary server.
Example:
Set objHa = CreateObject("AxMmServer.HighAvailability")
objHa.Load
WScript.Echo "Load: " & objHa.LastError
WScript.Echo objHa.ActiveServer
WScript.Echo objHa.PrimaryHeartBeat
WScript.Echo objHa.SecondaryHeartBeat
...
PrimaryServerName property
This is the hostname of the primary server.
Example:
Set objHa = CreateObject("AxMmServer.HighAvailability")
objHa.Load
WScript.Echo "Load: " & objHa.LastError
WScript.Echo objHa.PrimaryServerName
WScript.Echo objHa.SecondaryServerName
...
SecondaryServerName property
This is the hostname of the secondary server.
Example:
Set objHa = CreateObject("AxMmServer.HighAvailability")
objHa.Load
WScript.Echo "Load: " & objHa.LastError
WScript.Echo objHa.PrimaryServerName
WScript.Echo objHa.SecondaryServerName
...
Load method
Loads the current values for this object.
Parameters:
- none
Return value:
none
Example:
Set objHa = CreateObject("AxMmServer.HighAvailability")
objHa.Load
WScript.Echo "Load: " & objHa.LastError
WScript.Echo objHa.PrimaryServerName
WScript.Echo objHa.SecondaryServerName
...
Save method
Saves the current values for this object.
Parameters:
- none
Return value:
none
Example:
Set objHa = CreateObject("AxMmServer.HighAvailability")
objHa.Load
WScript.Echo "Load: " & objHa.LastError
objHa.ActiveServer = "TEST"
objHa.NotifyUpdate
objHa.Save
WScript.Echo objHa.LastError
...
HasUpdate method
Check if any of the properties in the object have changed value.
Calling this method resets the change value. Call this method regulary to find out if a propery has changed in the time between calls.
You must sucessfully call StartChangeListening before calling this method.
Parameters:
- none
Return value:
True if a property changed value. False if no propery changed value.
Example:
Set objHa = CreateObject("AxMmServer.HighAvailability")
objHa.StartChangeListening
WScript.Echo "StartChangeListening: " & objHa.LastError
While True
If objHa.HasUpdate Then
WScript.Echo "Update on HighAvailability; Reloading"
objHa.Load
WScript.Echo "Load: " & objHa.LastError
End If
...
Wend
...
NotifyUpdate method
Notify that a propery value has changed.
Call this method to notify the service as well as any other process that may be listening that a property value in this object has changed.
Parameters:
- none
Return value:
none
Example:
Set objHa = CreateObject("AxMmServer.HighAvailability")
objHa.Load
WScript.Echo "Load: " & objHa.LastError
objHa.ActiveServer = "TEST"
objHa.NotifyUpdate
objHa.Save
WScript.Echo objHa.LastError
...
StartChangeListening method
Starts listening for changes in this objects property values.
You must call this function before calling HasUpdate
Parameters:
- none
Return value:
none
Example:
Set objHa = CreateObject("AxMmServer.HighAvailability")
objHa.StartChangeListening
WScript.Echo "StartChangeListening: " & objHa.LastError
While True
If objHa.HasUpdate Then
WScript.Echo "Update on HighAvailability; Reloading"
objHa.Load
WScript.Echo "Load: " & objHa.LastError
End If
...
Wend
...
StopChangeListening method
Stops listening for changes in this objects property values.
This method is called automatically when cleaning up this object.
Parameters:
- none
Return value:
none
Example:
Set objHa = CreateObject("AxMmServer.HighAvailability")
objHa.StartChangeListening
WScript.Echo "StartChangeListening: " & objHa.LastError
While True
If objHa.HasUpdate Then
WScript.Echo "Update on HighAvailability; Reloading"
objHa.Load
WScript.Echo "Load: " & objHa.LastError
End If
...
Wend
objHa.StopChangeListening
...