Examples of FilterProvider


Examples of org.apache.jackrabbit.oak.plugins.observation.filter.FilterProvider

    @Override
    public void contentChanged(@Nonnull NodeState root, @Nullable CommitInfo info) {
        if (previousRoot != null) {
            try {
                FilterProvider provider = filterProvider.get();
                // FIXME don't rely on toString for session id
                if (provider.includeCommit(contentSession.toString(), info)) {
                    ImmutableTree beforeTree = getTree(previousRoot, provider.getPath());
                    ImmutableTree afterTree = getTree(root, provider.getPath());
                    EventIterator<Event> events = new EventIterator<Event>(
                            beforeTree.getNodeState(), afterTree.getNodeState(),
                            provider.getFilter(beforeTree, afterTree),
                            new JcrListener(beforeTree, afterTree, namePathMapper, info));
                    if (events.hasNext()) {
                        synchronized (this) {
                            if (!stopping) {
                                eventListener.onEvent(new EventIteratorAdapter(events));
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.observation.filter.FilterProvider

    @Override
    public void contentChanged(@Nonnull NodeState root, @Nullable CommitInfo info) {
        if (previousRoot != null) {
            try {
                FilterProvider provider = filterProvider.get();
                // FIXME don't rely on toString for session id
                if (provider.includeCommit(contentSession.toString(), info)) {
                    EventFilter filter = provider.getFilter(previousRoot, root);
                    EventIterator events = new EventQueue(namePathMapper, info, previousRoot, root,
                            provider.getSubTrees(), Filters.all(filter, VISIBLE_FILTER));

                    if (events.hasNext() && runningMonitor.enterIf(running)) {
                        try {
                            CountingIterator countingEvents = new CountingIterator(events);
                            eventListener.onEvent(countingEvents);
View Full Code Here

Examples of org.codehaus.jackson.map.ser.FilterProvider

   
    // should also work for @JsonAnyGetter, as per [JACKSON-516]
    public void testAnyGetterFiltering() throws Exception
    {
        ObjectMapper mapper = new ObjectMapper();
        FilterProvider prov = new SimpleFilterProvider().addFilter("anyFilter",
                SimpleBeanPropertyFilter.filterOutAllExcept("b"));
        assertEquals("{\"a\":\"1\"}", mapper.writer(prov).writeValueAsString(new AnyBean()));
    }
View Full Code Here

Examples of org.codehaus.jackson.map.ser.FilterProvider

  JsonGenerationException, JsonMappingException, IOException {
    ObjectMapper mapper = new ObjectMapper();
    mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
    mapper.configure(SerializationConfig.Feature.USE_ANNOTATIONS, true);
    if (ignoreConfigs) {
    FilterProvider filters = new SimpleFilterProvider().addFilter(
          "propertiesfilter",
          SimpleBeanPropertyFilter.serializeAllExcept("properties"));
      mapper.setFilters(filters);
    } else {
      FilterProvider filters = new SimpleFilterProvider().addFilter(
          "propertiesfilter", SimpleBeanPropertyFilter.serializeAllExcept());
      mapper.setFilters(filters);
    }
    String json = mapper.writeValueAsString(object);
    return json;
View Full Code Here

Examples of org.codehaus.jackson.map.ser.FilterProvider

    @Override
    public <T> String serializeAllExceptFilter(Object src,
            Class<T> filterClass, Boolean refreshFilter, String... filterAttr)
            throws Exception {
        setCustomIntrospectorWithExternalFilterId(filterClass);
        FilterProvider filter = null;
        if ( filterClass != null) {
            if (filterAttr != null && filterAttr.length > 0 &&
                            !this.filters.containsKey(filterClass.getName())) {
                filter = new SimpleFilterProvider().addFilter(
                        filterClass.getName(),
View Full Code Here

Examples of org.codehaus.jackson.map.ser.FilterProvider

   
    @Override
    public <T> String serializeOnlyFilter(Object src, Class<T> filterClass,
            Boolean refreshFilter, String... filterAttr) throws Exception {
        setCustomIntrospectorWithExternalFilterId(filterClass);
        FilterProvider filter = null;
        if (filterClass == null && src != null && src.getClass() != null) {
            filterClass =(Class<T>) src.getClass();
        }
        if ( filterClass != null) {
            if (!this.filters.containsKey(filterClass.getName())) {
View Full Code Here

Examples of org.restlet.ext.osgi.FilterProvider

  public void testPassingFilterRouter()
  {
    ApplicationProvider applicationProvider = new TestApplicationProvider();
    RouterProvider routerProvider = new RouterProvider();
    ResourceProvider resourceProvider = new TestResourceProvider();
    FilterProvider filterProvider = new TestFilterProvider(Filter.CONTINUE);

    routerProvider.bindResourceProvider(resourceProvider);
    routerProvider.bindFilterProvider(filterProvider);
    applicationProvider.bindRouterProvider(routerProvider);

    restletServletService.bindHttpService(httpService);
    restletServletService.bindApplicationProvider(applicationProvider);

    ClientResource client = createResource("/junit/");
    String result = client.get(String.class);
    assertThat(result, is("JUnit"));
    assertTrue(((TestFilter) filterProvider.getFilter()).isBeforeHandleCalled());
  }
View Full Code Here

Examples of org.restlet.ext.osgi.FilterProvider

  public void testBlockingFilterRouter()
  {
    ApplicationProvider applicationProvider = new TestApplicationProvider();
    RouterProvider routerProvider = new RouterProvider();
    ResourceProvider resourceProvider = new TestResourceProvider();
    FilterProvider filterProvider = new TestFilterProvider(Filter.STOP);

    routerProvider.bindResourceProvider(resourceProvider);
    routerProvider.bindFilterProvider(filterProvider);
    applicationProvider.bindRouterProvider(routerProvider);

    restletServletService.bindHttpService(httpService);
    restletServletService.bindApplicationProvider(applicationProvider);

    ClientResource client = createResource("/junit/");
    String result = client.get(String.class);
    assertThat(result, is(nullValue()));
    assertTrue(((TestFilter) filterProvider.getFilter()).isBeforeHandleCalled());
  }
View Full Code Here

Examples of org.restlet.ext.osgi.FilterProvider

  public void testFilterResource()
  {
    ApplicationProvider applicationProvider = new TestApplicationProvider();
    RouterProvider routerProvider = new RouterProvider();
    ResourceProvider resourceProvider = new TestResourceProvider();
    FilterProvider filterProvider = new TestFilterProvider(Filter.STOP);

    applicationProvider.bindRouterProvider(routerProvider);
    resourceProvider.bindFilterProvider(filterProvider);
    routerProvider.bindResourceProvider(resourceProvider);

    restletServletService.bindHttpService(httpService);
    restletServletService.bindApplicationProvider(applicationProvider);

    ClientResource client = createResource("/junit/");
    String result = client.get(String.class);
    assertThat(result, is(nullValue()));
    assertTrue(((TestFilter) filterProvider.getFilter()).isBeforeHandleCalled());
  }
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.