question: public void addMutedIp ( final String ip , final Date muteTill ) { if ( isIpMuted ( ip ) ) { removeMutedIp ( ip ) ; } Timestamp muteTillTs = null ; if ( muteTill != null ) { muteTillTs = new Timestamp ( muteTill . getTime ( ) ) ; } s_logger . fine ( "Muting ip:" + ip ) ; final Connection con = Database . getConnection ( ) ; try { final PreparedStatement ps = con . prepareStatement ( "insert into muted_ips (ip, mute_till) values (?, ?)" ) ; ps . setString ( 1 , ip ) ; ps . setTimestamp ( 2 , muteTillTs ) ; ps . execute ( ) ; ps . close ( ) ; con . commit ( ) ; } catch ( final SQLException sqle ) { if ( sqle . getErrorCode ( ) == 30000 ) { s_logger . info ( "Tried to create duplicate muted ip:" + ip + " error:" + sqle . getMessage ( ) ) ; return ; } s_logger . log ( Level . SEVERE , "Error inserting muted ip:" + ip , sqle ) ; throw new IllegalStateException ( sqle . getMessage ( ) ) ; } finally { DbUtil . closeConnection ( con ) ; } }
target:  Mute the given ip. If muteTill is not null, the mute will expire when muteTill is reached. <p> If this ip is already muted, this call will update the mute_end.