Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Attributes
nsAbLDAPReplicationQuery Class Reference

#include <nsAbLDAPReplicationQuery.h>

Inheritance diagram for nsAbLDAPReplicationQuery:
Inheritance graph
[legend]
Collaboration diagram for nsAbLDAPReplicationQuery:
Collaboration graph
[legend]

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIABLDAPREPLICATIONQUERY 
nsAbLDAPReplicationQuery ()
virtual ~nsAbLDAPReplicationQuery ()
nsresult InitLDAPData ()
nsresult CreateNewLDAPOperation ()
void init (in ACString aPrefName, in nsIWebProgressListener aProgressListener)
 initialize for the query
void doReplicationQuery ()
 Starts an LDAP query to do replication as needed.
void connectToLDAPServer (in nsILDAPURL aURL, in AUTF8String aAuthDN)
 connects to an LDAP Server using a DN
void queryAllEntries ()
 Starts an LDAP query to replicate all entries.
void cancelQuery ()
 Cancels the currently executing query.
void done (in boolean aSuccess)
 this method is the callback when query is done, failed or successful

Public Attributes

readonly attribute nsILDAPURL replicationURL
readonly attribute
nsILDAPConnection 
connection
readonly attribute nsILDAPOperation operation
readonly attribute DIR_Server replicationServerInfo

Protected Attributes

nsCOMPtr< nsILDAPConnectionmConnection
nsCOMPtr< nsILDAPOperationmOperation
nsCOMPtr< nsILDAPURLmURL
nsCOMPtr
< nsIAbLDAPProcessReplicationData
mDataProcessor
PRBool mInitialized
nsCString mDirPrefName
DIR_ServermDirServer

Detailed Description

Definition at line 50 of file nsAbLDAPReplicationQuery.h.


Constructor & Destructor Documentation

Definition at line 54 of file nsAbLDAPReplicationQuery.cpp.

Definition at line 60 of file nsAbLDAPReplicationQuery.cpp.

Here is the call graph for this function:


Member Function Documentation

Cancels the currently executing query.

void nsIAbLDAPReplicationQuery::connectToLDAPServer ( in nsILDAPURL  aURL,
in AUTF8String  aAuthDN 
) [inherited]

connects to an LDAP Server using a DN

Definition at line 112 of file nsAbLDAPReplicationQuery.cpp.

{
  nsresult rv;
  nsCOMPtr <nsILDAPMessageListener> oldListener;
  mOperation->GetMessageListener(getter_AddRefs(oldListener));
  // release old and create a new instance
  mOperation = do_CreateInstance(NS_LDAPOPERATION_CONTRACTID, &rv);
  NS_ENSURE_SUCCESS(rv, rv);
  return mOperation->Init(mConnection, oldListener, nsnull);
}

Here is the call graph for this function:

void nsIAbLDAPReplicationQuery::done ( in boolean  aSuccess) [inherited]

this method is the callback when query is done, failed or successful

Starts an LDAP query to do replication as needed.

void nsIAbLDAPReplicationQuery::init ( in ACString  aPrefName,
in nsIWebProgressListener  aProgressListener 
) [inherited]

initialize for the query

Definition at line 65 of file nsAbLDAPReplicationQuery.cpp.

{
    mDirServer = (DIR_Server *) PR_Calloc(1, sizeof(DIR_Server));
    if (!mDirServer) return NS_ERROR_NULL_POINTER;

    DIR_InitServerWithType(mDirServer, LDAPDirectory);
    // since DeleteServer frees the prefName make a copy of prefName string
    mDirServer->prefName = nsCRT::strdup(mDirPrefName.get());
    DIR_GetPrefsForOneServer(mDirServer, PR_FALSE, PR_FALSE);

    // this is done here to take care of the problem related to bug # 99124.
    // earlier versions of Mozilla could have the fileName associated with the directory
    // to be abook.mab which is the profile's personal addressbook. If the pref points to
    // it, calls nsDirPrefs to generate a new server filename.
    if (!nsCRT::strcasecmp(mDirServer->fileName,kPersonalAddressbook) 
        || !mDirServer->fileName || !(*mDirServer->fileName)) {
        // initialize mDirServer->filename is null or else DIR_SetServerFileName doesnot work
        // and no point in passing the 2nd param (leafName) to it as it doesnot use that.
        PR_FREEIF(mDirServer->fileName);
        mDirServer->fileName=nsnull;
        DIR_SetServerFileName (mDirServer, nsnull);
    }
    // use the dir server filename for replication
    PR_FREEIF(mDirServer->replInfo->fileName);
    // since DeleteServer frees the replInfo->fileName make a copy of string
    // if we donot do this the DeleteServer functions crashes.
    mDirServer->replInfo->fileName = nsCRT::strdup(mDirServer->fileName);

    nsresult rv = NS_OK;

    mURL = do_CreateInstance(NS_LDAPURL_CONTRACTID, &rv);
    if (NS_FAILED(rv)) 
        return rv;

    rv = mURL->SetSpec(nsDependentCString(mDirServer->uri));
    if (NS_FAILED(rv)) 
        return rv;

    mConnection = do_CreateInstance(NS_LDAPCONNECTION_CONTRACTID, &rv);
    if (NS_FAILED(rv)) 
        return rv;

    mOperation = do_CreateInstance(NS_LDAPOPERATION_CONTRACTID, &rv);

    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Starts an LDAP query to replicate all entries.


Member Data Documentation

Definition at line 56 of file nsIAbLDAPReplicationQuery.idl.

Definition at line 64 of file nsAbLDAPReplicationQuery.h.

Definition at line 68 of file nsAbLDAPReplicationQuery.h.

Definition at line 71 of file nsAbLDAPReplicationQuery.h.

Definition at line 72 of file nsAbLDAPReplicationQuery.h.

Definition at line 70 of file nsAbLDAPReplicationQuery.h.

Definition at line 65 of file nsAbLDAPReplicationQuery.h.

Definition at line 66 of file nsAbLDAPReplicationQuery.h.

Definition at line 57 of file nsIAbLDAPReplicationQuery.idl.

Definition at line 59 of file nsIAbLDAPReplicationQuery.idl.

Definition at line 55 of file nsIAbLDAPReplicationQuery.idl.


The documentation for this class was generated from the following files: