@ Override public void onEvent ( final javax . jcr . observation . EventIterator events ) { Session lookupSession = null ; try { lookupSession = getJcrSession ( repository . login ( ) ) ; @ SuppressWarnings ( "unchecked" ) final Iterator < Event > filteredEvents = filter ( events , eventFilter :: test ) ; eventMapper . apply ( iteratorToStream ( filteredEvents ) ) . map ( filterAndDerefResourceTypes ( lookupSession ) ) . flatMap ( handleMoveEvents ( lookupSession ) ) . forEach ( this :: post ) ; } finally { if ( lookupSession != null ) { lookupSession . logout ( ) ; } } }
Filter JCR events and transform them into our own FedoraEvents .