-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send through bidders configuration so that it's available everywhere …
…and reenables notifications
- Loading branch information
Showing
17 changed files
with
129 additions
and
137 deletions.
There are no files selected for viewing
40 changes: 16 additions & 24 deletions
40
bidding/src/main/java/com/bidtorrent/bidding/AuctionResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,40 @@ | ||
package com.bidtorrent.bidding; | ||
|
||
import com.bidtorrent.bidding.messages.BidResponse; | ||
import com.bidtorrent.bidding.messages.ContextualizedBidResponse; | ||
|
||
import java.io.Serializable; | ||
import java.util.Collection; | ||
|
||
public class AuctionResult implements Serializable { | ||
private IBidder winningBidder; | ||
private final BidResponse winningBid; | ||
private final float winningPrice; | ||
private long runnerUp; | ||
private Collection<BidResponse> responses; | ||
private final ContextualizedBidResponse winningBid; | ||
private final ContextualizedBidResponse runnerUp; | ||
private Collection<ContextualizedBidResponse> responses; | ||
private float winningPrice; | ||
|
||
public AuctionResult( | ||
BidResponse winningBid, | ||
float winningPrice, | ||
IBidder winningBidder, | ||
Collection<BidResponse> responses, | ||
long runnerUp) | ||
{ | ||
ContextualizedBidResponse winningBid, | ||
Collection<ContextualizedBidResponse> responses, | ||
ContextualizedBidResponse runnerUp, | ||
float winningPrice){ | ||
this.winningBid = winningBid; | ||
this.winningPrice = winningPrice; | ||
this.winningBidder = winningBidder; | ||
this.responses = responses; | ||
this.runnerUp = runnerUp; | ||
this.winningPrice = winningPrice; | ||
} | ||
|
||
public BidResponse getWinningBid() { | ||
return winningBid; | ||
public AuctionResult() { | ||
this(null,null,null, 0f); | ||
} | ||
|
||
public float getWinningPrice() { | ||
return winningPrice; | ||
public ContextualizedBidResponse getWinningBid() { | ||
return winningBid; | ||
} | ||
|
||
public Collection<BidResponse> getResponses() { | ||
public Collection<ContextualizedBidResponse> getResponses() { | ||
return responses; | ||
} | ||
|
||
public IBidder getWinningBidder() { | ||
return winningBidder; | ||
} | ||
|
||
public long getRunnerUp() { | ||
public ContextualizedBidResponse getRunnerUp() { | ||
return runnerUp; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
package com.bidtorrent.bidding; | ||
|
||
import com.bidtorrent.bidding.messages.BidResponse; | ||
import com.bidtorrent.bidding.messages.ContextualizedBidResponse; | ||
import com.google.common.util.concurrent.ListenableFuture; | ||
|
||
import java.io.Serializable; | ||
import java.util.concurrent.Callable; | ||
|
||
public interface IBidder extends Serializable{ | ||
ListenableFuture<BidResponse> bid(BidOpportunity opportunity, IErrorCallback errorCallback); | ||
ListenableFuture<ContextualizedBidResponse> bid(BidOpportunity opportunity, IErrorCallback errorCallback); | ||
|
||
long getId(); | ||
} |
11 changes: 0 additions & 11 deletions
11
bidding/src/main/java/com/bidtorrent/bidding/Notificator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
bidding/src/main/java/com/bidtorrent/bidding/messages/ContextualizedBidResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.bidtorrent.bidding.messages; | ||
|
||
import com.bidtorrent.bidding.messages.configuration.BidderConfiguration; | ||
|
||
import java.io.Serializable; | ||
|
||
public class ContextualizedBidResponse implements Comparable, Serializable{ | ||
|
||
private BidResponse bidResponse; | ||
private BidderConfiguration bidderConfiguration; | ||
|
||
public ContextualizedBidResponse(BidResponse bidResponse, BidderConfiguration bidderConfiguration) { | ||
this.bidResponse = bidResponse; | ||
this.bidderConfiguration = bidderConfiguration; | ||
} | ||
|
||
public BidderConfiguration getBidderConfiguration() { | ||
return bidderConfiguration; | ||
} | ||
|
||
public BidResponse getBidResponse() { | ||
return bidResponse; | ||
} | ||
|
||
@Override | ||
public int compareTo(Object o) { | ||
return this.bidResponse.compareTo(((ContextualizedBidResponse)o).bidResponse); | ||
} | ||
} |
5 changes: 2 additions & 3 deletions
5
bidding/src/main/java/com/bidtorrent/bidding/messages/configuration/BidderConfiguration.java
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.