Sun Java System Calendar Server 6 2005Q4 Developer's Guide

API: csIPlugin

You should implement the methods in this interface in order to provide the server with information about your plug-in module on startup.

Methods

The csIPlugin interface implements four methods:

Method: GetDescription

Gets a textual description of what the plug-in does. 

Method: GetVendorName

Gets a textual description of the vendor supplying this plug-in. 

Method: GetVersion

Gets the major and minor version of the plug-in. This value must be greater than or equal to 1.0. For a list of the current version numbers for each plug-in API, seePlug-in Version Numbers.

Method: Init

Confirms that the interface was found and registered. 

Description

This interface is not required, but it is highly recommended that you implement it in each module to provide version information to the server when it loads that module. The methods return descriptive information to the server.

Method: GetDescription

Purpose

Retrieve a text description of the module.

Syntax

PRUint32 GetDescription (nsString& aDescription)=0;

Parameters

The method has the following parameter:

aDescription

On return, contains the text description of the module. 

Returns

NS_OK on success, non-zero error code on failure.

Description

Use this method to provide a text description of the module.

Method: GetVendorName

Purpose

Retrieve a text description of the vendor supplying the module.

Syntax

PRInt32 GetVendorName (nsString& aVendorName)=0;

Parameters

The method has the following parameter:

aVendorName

On return, contains the text description of the vendor. 

Returns

NS_OK on success, non-zero error code on failure.

Description

Use this method to identify the module’s supplier.

Method: GetVersion

Purpose

Provide server with version information on startup.

Syntax

PRUint32 GetVersion (PRUint32& aMajorValue,PRUint32& aMinorValue)=0;

Parameters

The method has the following two parameters:

aMajorValue

On return, contains the major version number. 

aMinorValue

On return, contains the minor version number. 

Returns

NS_OK on success, non-zero error code on failure.

Description

Use this method to identify the module’s major and minor version number. The number must be greater than or equal to 1.0.

Method: Init

Purpose

Confirm that the interface has been registered and obtains a reference to the server.

Syntax

PRUint32 Init (nsISupports *aServer)=0;

Parameters

The method has the following parameter:

aServer

On return, this location contains a reference to the server with which the module is registered. 

Returns

NS_OK on success, non-zero error code on failure.

Description

The server calls this method, after finding and registering the interface on module load, to confirm that the operation was successful. You can use the pointer returned in aServer to make calls out to the server.