net.spamcomplaint.dao
Class WhoisDAO
java.lang.Object
net.spamcomplaint.dao.WhoisDAO
public class WhoisDAO
- extends java.lang.Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WhoisDAO
public WhoisDAO(ConnectionDAO dao)
delete
public int delete(int daysOld)
throws java.sql.SQLException
- Purge whois messages over n days old.
- Parameters:
daysOld -
- Returns:
- num of records deleted
- Throws:
java.sql.SQLException
cache
public void cache(WhoisMsgStruct msg,
java.lang.String ip)
throws java.sql.SQLException,
java.security.NoSuchAlgorithmException
- Saves the Whois message if it does not already exists
- Linkes the IP address to the whois message (unless there is a link already
- Parameters:
msg - ip -
- Throws:
java.sql.SQLException
java.security.NoSuchAlgorithmException
insertWhois
public void insertWhois(WhoisMsgStruct msg)
throws java.sql.SQLException,
java.security.NoSuchAlgorithmException
- Inserts message; sets the new WhoisMsgStruct.id value from the database.
- Throws:
java.sql.SQLException
java.security.NoSuchAlgorithmException
insertWhoisIp
public void insertWhoisIp(int whoisId,
java.lang.String ip)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
selectWhoisId
public int selectWhoisId(java.lang.String uniqueSha1)
throws java.sql.SQLException
- Parameters:
uniqueSha1 -
- Returns:
- Whois_Id or -1 if an entry was not found
- Throws:
java.sql.SQLException
deleteWhois
public int deleteWhois(java.lang.String uniqueSha1)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
selectWhoisMsg
public WhoisMsgStruct selectWhoisMsg(java.lang.String ip)
throws java.sql.SQLException
- Returns:
- { Whois message found by IP } or null if one was not found
- Throws:
java.sql.SQLException
Copyright © 2008. All Rights Reserved.