Package me.z80.mongodb

Examples of me.z80.mongodb.DBException


      }
      return ids;
    }
    catch(Exception e)
    {
      throw new DBException("Failed to get specified message IDs for: "+topicId
          + ", responder: "+responderId
          + ", in state: "+state, e);
    }
  }
View Full Code Here


      logger.info("Found "+ids.size()+" messages for responder: "+responderId+", topic: "+topicId+" that have no processing state annotation");
      return ids;
    }
    catch(Exception e)
    {
      throw new DBException("Failed to get specified message IDs for: "+topicId
          + ", that had no processing state flag for responder: "+responderId, e);
    }
  }
View Full Code Here

      List<String> distinctTopicIds = collection.distinct("topicGuid");
      return distinctTopicIds;
    }
    catch(Exception e)
    {
      throw new DBException("Failed to get distinct topic IDs", e);
    }
  }
View Full Code Here

      gridFile.save(chunkSize);
      gridFile.validate();
    }
    catch(IOException e)
    {
      throw new DBException("Failed to read input file: "
          +file.getAbsolutePath(), e);
    }
  }
View Full Code Here

      throws DBException
  {
    File destinationDir = downloadTo.getParentFile();
    if (!destinationDir.exists())
    {
      throw new DBException("Specified destination directory does not exist: "
          + destinationDir.getAbsolutePath());
    }
    else if (!destinationDir.isDirectory())
    {
      throw new DBException("Specified destination 'directory' is not "
          + "actually a directory: "
          + destinationDir.getAbsolutePath());
    }
    else if (!destinationDir.canWrite())
    {
      throw new DBException("Specified destination directory is not writable: "
          + destinationDir.getAbsolutePath());
    }
    else if (downloadTo.exists())
    {
      throw new DBException("File already exists: "
          + downloadTo.getAbsolutePath());
    }

    try
    {
      logger.info("Writing: " + gridFile.getContentType()
          + ", date: " + gridFile.getUploadDate().toString()
          + ", type: " + gridFile.getContentType()
          + ", len: " + gridFile.getLength()
          + ", MD5: " + gridFile.getMD5()
          + ", Chunk size: " + gridFile.getChunkSize()
          + ", aliases: " + gridFile.getAliases()
//          + ", properties: " + gridFile.toMap()
          + ", to: " + downloadTo.getAbsolutePath());
      gridFile.writeTo(downloadTo);
    }
    catch(IOException e)
    {
      throw new DBException("Failed to retreive file: "
          + gridFile.getFilename()+", MD5: "+gridFile.getMD5(), e);
    }
  }
View Full Code Here

      }
      return gridFile;
    }
    catch(Exception e)
    {
      throw new DBException("GridFS query failure for file: " + filename, e);
    }
  }
View Full Code Here

      }
      return gridFile;
    }
    catch(Exception e)
    {
      throw new DBException("GridFS query failure for file: " + filename, e);
    }
  }
View Full Code Here

      //gridFile = fs.findOne(filename);
      gridFile = findLatestGridFileWithName(filename);
    }
    catch(Exception e)
    {
      throw new DBException("GridFS query failure for file: " + filename, e);
    }

    if (gridFile == null)
    {
      throw new DBException("Failed to find a file with the name: "+filename);
    }
    File output = new File(destinationDir, filename);
    download(gridFile, output);
  }
View Full Code Here

//      gridFile = fs.findOne(filename);
      gridFile = findLatestGridFileWithName(filename);
    }
    catch(Exception e)
    {
      throw new DBException("GridFS query failure for file: " + filename, e);
    }

    if (gridFile == null)
    {
      throw new DBException("Failed to find a file with the name: "+filename);
    }
    File output = new File(destinationDir, renameTo);
    download(gridFile, output);
  }
View Full Code Here

    {
      return fs.getFileList().count();
    }
    catch(Exception e)
    {
      throw new DBException(
          "Failed to count files in DB: "+db.getName()+", bucket: "+bucket, e);

    }
  }
View Full Code Here

TOP

Related Classes of me.z80.mongodb.DBException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.