Package org.jwall.web.audit

Examples of org.jwall.web.audit.AuditEvent


        files.clear();
    }

    public AuditEvent readNext() throws IOException, ParseException
    {
        AuditEvent evt = null;
        File file = null;

        if( reader != null ){
            log.debug( "Trying to read next event from current file..." );
            try {
View Full Code Here


            // the A-section is empty - it seems that the EOF has been reached
            //
            if(data[0].equals(""))
                return null;
           
            AuditEvent event = eventFactory.createAuditEvent( id, data, inputFile, offset, (long) bytesRead - offset, AuditEventType.ModSecurity2 );
            return event;
           
        } catch ( EOFException eof ) {
           
            eofReached = true;
View Full Code Here

    @Override
  public void run() {
      while( true ){
        try {
          AuditEvent event = readNext();
          listener.eventArrived( event );
        } catch (Exception e) {
          e.printStackTrace();
          System.exit(0);
          return;
View Full Code Here

   * @see stream.io.AbstractDataStream#read()
   */
  @Override
  public Data readNext() throws Exception {

    AuditEvent evt = reader.readNext();
    if (evt == null)
      return null;

    Data item = DataFactory.create();
    item.put("event", evt);
View Full Code Here

     * @see java.util.Iterator#next()
     */
    @Override
    public AuditEvent next()
    {
        AuditEvent event = next;
        try {
            next = reader.readNext();
        } catch (Exception e ){
            next = null;
        }
View Full Code Here

      r.mark(4096);

    try {
      String line = r.readLine();
      if (line != null) {
        AuditEvent evt = AccessLogAuditReader.createEvent(line);
        if (evt != null) {
          if (r.markSupported())
            r.reset();
          return true;
        }
View Full Code Here

        if(! evtFile.canRead() )
            throw new IOException("Cannot read event from file: "+evtFile.getAbsolutePath() );
       
        try {
          AbstractAuditEventReader ms2ar = new ModSecurity2AuditReader( evtFile );
          AuditEvent evt = ms2ar.readNext();
          ms2ar.close();
          return evt;
        } catch (Exception e){
          throw new IOException( e.getMessage() );
        }
View Full Code Here

    while( !finished ){

      try {
        int count = 0;
        while(! queue.isEmpty()){
          AuditEvent evt = queue.poll();

          if(evt != null){
            writeEvent(evt);
            if( count++ % 100 == 0 )
              System.out.print("w");
View Full Code Here

        in = new GZIPInputStream( socket.getInputStream() );
      else
        in = socket.getInputStream();
     
      ModSecurity2AuditStream reader = new ModSecurity2AuditStream( in, this );
      AuditEvent evt = reader.readNext();
      while( evt != null && !socket.isClosed() ){
        //out.println( line );
        //line = r.readLine();
        eventArrived( evt );
        evt = reader.readNext();
View Full Code Here

            // the A-section is empty - it seems that the EOF has been reached
            //
            if(data[0].equals(""))
                return null;
           
            AuditEvent event = eventFactory.createAuditEvent( id, data, inputFile, offset, (long) bytesRead - offset, AuditEventType.ModSecurity2 );
            event.set( AuditEvent.SENSOR_NAME, sensor );
            return event;
           
        } catch ( EOFException eof ) {
            System.out.println( "End-of-file reached!" );
            eofReached = true;
View Full Code Here

TOP

Related Classes of org.jwall.web.audit.AuditEvent

Copyright © 2018 www.massapicom. 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.