%SYS
ECPServers Class Reference

This class allows you to modify and view the [ECPServers] section of the CPF file through programatic APIs. More...

Inheritance diagram for ECPServers:
Collaboration diagram for ECPServers:

Public Attributes

 Address
 IP Address to connect to. More...
 
 BatchMode
 ECP Server runs in batch mode. More...
 
 MirrorConnection
 Specifies the behavior of this connection with regard to mirrored database servers. More...
 
 Port
 IP Port to connect to. More...
 
 SSLConfig
 Use SSL configuration (ECPClient) for the ECP connection. More...
 
- Public Attributes inherited from CommonProperties
 CPFFile
 CPF file which the object maps to. More...
 
 Comments
 Embedded comments in the CPF file. More...
 
 Flags
 Flags governing how the object is processed when Save() is called. More...
 
 Name
 Name of the object instance. More...
 

Static Public Attributes

 CAPITALNAME = None
 Server name is always capitalized. More...
 
- Static Public Attributes inherited from CommonMultipleMethods
 CAPITALNAME = None
 Determines if the Name specified in the index should be capitalized. More...
 
 SECTIONTYPE = None
 This parameter governs how the class creates audit records. More...
 
- Static Public Attributes inherited from CommonProperties
 DOMAIN = None
 This class contains properties which are included by classes which manipulate sections in the CPF file. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from CommonMultipleMethods
_.Library.Status Create (_.Library.String Name, _.Library.String Properties, _.Library.String CPFFile, _.Library.Integer Flags)
 Create a section instance in a CPF file. More...
 
_.Library.Status Delete (_.Library.String Name, _.Library.String CPFFile, _.Library.Integer Flags)
 Delete a section instance from a CPF file. More...
 
_.Library.Boolean Exists (_.Library.String Name, _.Library.ObjectHandle Obj, _.Library.Status Status, _.Library.String CPFFile, _.Library.Integer Flags)
 Database exists. More...
 
_.Library.Status Get (_.Library.String Name, _.Library.String Properties, _.Library.String CPFFile, _.Library.Integer Flags)
 Get a section instances properties from a CPF file. More...
 
_.Library.Status GetList (_.Library.String Name, _.Library.String CPFFile, _.Library.Integer Flags)
 Returns the properties from a section instance in a CPF file by value in $list format
More...
 
_.Library.Status Modify (_.Library.String Name, _.Library.String Properties, _.Library.String CPFFile, _.Library.Integer Flags)
 Modify a section instance in a CPF file. More...
 
_.Library.ObjectHandle Open (_.Library.String Name, _.Library.String CPFFile, _.Library.Integer concurrency, _.Library.Status Status, _.Library.Integer Flags)
 Open a section instance object in a CPF file. More...
 

Detailed Description

This class allows you to modify and view the [ECPServers] section of the CPF file through programatic APIs.

While properties are usually modified through the System Management portal, there may be some occasion where modifying them through the API's is best for your system. In all the Config methods, if you do not specify the CPFFile parameter, the currently active CPF file is used. If you wish to modify a CPF file which is not the currently active one, then specify the CPFFile you wish to modify in the method call.
The Flags parameter does not normally need to be specified; the defaults are usually sufficient for most cases.
You can use either the provided API's (Create/Get/Modify/Delete) to modify the properties by passing in the correct parameters, or use Object syntax to open and directly manipulate the config objects (Open() and Exists()). Most objects created here need only to specify the Name of the object, and 1 or 2 properties since the the defaults are what are commonly used for most cases.

EXAMPLE:

    ; Use class methods to create an instance
    SYS>s Name="SERVERA"
    SYS>s Properties("Address")="127.0.0.10"
    SYS>s Status=##Class(Config.ECPServers).Create(Name,.Properties)
    SYS>i 'Status w !,"Error="_$SYSTEM.Status.GetErrorText(Status)
    ; Use class methods to modify properties
    SYS>s Status=##Class(Config.ECPServers).Get(Name,.Properties)
    SYS>i 'Status w !,"Error="_$SYSTEM.Status.GetErrorText(Status)
    SYS>zw Properties
    Properties("Address")="127.0.0.1"
    Properties("Port")=1973
    SYS>s Properties("Port")=1972
    SYS>s Status=##Class(Config.ECPServers).Modify(Name,.Properties)
    SYS>i 'Status w !,"Error="_$SYSTEM.Status.GetErrorText(Status)
    ; Now use Objects to modify properties
    SYS>s Obj=##Class(Config.ECPServers).Open(Name)
    ; We could have used i ##Class(Config.ECPServers).Exists(Name,.Obj) instead of Open()
    SYS>w Obj.Port
    1972
    SYS>s Obj.Port=1975
    SYS>s Status=Obj.Save()
    SYS>i 'Status w !,"Error="_$SYSTEM.Status.GetErrorText(Status)
    ; Now delete the object we just created
    SYS>s Status=##Class(Config.ECPServers).Delete(Name)
    SYS>i 'Status w !,"Error="_$SYSTEM.Status.GetErrorText(Status)
    

Member Data Documentation

◆ CAPITALNAME

CAPITALNAME = None
static

Server name is always capitalized.


◆ Address

Address

IP Address to connect to.


 

◆ BatchMode

BatchMode

ECP Server runs in batch mode.


 

◆ MirrorConnection

MirrorConnection

Specifies the behavior of this connection with regard to mirrored database servers.

Value: 0: Non-mirrored connection. Access databases on non-mirror members. Also used to connect to async members to access mirror databases, configured by their database paths. 1: Mirrored connection. ECP will automatically find the primary mirror member and will only connect to the primary. Access to mirrored databases is configured by mirror database name. -1: Mirrored connection restricted to the configured mirror member only. The configured member is the one specified by <PROPERTY>Address</PROPERTY> and <PROPERTY>Port</PROPERTY>. Like value '1', a connection will be established if the configured member is primary and access to mirrored databases is configured by mirror database name. Unlike '1', if the configured member is a Disaster Recovery member, the connection will be established, allowing read-only access to mirrored databases. If the DR member is promoted, the connection will be dropped and will be re-established when it becomes primary. Warning: This setting is not appropriate in typical configurations where mirroring will automatically fail over, as the new primary won't be found. This is for use in specialized DR configurations, or other long-distance configurations, to prevent the application server from being automatically redirected to a primary in a different data center while allowing local read-only access. There is no system utility to set the value of '-1', but it can be specified via this class interface.  

◆ Port

Port

IP Port to connect to.


 

◆ SSLConfig

SSLConfig

Use SSL configuration (ECPClient) for the ECP connection.