@@ -217,10 +217,6 @@ public class Channel implements Serializable {
217
217
}
218
218
}
219
219
220
- // public void clean(){
221
- // channelEventQue = null;
222
- // }
223
- //
224
220
private Channel (String name , HFClient hfClient , Orderer orderer , ChannelConfiguration channelConfiguration , byte [][] signers ) throws InvalidArgumentException , TransactionException {
225
221
this (name , hfClient , false );
226
222
@@ -1329,7 +1325,9 @@ public interface SDPeerAddition {
1329
1325
transient SDPeerAddition sdPeerAddition = null ;
1330
1326
1331
1327
/**
1332
- * Set service discovery peer addition override.
1328
+ * Set service discovery orderer addition override.
1329
+ * <p>
1330
+ * Any service discovery properties {@link #setServiceDiscoveryProperties(Properties)} should be set before calling this.
1333
1331
*
1334
1332
* @param sdOrdererAddition
1335
1333
* @return
@@ -1340,10 +1338,32 @@ public SDOrdererAddition setSDOrdererAddition(SDOrdererAddition sdOrdererAdditio
1340
1338
1341
1339
this .sdOrdererAddition = sdOrdererAddition ;
1342
1340
1341
+ if (null == ret ) {
1342
+ ret = new SDOrdererDefaultAddition (getServiceDiscoveryProperties ());
1343
+ }
1344
+
1343
1345
return ret ;
1344
1346
1345
1347
}
1346
1348
1349
+ /**
1350
+ * Get current service discovery orderer addition override.
1351
+ * <p>
1352
+ * Any service discovery properties {@link #setServiceDiscoveryProperties(Properties)} should be set before calling this.
1353
+ *
1354
+ * @return SDOrdererAddition
1355
+ */
1356
+
1357
+ public SDOrdererAddition getSDOrdererAddition () {
1358
+
1359
+ if (null == sdOrdererAddition ) {
1360
+ sdOrdererAddition = new SDOrdererDefaultAddition (getServiceDiscoveryProperties ());
1361
+ }
1362
+
1363
+ return sdOrdererAddition ;
1364
+
1365
+ }
1366
+
1347
1367
private static byte [] combineCerts (Collection <byte []>... certCollections ) throws IOException {
1348
1368
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream ()) {
1349
1369
for (Collection <byte []> certCollection : certCollections ) {
@@ -1407,10 +1427,10 @@ public interface SDOrdererAddition {
1407
1427
1408
1428
private Properties serviceDiscoveryProperties = new Properties ();
1409
1429
1410
- private static class SDOrdererDefaultAddition implements SDOrdererAddition {
1411
- private final Properties config ;
1430
+ public static class SDOrdererDefaultAddition implements SDOrdererAddition {
1431
+ protected final Properties config ;
1412
1432
1413
- SDOrdererDefaultAddition (Properties config ) {
1433
+ public SDOrdererDefaultAddition (Properties config ) {
1414
1434
this .config = config == null ? new Properties () : (Properties ) config .clone ();
1415
1435
1416
1436
}
@@ -1464,10 +1484,10 @@ public Orderer addOrderer(SDOrdererAdditionInfo sdOrdererAdditionInfo) throws In
1464
1484
}
1465
1485
}
1466
1486
1467
- private static class SDOPeerDefaultAddition implements SDPeerAddition {
1468
- private final Properties config ;
1487
+ public static class SDOPeerDefaultAddition implements SDPeerAddition {
1488
+ protected final Properties config ;
1469
1489
1470
- SDOPeerDefaultAddition (Properties config ) {
1490
+ public SDOPeerDefaultAddition (Properties config ) {
1471
1491
this .config = config == null ? new Properties () : (Properties ) config .clone ();
1472
1492
1473
1493
}
@@ -1538,6 +1558,8 @@ static Object findClientProp(Properties config, final String prop, final String
1538
1558
1539
1559
/**
1540
1560
* Set service discovery peer addition override.
1561
+ * <p>
1562
+ * Any service discovery properties {@link #setServiceDiscoveryProperties(Properties)} should be set before calling this.
1541
1563
*
1542
1564
* @param sdPeerAddition
1543
1565
* @return
@@ -1548,10 +1570,32 @@ public SDPeerAddition setSDPeerAddition(SDPeerAddition sdPeerAddition) {
1548
1570
1549
1571
this .sdPeerAddition = sdPeerAddition ;
1550
1572
1573
+ if (ret == null ) {
1574
+ ret = new SDOPeerDefaultAddition (getServiceDiscoveryProperties ());
1575
+ }
1576
+
1551
1577
return ret ;
1552
1578
1553
1579
}
1554
1580
1581
+ /**
1582
+ * Get current service discovery peer addition override.
1583
+ * <p>
1584
+ * Any service discovery properties {@link #setServiceDiscoveryProperties(Properties)} should be set before calling this.
1585
+ *
1586
+ * @return SDOrdererAddition
1587
+ */
1588
+
1589
+ public SDPeerAddition getSDPeerAddition () {
1590
+
1591
+ if (null == sdPeerAddition ) {
1592
+ sdPeerAddition = new SDOPeerDefaultAddition (getServiceDiscoveryProperties ());
1593
+ }
1594
+
1595
+ return sdPeerAddition ;
1596
+
1597
+ }
1598
+
1555
1599
/**
1556
1600
* load the peer organizations CA certificates into the channel's trust store so that we
1557
1601
* can verify signatures from peer messages
@@ -3444,7 +3488,7 @@ public LifecycleApproveChaincodeDefinitionForMyOrgProposalResponse sendLifecycle
3444
3488
* Approve chaincode to be run on this peer's organization.
3445
3489
*
3446
3490
* @param lifecycleApproveChaincodeDefinitionForMyOrgRequest the request see {@link LifecycleApproveChaincodeDefinitionForMyOrgRequest}
3447
- * @param peers to send the request to.
3491
+ * @param peers to send the request to.
3448
3492
* @return A {@link LifecycleApproveChaincodeDefinitionForMyOrgProposalResponse}
3449
3493
* @throws ProposalException
3450
3494
* @throws InvalidArgumentException
@@ -3534,7 +3578,7 @@ public Collection<LifecycleApproveChaincodeDefinitionForMyOrgProposalResponse> s
3534
3578
* Commit chaincode final approval to run on all organizations that have approved.
3535
3579
*
3536
3580
* @param lifecycleCommitChaincodeDefinitionRequest The request see {@link LifecycleCommitChaincodeDefinitionRequest}
3537
- * @param peers to send the request to.
3581
+ * @param peers to send the request to.
3538
3582
* @return A {@link LifecycleCommitChaincodeDefinitionProposalResponse}
3539
3583
* @throws InvalidArgumentException
3540
3584
* @throws ProposalException
0 commit comments