Enabling MPX

To use the StarTeamMPX features, an application must explicitly enable MPX. There are several ways to do this, described in the following subsections:

Server.enableMPX()

The Server object provides methods to explicitly enable MPX:

public void enableMPX() throws MPXException;

Enables MPX using the server's default client MPX profile. The default profile is configured by the StarTeam Administrator.


public void enableMPX(String strProfileName) throws MPXException;

Enables MPX using the MPX profile with the given name.


public void enableMPX(EventHandlerProfile p) throws MPXException;

Enables MPX using the given MPX profile. It may be a profile saved persistently on the StarTeam server, or a profile created programmatically by the client application.

When MPX is enabled, the SDK establishes a connection to the StarTeamMPX message broker, and subscribes to events for this server.

Even though MPX is enabled through a specific Server object, it is really the communication layer between the SDK and the StarTeam repository that is MPX-enabled. Thus, enabling MPX on a specific Server object also enables MPX for other Server objects that share the same address and port.

Server Constructor

The Server object provides the following constructor:

public Server(ServerInfo info);

Constructs a Server object using the given connection information.

ServerInfo specifies all the information required to establish a connection to a given StarTeam server. This includes an optional MPX profile name.

If a Server object was constructed using a ServerInfo that specifies a valid MPX profile, then MPX is automatically enabled when Server.connect() is called. (For StarTeam 5.2 servers, MPX is not enabled until logOn() is called.) Note that some applications do not call connect() explicitly; however, it is called automatically by logOn() if necessary.

If enableMPX() fails during the connect(), the resulting MPXException is caught and ignored, and the connect() operation succeeds. If the application needs to know whether or not enableMPX() was successful, it can call isMPXEnabled().

StarTeam URLs

Another way to establish a connection to a Server is via the StarTeamFinder:


public static Server openServer(String url);

Connect to and log on to the server specified by the StarTeam URL.


The StarTeam URL has one of the following forms:

user:password@address:port
user:password@servername

If the port number is specified (for example, localhost:49201), then a connection is established to the StarTeam server at the given address and port.

If the port number is not specified (localhost), then the address is instead interpreted as the name of a ServerInfo in the client's Server List. The information in the ServerInfo object is used to establish the connection. If the ServerInfo specifies a valid MPX profile, then StarTeamFinder will automatically enable MPX using that profile.

If an SDK application is already designed to accept a StarTeam URL for its connection information, then it will support MPX simply by upgrading to an MPX-enabled version of the StarTeam SDK, without any code changes. To enable MPX, specify a StarTeam URL that references a ServerInfo with a valid MPX profile.

Limitations

Currently, the StarTeam SDK does not support multicast. If an application attempts to enable MPX using a multicast MPX profile, an MPXException will result.

The SDK supports MPX only when running against a StarTeam 5.2 or later server. If an application attempts to enable MPX for a StarTeam 5.1 server, an MPXException will result.


 Home     Next: Instant Refresh