/** * First step of swap procedure. Calls from swapper1 part. * <br><br> * Get single contracts. * <br><br> * Service create new revisions of existing contracts, change owners, * added transactional sections with references to each other with asks two signs of swappers * and sign contract that was own for calling part. * <br><br> * Swap procedure consist from three steps:<br> * (1) prepare contracts with creating transactional section on the first swapper site, sign only one contract;<br> * (2) sign contracts on the second swapper site;<br> * (3) sign lost contracts on the first swapper site and finishing swap. * <br><br> * * @param contract1 is own for calling part (swapper1 owned), existing or new revision of contract * @param contract2 is foreign for calling part (swapper2 owned), existing or new revision contract * @param fromKeys is own for calling part (swapper1 keys) private keys * @param toKeys is foreign for calling part (swapper2 keys) public keys * @return swap contract including new revisions of old contracts swapping between; * should be send to partner (swapper2) and he should go to step (2) of the swap procedure. */ public synchronized static Contract startSwap(Contract contract1, Contract contract2, Set<PrivateKey> fromKeys, Set<PublicKey> toKeys) { return startSwap(contract1, contract2, fromKeys, toKeys, true); }
/** * First step of swap procedure. Calls from swapper1 part. * <br><br> * Get lists of contracts. * <br><br> * Service create new revisions of existing contracts, change owners, * added transactional sections with references to each other with asks two signs of swappers * and sign contract that was own for calling part. * <br><br> * Swap procedure consist from three steps:<br> * (1) prepare contracts with creating transactional section on the first swapper site, sign only one contract;<br> * (2) sign contracts on the second swapper site;<br> * (3) sign lost contracts on the first swapper site and finishing swap. * <br><br> * * @param contracts1 is list of own for calling part (swapper1 owned), existing or new revision of contract * @param contracts2 is list of foreign for calling part (swapper2 owned), existing or new revision contract * @param fromKeys is own for calling part (swapper1 keys) private keys * @param toKeys is foreign for calling part (swapper2 keys) public keys * @return swap contract including new revisions of old contracts swapping between; * should be send to partner (swapper2) and he should go to step (2) of the swap procedure. */ public synchronized static Contract startSwap(List<Contract> contracts1, List<Contract> contracts2, Set<PrivateKey> fromKeys, Set<PublicKey> toKeys) { return startSwap(contracts1, contracts2, fromKeys, toKeys, true); }
/** * First step of swap procedure. Calls from swapper1 part. * <br><br> * Get single contracts. * <br><br> * Service create new revisions of existing contracts, change owners, * added transactional sections with references to each other with asks two signs of swappers * and sign contract that was own for calling part. * <br><br> * Swap procedure consist from three steps:<br> * (1) prepare contracts with creating transactional section on the first swapper site, sign only one contract;<br> * (2) sign contracts on the second swapper site;<br> * (3) sign lost contracts on the first swapper site and finishing swap. * <br><br> * * @param contract1 is own for calling part (swapper1 owned), existing or new revision of contract * @param contract2 is foreign for calling part (swapper2 owned), existing or new revision contract * @param fromKeys is own for calling part (swapper1 keys) private keys * @param toKeys is foreign for calling part (swapper2 keys) public keys * @param createNewRevision if true - create new revision of given contracts. If false - use them as new revisions. * @return swap contract including new revisions of old contracts swapping between; * should be send to partner (swapper2) and he should go to step (2) of the swap procedure. */ public synchronized static Contract startSwap(Contract contract1, Contract contract2, Set<PrivateKey> fromKeys, Set<PublicKey> toKeys, boolean createNewRevision) { List<Contract> contracts1 = new ArrayList<>(); contracts1.add(contract1); List<Contract> contracts2 = new ArrayList<>(); contracts2.add(contract2); return startSwap(contracts1, contracts2, fromKeys, toKeys, createNewRevision); }
swapContract = ContractsService.startSwap(delorean, lamborghini, martyPrivateKeys, stepaPublicKeys);
swapContract = ContractsService.startSwap(delorean, lamborghini, martyPrivateKeys, stepaPublicKeys);
swapContract = ContractsService.startSwap(delorean, lamborghini, martyPrivateKeys, stepaPublicKeys);
swapContract = ContractsService.startSwap(delorean, lamborghini, martyPrivateKeys, stepaPublicKeys);
swapContract = ContractsService.startSwap(delorean, lamborghini, martyPrivateKeys, stepaPublicKeys);
swapContract = ContractsService.startSwap(delorean, lamborghini, martyPrivateKeys, stepaPublicKeys);
swapContract = ContractsService.startSwap(delorean, lamborghini, martyPrivateKeys, stepaPublicKeys);
swapContract = ContractsService.startSwap(delorean, lamborghini, martyPrivateKeys, stepaPublicKeys);
swapContract = ContractsService.startSwap(deloreans, lamborghinis, martyPrivateKeys, stepaPublicKeys);
swapContract = ContractsService.startSwap(delorean, lamborghini, martyPrivateKeys, stepaPublicKeys);
swapContract = ContractsService.startSwap(delorean, lamborghini, martyPrivateKeys, stepaPublicKeys);
swapContract = ContractsService.startSwap(delorean, lamborghini, martyPrivateKeys, stepaPublicKeys);
swapContract = ContractsService.startSwap(delorean, lamborghini, martyPrivateKeys, stepaPublicKeys);
swapContract = ContractsService.startSwap(delorean, lamborghini, martyPrivateKeys, stepaPublicKeys);
swapContract = ContractsService.startSwap(delorean, lamborghini, martyPrivateKeys, stepaPublicKeys);
swapContract = ContractsService.startSwap(delorean, lamborghini, martyPrivateKeys, stepaPublicKeys);
swapContract = ContractsService.startSwap(delorean, lamborghini, martyPrivateKeys, stepaPublicKeys); ContractsService.signPresentedSwap(swapContract, stepaPrivateKeys); ContractsService.finishSwap(swapContract, martyPrivateKeys);