cleanups - final, init, pkg private

This commit is contained in:
zzz
2011-01-19 15:05:28 +00:00
parent 7538766c88
commit 7b9f98721d
8 changed files with 25 additions and 31 deletions

View File

@ -18,15 +18,14 @@ import net.i2p.data.i2np.GarlicClove;
* Wrap up the data contained in a CloveMessage after being decrypted
*
*/
public class CloveSet {
private List _cloves;
class CloveSet {
private final List _cloves;
private Certificate _cert;
private long _msgId;
private long _expiration;
public CloveSet() {
_cloves = new ArrayList();
_cert = null;
_msgId = -1;
_expiration = -1;
}

View File

@ -21,13 +21,13 @@ import net.i2p.data.i2np.DeliveryInstructions;
* Define the contents of a garlic chunk that contains 1 or more sub garlics
*
*/
public class GarlicConfig {
class GarlicConfig {
private RouterInfo _recipient;
private PublicKey _recipientPublicKey;
private Certificate _cert;
private long _id;
private long _expiration;
private List _cloveConfigs;
private final List _cloveConfigs;
private DeliveryInstructions _instructions;
private boolean _requestAck;
private RouterInfo _replyThroughRouter; // router through which any replies will be sent before delivery to us

View File

@ -21,7 +21,7 @@ import net.i2p.router.RouterContext;
*
*/
public class GarlicMessageHandler implements HandlerJobBuilder {
private RouterContext _context;
private final RouterContext _context;
public GarlicMessageHandler(RouterContext context) {
_context = context;

View File

@ -24,9 +24,9 @@ import net.i2p.util.Log;
* Read a GarlicMessage, decrypt it, and return the resulting CloveSet
*
*/
public class GarlicMessageParser {
private Log _log;
private RouterContext _context;
class GarlicMessageParser {
private final Log _log;
private final RouterContext _context;
public GarlicMessageParser(RouterContext context) {
_context = context;

View File

@ -26,11 +26,11 @@ import net.i2p.util.Log;
*
*/
public class GarlicMessageReceiver {
private RouterContext _context;
private Log _log;
private CloveReceiver _receiver;
private Hash _clientDestination;
private GarlicMessageParser _parser;
private final RouterContext _context;
private final Log _log;
private final CloveReceiver _receiver;
private final Hash _clientDestination;
private final GarlicMessageParser _parser;
private final static int FORWARD_PRIORITY = 50;

View File

@ -28,9 +28,9 @@ import net.i2p.util.Log;
* need to be. soon)
*
*/
public class HandleGarlicMessageJob extends JobImpl implements GarlicMessageReceiver.CloveReceiver {
private Log _log;
private GarlicMessage _message;
class HandleGarlicMessageJob extends JobImpl implements GarlicMessageReceiver.CloveReceiver {
private final Log _log;
private final GarlicMessage _message;
//private RouterIdentity _from;
//private Hash _fromHash;
//private Map _cloves; // map of clove Id --> Expiration of cloves we've already seen

View File

@ -19,7 +19,6 @@ public class PayloadGarlicConfig extends GarlicConfig {
public PayloadGarlicConfig() {
super();
_payload = null;
}
/**

View File

@ -22,16 +22,16 @@ import net.i2p.router.RouterContext;
import net.i2p.util.Log;
public class SendMessageDirectJob extends JobImpl {
private Log _log;
private I2NPMessage _message;
private Hash _targetHash;
private final Log _log;
private final I2NPMessage _message;
private final Hash _targetHash;
private RouterInfo _router;
private long _expiration;
private int _priority;
private Job _onSend;
private ReplyJob _onSuccess;
private Job _onFail;
private MessageSelector _selector;
private final long _expiration;
private final int _priority;
private final Job _onSend;
private final ReplyJob _onSuccess;
private final Job _onFail;
private final MessageSelector _selector;
private boolean _alreadySearched;
private boolean _sent;
private long _searchOn;
@ -47,7 +47,6 @@ public class SendMessageDirectJob extends JobImpl {
_log = getContext().logManager().getLog(SendMessageDirectJob.class);
_message = message;
_targetHash = toPeer;
_router = null;
if (timeoutMs < 10*1000) {
if (_log.shouldLog(Log.WARN))
_log.warn("Very little time given [" + timeoutMs + "], resetting to 5s", new Exception("stingy bastard"));
@ -56,8 +55,6 @@ public class SendMessageDirectJob extends JobImpl {
_expiration = timeoutMs + ctx.clock().now();
}
_priority = priority;
_searchOn = 0;
_alreadySearched = false;
_onSend = onSend;
_onSuccess = onSuccess;
_onFail = onFail;
@ -66,7 +63,6 @@ public class SendMessageDirectJob extends JobImpl {
throw new IllegalArgumentException("Attempt to send a null message");
if (_targetHash == null)
throw new IllegalArgumentException("Attempt to send a message to a null peer");
_sent = false;
}
public String getName() { return "Send Message Direct"; }