Package org.jwall.rbl.data

Examples of org.jwall.rbl.data.RBListEntry


       
        if( !server.getDomain().startsWith( "." ) )
          key.append( "." );
        key.append( server.getDomain() );
       
        RBListEntry entry = new RBListEntry( null, key.toString() );
        entry.setName( args[1] );
        entry.setCreated( System.currentTimeMillis() );
        try {
          if( args.length > 2 )
            entry.setLifetime( new Integer( args[2] ) );
        } catch (Exception e) {
          entry.setLifetime( 60 );
        }
       
        entry.setComment( "" );
        server.getBlockList().add( entry );
        out.println( "# Address '" + entry.getName() + "' added to block-list." );
      } catch (Exception e) {
        out.println( "# Failed to create address '" + args[1] + "' - " + e.getMessage() );
        e.printStackTrace();
        return;
      }
View Full Code Here


  public void block( String address, Integer ttl ){

    String key = QueryHandler.getKeyForAddress( address, getDomain() );
    log.debug( "Adding rbl-entry with key = '{}'", key );
    RBListEntry entry = new RBListEntry( null, key );
    entry.setName( address );
    entry.setCreated( System.currentTimeMillis() );
    entry.setLifetime( ttl );
    getBlockList().add(entry);
  }
View Full Code Here

      if( !queryValue.endsWith( "." ) && !queryValue.endsWith( domain ) )
        queryValue = queryValue + "." + domain;

      if( sect.getQClass() == QuerySection.QUERY_TYPE_PTR ){

        RBListEntry entry = server.getBlockList().lookup( queryValue );
        if( entry != null && ! entry.isExpired() ){
          response.add( new PtrRecord( queryValue, queryValue, entry.getRemainingLifetime() ) );
        } else {
          response.setStatus( Response.RC_NAME_ERROR );
          break;
        }
      }

      if( sect.getQType() == QuerySection.QUERY_TYPE_A ){
        queryValue = this.preprocess( source, queryValue );

        RBListEntry entry = server.getBlockList().lookup( queryValue );
        if( entry != null && !entry.isExpired() ){
          log.debug( "Entry '{}' is on block list and will expire in {} seconds", queryValue, entry.getRemainingLifetime() );
          response.add( new ARecord( queryValue, RblServer.BLOCKED_VALUE, entry.getRemainingLifetime() ) );
        } else {
          log.debug( "Removing expired entry..." );
          response.setStatus( Response.RC_NAME_ERROR );
          if( entry != null )
            server.getBlockList().remove( entry.getName() );
        }
      } else {
        response.setStatus( Response.RC_NAME_ERROR );
      }
    }
View Full Code Here

        if (!server.getDomain().startsWith("."))
          key.append(".");
        key.append(server.getDomain());

        RBListEntry entry = new RBListEntry(null, key.toString());
        entry.setName(args[1]);
        entry.setCreated(System.currentTimeMillis());
        try {
          if (args.length > 2)
            entry.setLifetime(new Integer(args[2]));
        } catch (Exception e) {
          entry.setLifetime(60);
        }

        entry.setComment("");
        server.getBlockList().add(entry);
        out.println("# Address '" + entry.getName()
            + "' added to block-list.");
      } catch (Exception e) {
        out.println("# Failed to create address '" + args[1] + "' - "
            + e.getMessage());
        e.printStackTrace();
View Full Code Here

  public void block(String address, Integer ttl) {

    String key = QueryHandler.getKeyForAddress(address, getDomain());
    log.debug("Adding rbl-entry with key = '{}'", key);
    RBListEntry entry = new RBListEntry(null, key);
    entry.setName(address);
    entry.setCreated(System.currentTimeMillis());
    entry.setLifetime(ttl);
    getBlockList().add(entry);
  }
View Full Code Here

TOP

Related Classes of org.jwall.rbl.data.RBListEntry

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.