Back to index

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

#include <nsAbLDAPChangeLogQuery.h>

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

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIABLDAPCHANGELOGQUERY 
nsAbLDAPChangeLogQuery ()
virtual ~nsAbLDAPChangeLogQuery ()
NS_IMETHOD DoReplicationQuery ()
NS_IMETHOD Init (const nsACString &aPrefName, nsIWebProgressListener *aProgressListener)
void queryAuthDN (in AUTF8String aValueUsedToFindDn)
 Starts an LDAP query to find auth DN.
void queryRootDSE ()
 Starts an LDAP query to search server's Root DSE.
void queryChangeLog (in AUTF8String aChangeLogDN, in PRInt32 aLastChangeNo)
 Starts an LDAP ChangeLog query to find changelog entries.
void queryChangedEntries (in AUTF8String aChangedEntryDN)
 Starts an LDAP query to find changed entries.
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 47 of file nsAbLDAPChangeLogQuery.h.


Constructor & Destructor Documentation

Definition at line 72 of file nsAbLDAPChangeLogQuery.cpp.

{
}

Definition at line 76 of file nsAbLDAPChangeLogQuery.cpp.

{

}

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

Definition at line 106 of file nsAbLDAPChangeLogQuery.cpp.

{
    if(!mInitialized) 
        return NS_ERROR_NOT_INITIALIZED;

#ifdef USE_AUTHDLG
    return ConnectToLDAPServer(mURL, EmptyCString());
#else
    mDataProcessor->PopulateAuthData();
    return ConnectToLDAPServer(mURL, mAuthDN);
#endif
}

Starts an LDAP query to do replication as needed.

NS_IMETHODIMP nsAbLDAPChangeLogQuery::Init ( const nsACString &  aPrefName,
nsIWebProgressListener aProgressListener 
)

Definition at line 84 of file nsAbLDAPChangeLogQuery.cpp.

{
    if(aPrefName.IsEmpty()) 
        return NS_ERROR_UNEXPECTED;

    mDirPrefName = aPrefName;

    nsresult rv = InitLDAPData();
    if(NS_FAILED(rv)) 
        return rv;

    // create the ChangeLog Data Processor
    mDataProcessor =  do_CreateInstance(NS_ABLDAP_PROCESSCHANGELOGDATA_CONTRACTID, &rv);
    if(NS_FAILED(rv)) 
        return rv;

    // 'this' initialized
    mInitialized = PR_TRUE;

    return mDataProcessor->Init(this, aProgressListener);
}

Here is the call graph for this function:

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.

void nsIAbLDAPChangeLogQuery::queryAuthDN ( in AUTF8String  aValueUsedToFindDn) [inherited]

Starts an LDAP query to find auth DN.

void nsIAbLDAPChangeLogQuery::queryChangedEntries ( in AUTF8String  aChangedEntryDN) [inherited]

Starts an LDAP query to find changed entries.

void nsIAbLDAPChangeLogQuery::queryChangeLog ( in AUTF8String  aChangeLogDN,
in PRInt32  aLastChangeNo 
) [inherited]

Starts an LDAP ChangeLog query to find changelog entries.

Starts an LDAP query to search server's Root DSE.


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: