Added @Deprecated annotations to router classes/methods

This commit is contained in:
z3r0fox
2016-02-06 20:39:58 +00:00
parent f9cf6bdc85
commit 79bb3f6cc4
48 changed files with 102 additions and 0 deletions

View File

@@ -52,6 +52,7 @@ public class DeliveryInstructions extends DataStructureImpl {
private final static int FLAG_MODE_TUNNEL = 3;
/** @deprecated unused */
@Deprecated
private final static long FLAG_ENCRYPTED = 128;
private final static long FLAG_MODE = 96;
private final static long FLAG_DELAY = 16;
@@ -84,24 +85,28 @@ public class DeliveryInstructions extends DataStructureImpl {
* For cloves only (not tunnels), default false, unused
* @deprecated unused
*/
@Deprecated
public boolean getEncrypted() { return /* _encrypted */ false; }
/**
* For cloves only (not tunnels), default false, unused
* @deprecated unused
*/
@Deprecated
public void setEncrypted(boolean encrypted) { /* _encrypted = encrypted; */ }
/**
* For cloves only (not tunnels), default null, unused
* @deprecated unused
*/
@Deprecated
public SessionKey getEncryptionKey() { return /* _encryptionKey */ null; }
/**
* For cloves only (not tunnels), default null, unused
* @deprecated unused
*/
@Deprecated
public void setEncryptionKey(SessionKey key) { /* _encryptionKey = key; */ }
/** default -1 */
@@ -132,29 +137,34 @@ public class DeliveryInstructions extends DataStructureImpl {
* default false, unused
* @deprecated unused
*/
@Deprecated
public boolean getDelayRequested() { return _delayRequested; }
/**
* default false, unused
* @deprecated unused
*/
@Deprecated
public void setDelayRequested(boolean req) { _delayRequested = req; }
/**
* default 0, unused
* @deprecated unused
*/
@Deprecated
public long getDelaySeconds() { return _delaySeconds; }
/**
* default 0, unused
* @deprecated unused
*/
@Deprecated
public void setDelaySeconds(long seconds) { _delaySeconds = seconds; }
/**
* @deprecated unused
*/
@Deprecated
public void readBytes(InputStream in) throws DataFormatException, IOException {
long flags = DataHelper.readLong(in, 1);
//if (_log.shouldLog(Log.DEBUG))
@@ -423,6 +433,7 @@ public class DeliveryInstructions extends DataStructureImpl {
/**
* @deprecated unused
*/
@Deprecated
public void writeBytes(OutputStream out) throws DataFormatException, IOException {
if ( (_deliveryMode < 0) || (_deliveryMode > FLAG_MODE_TUNNEL) ) throw new DataFormatException("Invalid data: mode = " + _deliveryMode);
long flags = getFlags();

View File

@@ -53,6 +53,7 @@ public abstract class FastI2NPMessageImpl extends I2NPMessageImpl {
* @deprecated unused
* @throws UnsupportedOperationException
*/
@Deprecated
@Override
public void readBytes(InputStream in) throws DataFormatException, IOException {
throw new UnsupportedOperationException();
@@ -62,6 +63,7 @@ public abstract class FastI2NPMessageImpl extends I2NPMessageImpl {
* @deprecated unused
* @throws UnsupportedOperationException
*/
@Deprecated
@Override
public int readBytes(InputStream in, int type, byte buffer[]) throws I2NPMessageException, IOException {
throw new UnsupportedOperationException();
@@ -118,6 +120,7 @@ public abstract class FastI2NPMessageImpl extends I2NPMessageImpl {
* @deprecated unused
* @throws UnsupportedOperationException
*/
@Deprecated
@Override
public void writeBytes(OutputStream out) throws DataFormatException, IOException {
throw new UnsupportedOperationException();

View File

@@ -60,6 +60,7 @@ public class GarlicClove extends DataStructureImpl {
* @deprecated unused, use byte array method to avoid copying
* @throws UnsupportedOperationException always
*/
@Deprecated
public void readBytes(InputStream in) throws DataFormatException, IOException {
throw new UnsupportedOperationException();
/****
@@ -119,6 +120,7 @@ public class GarlicClove extends DataStructureImpl {
* @deprecated unused, use byte array method to avoid copying
* @throws UnsupportedOperationException always
*/
@Deprecated
public void writeBytes(OutputStream out) throws DataFormatException, IOException {
throw new UnsupportedOperationException();
/****

View File

@@ -48,6 +48,7 @@ public interface I2NPMessage extends DataStructure {
* @throws IOException if there is a problem reading from the stream
* @deprecated unused
*/
@Deprecated
public int readBytes(InputStream in, int type, byte buffer[]) throws I2NPMessageException, IOException;
/**

View File

@@ -46,6 +46,7 @@ public class I2NPMessageHandler {
* @throws I2NPMessageException if there is a problem handling the particular
* message - if it is an unknown type or has improper formatting, etc.
*/
@Deprecated
public I2NPMessage readMessage(InputStream in) throws IOException, I2NPMessageException {
if (_messageBuffer == null) _messageBuffer = new byte[38*1024]; // more than necessary
try {

View File

@@ -58,6 +58,7 @@ public abstract class I2NPMessageImpl extends DataStructureImpl implements I2NPM
private static final Map<Integer, Builder> _builders = new ConcurrentHashMap<Integer, Builder>(1);
/** @deprecated unused */
@Deprecated
public static final void registerBuilder(Builder builder, int type) { _builders.put(Integer.valueOf(type), builder); }
/** interface for extending the types of messages handled - unused */
@@ -80,6 +81,7 @@ public abstract class I2NPMessageImpl extends DataStructureImpl implements I2NPM
*
* @deprecated unused
*/
@Deprecated
public void readBytes(InputStream in) throws DataFormatException, IOException {
try {
readBytes(in, -1, new byte[1024]);
@@ -112,6 +114,7 @@ public abstract class I2NPMessageImpl extends DataStructureImpl implements I2NPM
* @return total length of the message
* @deprecated unused
*/
@Deprecated
public int readBytes(InputStream in, int type, byte buffer[]) throws I2NPMessageException, IOException {
try {
if (type < 0)
@@ -243,6 +246,7 @@ public abstract class I2NPMessageImpl extends DataStructureImpl implements I2NPM
*
* @deprecated unused
*/
@Deprecated
public void writeBytes(OutputStream out) throws DataFormatException, IOException {
int size = getMessageSize();
if (size < 15 + CHECKSUM_LENGTH) throw new DataFormatException("Unable to build the message");

View File

@@ -34,6 +34,7 @@ import net.i2p.util.Log;
*
* @author jrandom
*/
@Deprecated
public class I2NPMessageReader {
private Log _log;
private RouterContext _context;
@@ -70,12 +71,14 @@ public class I2NPMessageReader {
* Have the already started reader pause its reading indefinitely
* @deprecated unused
*/
@Deprecated
public void pauseReading() { _reader.pauseRunner(); }
/**
* Resume reading after a pause
* @deprecated unused
*/
@Deprecated
public void resumeReading() { _reader.resumeRunner(); }
/**

View File

@@ -112,6 +112,7 @@ public class RouterAddress extends DataStructureImpl {
* @deprecated unused for now
* @return null for never, or a Date
*/
@Deprecated
public Date getExpiration() {
//return _expiration;
if (_expiration > 0)
@@ -127,6 +128,7 @@ public class RouterAddress extends DataStructureImpl {
* @return 0 for never
* @since 0.9.12
*/
@Deprecated
public long getExpirationTime() {
return _expiration;
}
@@ -141,6 +143,7 @@ public class RouterAddress extends DataStructureImpl {
* Unused for now, always null
* @deprecated unused for now
*/
@Deprecated
public void setExpiration(Date expiration) {
_expiration = expiration.getDate();
}
@@ -159,6 +162,7 @@ public class RouterAddress extends DataStructureImpl {
* @throws IllegalStateException if was already set
* @deprecated unused, use 3-arg constructor
*/
@Deprecated
public void setTransportStyle(String transportStyle) {
if (_transportStyle != null)
throw new IllegalStateException();
@@ -171,6 +175,7 @@ public class RouterAddress extends DataStructureImpl {
* @deprecated use getOptionsMap()
* @return sorted, non-null, NOT a copy, do not modify
*/
@Deprecated
public Properties getOptions() {
return _options;
}
@@ -199,6 +204,7 @@ public class RouterAddress extends DataStructureImpl {
* @throws IllegalStateException if was already set
* @deprecated unused, use 3-arg constructor
*/
@Deprecated
public void setOptions(Properties options) {
if (!_options.isEmpty())
throw new IllegalStateException();

View File

@@ -221,6 +221,7 @@ public class RouterInfo extends DatabaseEntry {
*
* @deprecated Implemented here but unused elsewhere
*/
@Deprecated
public Set<Hash> getPeers() {
if (_peers == null)
return Collections.emptySet();
@@ -234,6 +235,7 @@ public class RouterInfo extends DatabaseEntry {
* @deprecated Implemented here but unused elsewhere
* @throws IllegalStateException if RouterInfo is already signed
*/
@Deprecated
public void setPeers(Set<Hash> peers) {
if (_signature != null)
throw new IllegalStateException();
@@ -255,6 +257,7 @@ public class RouterInfo extends DatabaseEntry {
* @deprecated use getOptionsMap()
* @return sorted, non-null, NOT a copy, do not modify!!!
*/
@Deprecated
public Properties getOptions() {
return _options;
}