/**
  * Returns the dir sync flags in the supplied response or -1 if no flags exists.
  *
  * @param response of a previous dir sync operation
  * @return dir sync flags or -1
  */
 protected long getDirSyncFlags(final Response<SearchResult> response) {
   long flags = -1;
   final DirSyncControl ctl = (DirSyncControl) response.getControl(DirSyncControl.OID);
   if (ctl != null) {
     flags = ctl.getFlags();
   }
   return flags;
 }