1 | package geniusweb.protocol.partyconnection;
|
---|
2 |
|
---|
3 | import java.io.IOException;
|
---|
4 | import java.util.List;
|
---|
5 |
|
---|
6 | import geniusweb.actions.Action;
|
---|
7 | import geniusweb.connection.ConnectionFactory;
|
---|
8 | import geniusweb.inform.Inform;
|
---|
9 | import geniusweb.references.Reference;
|
---|
10 | import tudelft.utilities.repository.NoResourcesNowException;
|
---|
11 |
|
---|
12 | /**
|
---|
13 | * An extended {@link ConnectionFactory} that store PartyIDs with the
|
---|
14 | * connections, making it possible to find back the appropriate connection given
|
---|
15 | * a PartyID. Also, it allows the connection factory to actually assign the
|
---|
16 | * PartyIDs.
|
---|
17 | *
|
---|
18 | */
|
---|
19 | public interface ProtocolToPartyConnFactory
|
---|
20 | extends ConnectionFactory<Action, Inform> {
|
---|
21 | @Override
|
---|
22 | public ProtocolToPartyConn connect(Reference reference)
|
---|
23 | throws IOException, NoResourcesNowException;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * Connects a set of References in one go, following a modified Banker's
|
---|
27 | * algorthm.
|
---|
28 | *
|
---|
29 | * @param references the list of references to connect with
|
---|
30 | * @return a List of connections, one fore each Reference.
|
---|
31 | * @throws IOException if a connection is failing irrecoverably.
|
---|
32 | * @throws NoResourcesNowException is there are insufficient resources now.
|
---|
33 | * This also includes a suggested moment to
|
---|
34 | * retry.
|
---|
35 | */
|
---|
36 | List<ProtocolToPartyConn> connect(List<Reference> references)
|
---|
37 | throws IOException, NoResourcesNowException;
|
---|
38 |
|
---|
39 | }
|
---|