Implement the methods in this interface to override the procedure for setting or retrieving user attributes.
The csIUserAttributes interface implements four methods:
Free the memory used to store a retrieved attribute. |
|
Retrieve an attribute value for a user. |
|
Confirm that the interface was found and registered. |
|
Set an attribute value for a user. |
The User Attributes interface allows a CSAPI module to maintain or manipulate all requests coming in for setting and retrieving user attribute values. You provide methods that retrieve and set attributes using the technique of your choice.
Free the memory associated with your local attribute storage.
PRint32 FreeAttribute (char* aValue, PRInt32 *aReturnCode)=0;
The method has the following two parameters:
NS_OK on success, non-zero error code on failure.
When you retrieve the value of an attribute using the GetAttribute method, the value is stored at a location that you have allocated, using the memory management technique of your choice. Use the Method: FreeAttribute method to free that memory when it is no longer needed, using the same memory management technique. (See API: csIMalloc.)
Retrieve an attribute value for a user.
PRUint32 GetAttribute (char* aUser, char* aKey, char** aValue, PRInt32 *aReturnCode)=0;
The method has the following four parameters:
NS_OK on success, non-zero error code on failure.
Retrieves the value of the specified attribute for the specified user, and stores it at the location pointed to by aValue. You are responsible for allocating storage space for the returned attribute, and for freeing it (using the FreeAttribute method) when it is no longer needed.
Confirm that the interface has been registered and obtain a reference to the server.
PRUint32 Init (nsISupports *aServer)=0;
The method has the following parameter:
aServer |
On return, this location contains a reference to the server with which the module is registered. |
NS_OK on success, non-zero error code on failure.
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.
Set an attribute value for a user.
PRUint32 SetAttribute (char* aUser, char* aKey, char* aValue, PRInt32 *aReturnCode)=0;
The method has the following parameters:
NS_OK on success, non-zero error code on failure.
Sets the specified attribute for the specified user to the specified value.