// retrieve all MailboxDump requests with fromDate query.
LOGGER.log(Level.INFO, "\n------retrieveAllMailboxDumpRequests with fromDate---- ");
Calendar c = Calendar.getInstance();
List<GenericEntry> entries = service.retrieveAllMailboxDumpRequests(c.getTime());
for (GenericEntry sampleEntry2 : entries) {
MailBoxDumpRequest request = new MailBoxDumpRequest(sampleEntry2);
LOGGER.log(Level.INFO, "All requests -" + sampleEntry2.getAllProperties().toString());
}
/*
* retrieve all MailboxDump requests without fromDate query. This will
* retrieve all requests made in the last 3 weeks.
*/
LOGGER.log(Level.INFO, "\n------------retrieveAllMailboxDumpRequests-------------");
entries = service.retrieveAllMailboxDumpRequests(null);
for (GenericEntry sampleEntry2 : entries) {
MailBoxDumpRequest request = new MailBoxDumpRequest(sampleEntry2);
LOGGER.log(Level.INFO, "All requests -" + sampleEntry2.getAllProperties().toString());
}
// Create MailboxDumpRequest
MailBoxDumpRequest request = new MailBoxDumpRequest();
request.setAdminEmailAddress(adminEmail);
c.add(Calendar.MONTH, -1);
request.setEndDate(c.getTime());
c.add(Calendar.MONTH, -1);
request.setBeginDate(c.getTime());
request.setPackageContent("FULL_MESSAGE");
request.setSearchQuery("in:chats");
request.setIncludeDeleted(false);
request.setUserEmailAddress(user + "@" + domain);
LOGGER.log(Level.INFO, "\n-------------createMailboxDumpRequest-------------");
sampleEntry = service.createMailboxDumpRequest(request);
LOGGER.log(Level.INFO, "\nCreated request - " + sampleEntry.getAllProperties().toString());
String createdId = sampleEntry.getProperty("requestId");