Examples of IIndexService


Examples of net.sf.logsaw.index.IIndexService

      /* (non-Javadoc)
       * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
       */
      @Override
      protected IStatus run(IProgressMonitor monitor) {
        IIndexService idx = IndexPlugin.getDefault().getIndexService();
        try {
          // Do the indexing
          setProperty(QN_RESULT, idx.synchronize(log, monitor));
        } catch (CoreException e) {
          return e.getStatus();
        }
        if (monitor.isCanceled()) {
          // Job was canceled
View Full Code Here

Examples of net.sf.logsaw.index.IIndexService

  }

  @Test
  public void testPaginationLastPage() {
    try {
      IIndexService indexService = IndexPlugin.getDefault().getIndexService();
      loadLogFile("sample-1.log.xml");
      createLogResourceWithPK("UTF-8", Locale.getDefault(), getTimeZone());
      indexService.synchronize(getLogResource(), null);
      IQueryContext ctx = indexService.createQueryContext(getLogResource());
      try {
        ResultPage p = indexService.query(ctx, new LinkedList<ARestriction<?>>(), 2, 1000);
        assertEquals(3, p.getItems().size());
        assertEquals("Setting up property manager MBean and JMX layer", p.getItems().get(0).get(Log4JFieldProvider.FIELD_MESSAGE));
        assertEquals("Starting recovery manager", p.getItems().get(1).get(Log4JFieldProvider.FIELD_MESSAGE));
        assertEquals("Recovery manager started", p.getItems().get(2).get(Log4JFieldProvider.FIELD_MESSAGE));
        assertEquals(5, p.getTotalHits());
View Full Code Here

Examples of net.sf.logsaw.index.IIndexService

  }

  @Test
  public void testContainsQuery() {
    try {
      IIndexService indexService = IndexPlugin.getDefault().getIndexService();
      loadLogFile("sample-1.log.xml");
      createLogResourceWithPK("UTF-8", Locale.getDefault(), getTimeZone());
      indexService.synchronize(getLogResource(), null);
      IQueryContext ctx = indexService.createQueryContext(getLogResource());
      try {
        List<ARestriction<?>> ops = new LinkedList<ARestriction<?>>();
        ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_MESSAGE,
            Operators.OPERATOR_CONTAINS, "recovery"));
        ResultPage p = indexService.query(ctx, ops, 0, 1000);
        assertEquals(2, p.getItems().size());
        assertEquals(2, p.getTotalHits());
      } finally {
        ctx.close();
      }
View Full Code Here

Examples of net.sf.logsaw.index.IIndexService

  }

  @Test
  public void testNotContainsQuery() {
    try {
      IIndexService indexService = IndexPlugin.getDefault().getIndexService();
      loadLogFile("sample-1.log.xml");
      createLogResourceWithPK("UTF-8", Locale.getDefault(), getTimeZone());
      indexService.synchronize(getLogResource(), null);
      IQueryContext ctx = indexService.createQueryContext(getLogResource());
      try {
        List<ARestriction<?>> ops = new LinkedList<ARestriction<?>>();
        ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_MESSAGE,
            Operators.OPERATOR_NOT_CONTAINS, "recovery"));
        ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_MESSAGE,
            Operators.OPERATOR_NOT_CONTAINS, "starting"));
        ResultPage p = indexService.query(ctx, ops, 0, 1000);
        assertEquals(3, p.getItems().size());
        assertEquals(3, p.getTotalHits());
      } finally {
        ctx.close();
      }
View Full Code Here

Examples of net.sf.logsaw.index.IIndexService

  }

  @Test
  public void testEqualsQueryWithString() {
    try {
      IIndexService indexService = IndexPlugin.getDefault().getIndexService();
      loadLogFile("sample-1.log.xml");
      createLogResourceWithPK("UTF-8", Locale.getDefault(), getTimeZone());
      indexService.synchronize(getLogResource(), null);
      IQueryContext ctx = indexService.createQueryContext(getLogResource());
      try {
        List<ARestriction<?>> ops = new LinkedList<ARestriction<?>>();
        ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_LOGGER, Operators.OPERATOR_EQUALS,
            "org.jnp.server.NamingBeanImpl"));
        ResultPage p = indexService.query(ctx, ops, 0, 1000);
        assertEquals(1, p.getItems().size());
        assertEquals(1, p.getTotalHits());
      } finally {
        ctx.close();
      }
View Full Code Here

Examples of net.sf.logsaw.index.IIndexService

  }

  @Test
  public void testNotEqualsQueryWithString() {
    try {
      IIndexService indexService = IndexPlugin.getDefault().getIndexService();
      loadLogFile("sample-1.log.xml");
      createLogResourceWithPK("UTF-8", Locale.getDefault(), getTimeZone());
      indexService.synchronize(getLogResource(), null);
      IQueryContext ctx = indexService.createQueryContext(getLogResource());
      try {
        List<ARestriction<?>> ops = new LinkedList<ARestriction<?>>();
        ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_LOGGER, Operators.OPERATOR_NOT_EQUALS,
            "org.jnp.server.NamingBeanImpl"));
        ResultPage p = indexService.query(ctx, ops, 0, 1000);
        assertEquals(4, p.getItems().size());
        assertEquals(4, p.getTotalHits());
      } finally {
        ctx.close();
      }
View Full Code Here

Examples of net.sf.logsaw.index.IIndexService

  }

  @Test
  public void testBeginsWithQuery() {
    try {
      IIndexService indexService = IndexPlugin.getDefault().getIndexService();
      loadLogFile("sample-1.log.xml");
      createLogResourceWithPK("UTF-8", Locale.getDefault(), getTimeZone());
      indexService.synchronize(getLogResource(), null);
      IQueryContext ctx = indexService.createQueryContext(getLogResource());
      try {
        List<ARestriction<?>> ops = new LinkedList<ARestriction<?>>();
        ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_LOGGER, Operators.OPERATOR_BEGINS_WITH,
            "com.arjuna.ats.jbossatx.jta"));
        ResultPage p = indexService.query(ctx, ops, 0, 1000);
        assertEquals(4, p.getItems().size());
        assertEquals(4, p.getTotalHits());
      } finally {
        ctx.close();
      }
View Full Code Here

Examples of net.sf.logsaw.index.IIndexService

  }

  @Test
  public void testNotBeginsWithQuery() {
    try {
      IIndexService indexService = IndexPlugin.getDefault().getIndexService();
      loadLogFile("sample-1.log.xml");
      createLogResourceWithPK("UTF-8", Locale.getDefault(), getTimeZone());
      indexService.synchronize(getLogResource(), null);
      IQueryContext ctx = indexService.createQueryContext(getLogResource());
      try {
        List<ARestriction<?>> ops = new LinkedList<ARestriction<?>>();
        ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_LOGGER, Operators.OPERATOR_NOT_BEGINS_WITH,
            "com.arjuna.ats.jbossatx.jta"));
        ResultPage p = indexService.query(ctx, ops, 0, 1000);
        assertEquals(1, p.getItems().size());
        assertEquals(1, p.getTotalHits());
      } finally {
        ctx.close();
      }
View Full Code Here

Examples of net.sf.logsaw.index.IIndexService

  }

  @Test
  public void testBeforeQuery() {
    try {
      IIndexService indexService = IndexPlugin.getDefault().getIndexService();
      loadLogFile("sample-1.log.xml");
      createLogResourceWithPK("UTF-8", Locale.getDefault(), getTimeZone());
      indexService.synchronize(getLogResource(), null);
      IQueryContext ctx = indexService.createQueryContext(getLogResource());
      try {
        List<ARestriction<?>> ops = new LinkedList<ARestriction<?>>();
        ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_TIMESTAMP,
            Operators.OPERATOR_BEFORE, new Date(1248183795937L)));
        ResultPage p = indexService.query(ctx, ops, 0, 1000);
        assertEquals(1, p.getItems().size());
        assertEquals(1, p.getTotalHits());
      } finally {
        ctx.close();
      }
View Full Code Here

Examples of net.sf.logsaw.index.IIndexService

  }

  @Test
  public void testAfterQuery() {
    try {
      IIndexService indexService = IndexPlugin.getDefault().getIndexService();
      loadLogFile("sample-1.log.xml");
      createLogResourceWithPK("UTF-8", Locale.getDefault(), getTimeZone());
      indexService.synchronize(getLogResource(), null);
      IQueryContext ctx = indexService.createQueryContext(getLogResource());
      try {
        List<ARestriction<?>> ops = new LinkedList<ARestriction<?>>();
        ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_TIMESTAMP,
            Operators.OPERATOR_AFTER, new Date(1248183796156L)));
        ResultPage p = indexService.query(ctx, ops, 0, 1000);
        assertEquals(1, p.getItems().size());
        assertEquals(1, p.getTotalHits());
      } finally {
        ctx.close();
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.