Rename CapabilityAwarePayload to CapabilityRequiringPayload

This commit is contained in:
Manfred Karrer 2016-07-23 14:49:35 +02:00
parent eea589c9ac
commit 3663a94f10
3 changed files with 20 additions and 20 deletions

View File

@ -2,7 +2,7 @@ package io.bitsquare.trade;
import io.bitsquare.app.Version;
import io.bitsquare.common.crypto.PubKeyRing;
import io.bitsquare.p2p.storage.payload.CapabilityAwarePayload;
import io.bitsquare.p2p.storage.payload.CapabilityRequiringPayload;
import io.bitsquare.p2p.storage.payload.StoragePayload;
import io.bitsquare.trade.offer.Offer;
import org.bitcoinj.core.Coin;
@ -15,7 +15,7 @@ import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
public final class TradeStatistics implements StoragePayload, CapabilityAwarePayload {
public final class TradeStatistics implements StoragePayload, CapabilityRequiringPayload {
private static final long serialVersionUID = Version.P2P_NETWORK_VERSION;
public static final long TTL = TimeUnit.DAYS.toMillis(10);

View File

@ -1,18 +0,0 @@
package io.bitsquare.p2p.storage.payload;
import io.bitsquare.common.wire.Payload;
import java.util.List;
/**
* Used for messages which require that the data owner is online.
* <p>
* This is used for the offers to avoid dead offers in case the offerer is in standby mode or the app has
* terminated without sending the remove message (e.g. network connection lost or in case of a crash).
*/
public interface CapabilityAwarePayload extends Payload {
/**
* @return Capabilities the other node need to support to receive that message
*/
List<Integer> getRequiredCapabilities();
}

View File

@ -0,0 +1,18 @@
package io.bitsquare.p2p.storage.payload;
import io.bitsquare.common.wire.Payload;
import java.util.List;
/**
* Used for payloads which requires certain capability.
* <p>
* This is used for TradeStatistics to be able to support old versions which don't know about that class.
* We only send the data to nodes which are capable to handle that data (e.g. TradeStatistics supported from v. 0.4.9.1 on).
*/
public interface CapabilityRequiringPayload extends Payload {
/**
* @return Capabilities the other node need to support to receive that message
*/
List<Integer> getRequiredCapabilities();
}