Tabnine Logo
ElasticSearchIndexer.deleteAllMatchingQuery
Code IndexAdd Tabnine to your IDE (free)

How to use
deleteAllMatchingQuery
method
in
org.apache.james.backends.es.ElasticSearchIndexer

Best Java code snippets using org.apache.james.backends.es.ElasticSearchIndexer.deleteAllMatchingQuery (Showing top 3 results out of 315)

origin: org.apache.james/apache-james-mailbox-elasticsearch

@Override
public void deleteAll(MailboxSession session, Mailbox mailbox) throws MailboxException {
  try {
    elasticSearchIndexer.deleteAllMatchingQuery(
      termQuery(
        JsonMessageConstants.MAILBOX_ID,
        mailbox.getMailboxId().serialize()));
  } catch (Exception e) {
    LOGGER.error("Error when deleting all messages in mailbox {}", mailbox.getMailboxId().serialize(), e);
  }
}
origin: org.apache.james/apache-james-mailbox-elasticsearch

@Test
public void deleteAllShouldNotPropagateExceptionWhenExceptionOccurs() throws Exception {
  //Given
  Mailbox mailbox = mock(Mailbox.class);
  when(mailbox.getMailboxId())
    .thenReturn(MAILBOX_ID);
  doThrow(RuntimeException.class)
    .when(elasticSearchIndexer).deleteAllMatchingQuery(QueryBuilders.termQuery("mailboxId", "12"));
  //When
  testee.deleteAll(session, mailbox);
  
  //Then
  //No Exception
}
origin: org.apache.james/apache-james-mailbox-elasticsearch

@Test
public void deleteAllShouldWork() throws Exception {
  //Given
  Mailbox mailbox = mock(Mailbox.class);
  when(mailbox.getMailboxId())
    .thenReturn(MAILBOX_ID);
  //When
  testee.deleteAll(session, mailbox);
  
  //Then
  QueryBuilder expectedQueryBuilder = QueryBuilders.termQuery("mailboxId", "12");
  verify(elasticSearchIndexer).deleteAllMatchingQuery(refEq(expectedQueryBuilder));
}
org.apache.james.backends.esElasticSearchIndexerdeleteAllMatchingQuery

Popular methods of ElasticSearchIndexer

  • index
  • <init>
  • delete
  • update
  • checkArgument

Popular in Java

  • Running tasks concurrently on multiple threads
  • addToBackStack (FragmentTransaction)
  • onCreateOptionsMenu (Activity)
  • setContentView (Activity)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Menu (java.awt)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • JFileChooser (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now