public void createEvent ( String eventName , String entityType , String entityId , String targetEntityType , String targetEntityId , Map < String , Object > properties , DateTime eventTime ) throws IOException { if ( eventTime == null ) { eventTime = new DateTime ( ) ; } Event event = new Event ( ) . event ( eventName ) . entityType ( entityType ) . entityId ( entityId ) . eventTime ( eventTime ) ; if ( targetEntityType != null ) { event . targetEntityType ( targetEntityType ) ; } if ( targetEntityId != null ) { event . targetEntityId ( targetEntityId ) ; } if ( properties != null ) { event . properties ( properties ) ; } out . write ( event . toJsonString ( ) . getBytes ( "UTF8" ) ) ; out . write ( ' ' ) ; }
Create and write a json - encoded event to the underlying file .