Examples of FilterProvider


Examples of com.fasterxml.jackson.databind.ser.FilterProvider

       
        //Clone from "shared" ObjectMapper
        mapper = mapper.copy();
       
        mapper.addMixInAnnotations(Object.class, PortletRenderExecutionEventFilterMixIn.class);
        final FilterProvider filterProvider = new SimpleFilterProvider().addFilter(PortletRenderExecutionEventFilterMixIn.FILTER_NAME, SimpleBeanPropertyFilter.filterOutAllExcept("fname", "executionTimeNano", "parameters"));
        final ObjectWriter portletEventWriter = mapper.writer(filterProvider);
       
        final String result = portletEventWriter.writeValueAsString(createEvent());
       
        assertEquals("{\"@c\":\".PortletRenderExecutionEvent\",\"fname\":\"fname1\",\"executionTimeNano\":123450000,\"parameters\":{}}", result);
View Full Code Here

Examples of com.fasterxml.jackson.databind.ser.FilterProvider

    @Test
    public final void givenTypeHasFilterThatIgnoresFieldByName_whenDtoIsSerialized_thenCorrect() throws JsonParseException, IOException {
        final ObjectMapper mapper = new ObjectMapper();
        final SimpleBeanPropertyFilter theFilter = SimpleBeanPropertyFilter.serializeAllExcept("intValue");
        final FilterProvider filters = new SimpleFilterProvider().addFilter("myFilter", theFilter);

        final MyDtoWithFilter dtoObject = new MyDtoWithFilter();
        dtoObject.setIntValue(12);

        final String dtoAsString = mapper.writer(filters).writeValueAsString(dtoObject);
View Full Code Here

Examples of com.fasterxml.jackson.databind.ser.FilterProvider

            @Override
            protected final boolean include(final PropertyWriter writer) {
                return true;
            }
        };
        final FilterProvider filters = new SimpleFilterProvider().addFilter("myFilter", theFilter);

        final MyDtoWithFilter dtoObject = new MyDtoWithFilter();
        dtoObject.setIntValue(-1);

        final ObjectMapper mapper = new ObjectMapper();
View Full Code Here

Examples of com.fasterxml.jackson.databind.ser.FilterProvider

    public void testIssue44() throws IOException
    {
        String exp = "<Issue44Bean first=\"abc\"><second>13</second></Issue44Bean>";
        Issue44Bean bean = new Issue44Bean();

        FilterProvider prov = new SimpleFilterProvider().addFilter("filter44",
                SimpleBeanPropertyFilter.serializeAllExcept("filterMe"));
        ObjectWriter writer = _xmlMapper.writer(prov);

        // as well as with proper filter
        assertEquals(exp, writer.writeValueAsString(bean));
View Full Code Here

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

    @Override
    public synchronized void addEventListener(EventListener listener, int eventTypes, String absPath,
            boolean isDeep, String[] uuid, String[] nodeTypeName, boolean noLocal) throws RepositoryException {
        boolean includeExternal = !(listener instanceof ExcludeExternal);
        FilterProvider filterProvider = new FilterProvider(ntMgr, eventTypes, oakPath(absPath), isDeep,
                uuid, validateNodeTypeNames(nodeTypeName), !noLocal, includeExternal);
        ChangeProcessor processor = processors.get(listener);
        if (processor == null) {
            log.info(OBSERVATION, "Registering event listener {} with filter {}", listener, filterProvider);
            ListenerTracker tracker = new ListenerTracker(
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)) {
                    String basePath = provider.getPath();
                    EventFilter userFilter = provider.getFilter(previousRoot, root);
                    EventFilter acFilter = new ACFilter(previousRoot, root, permissionProvider, basePath);
                    ImmutableTree beforeTree = getTree(previousRoot, basePath);
                    ImmutableTree afterTree = getTree(root, basePath);
                    EventIterable<Event> events = new EventIterable<Event>(
                            beforeTree.getNodeState(), afterTree.getNodeState(),
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)) {
                    String basePath = provider.getPath();
                    EventFilter userFilter = provider.getFilter(previousRoot, root);
                    EventFilter acFilter = new ACFilter(previousRoot, root, permissionProvider, basePath);
                    EventQueue events = new EventQueue(
                            namePathMapper, info, previousRoot, root, basePath,
                            Filters.all(userFilter, acFilter));
                    if (events.hasNext() && runningMonitor.enterIf(running)) {
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)) {
                    String basePath = provider.getPath();
                    EventFilter userFilter = provider.getFilter(previousRoot, root);
                    EventFilter acFilter = new ACFilter(previousRoot, root, permissionProvider, basePath);
                    EventQueue events = new EventQueue(
                            namePathMapper, info, previousRoot, root, basePath,
                            Filters.all(userFilter, acFilter));
                    if (events.hasNext() && runningMonitor.enterIf(running)) {
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)) {
                    String basePath = provider.getPath();
                    Filter userFilter = provider.getFilter(previousRoot, root);
                    Filter acFilter = new ACFilter(previousRoot, root, permissionProvider, basePath);
                    ImmutableTree beforeTree = getTree(previousRoot, basePath);
                    ImmutableTree afterTree = getTree(root, basePath);
                    EventIterator<Event> events = new EventIterator<Event>(
                            beforeTree.getNodeState(), afterTree.getNodeState(),
View Full Code Here

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

    @Override
    public synchronized void addEventListener(EventListener listener, int eventTypes, String absPath,
            boolean isDeep, String[] uuid, String[] nodeTypeName, boolean noLocal) throws RepositoryException {
        boolean includeExternal = !(listener instanceof ExcludeExternal);
        String oakPath = namePathMapper.getOakPath(absPath);
        FilterProvider filterProvider = new JcrFilterProvider(ntMgr, eventTypes, oakPath, isDeep,
                uuid, validateNodeTypeNames(nodeTypeName), !noLocal, includeExternal, permissionProvider);
        ChangeProcessor processor = processors.get(listener);
        if (processor == null) {
            log.info(OBSERVATION, "Registering event listener {} with filter {}", listener, filterProvider);
            ListenerTracker tracker = new ListenerTracker(
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.