@@ -217,10 +217,6 @@ public class Channel implements Serializable {
217217 }
218218 }
219219
220- // public void clean(){
221- // channelEventQue = null;
222- // }
223- //
224220 private Channel (String name , HFClient hfClient , Orderer orderer , ChannelConfiguration channelConfiguration , byte [][] signers ) throws InvalidArgumentException , TransactionException {
225221 this (name , hfClient , false );
226222
@@ -1329,7 +1325,9 @@ public interface SDPeerAddition {
13291325 transient SDPeerAddition sdPeerAddition = null ;
13301326
13311327 /**
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.
13331331 *
13341332 * @param sdOrdererAddition
13351333 * @return
@@ -1340,10 +1338,32 @@ public SDOrdererAddition setSDOrdererAddition(SDOrdererAddition sdOrdererAdditio
13401338
13411339 this .sdOrdererAddition = sdOrdererAddition ;
13421340
1341+ if (null == ret ) {
1342+ ret = new SDOrdererDefaultAddition (getServiceDiscoveryProperties ());
1343+ }
1344+
13431345 return ret ;
13441346
13451347 }
13461348
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+
13471367 private static byte [] combineCerts (Collection <byte []>... certCollections ) throws IOException {
13481368 try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream ()) {
13491369 for (Collection <byte []> certCollection : certCollections ) {
@@ -1407,10 +1427,10 @@ public interface SDOrdererAddition {
14071427
14081428 private Properties serviceDiscoveryProperties = new Properties ();
14091429
1410- private static class SDOrdererDefaultAddition implements SDOrdererAddition {
1411- private final Properties config ;
1430+ public static class SDOrdererDefaultAddition implements SDOrdererAddition {
1431+ protected final Properties config ;
14121432
1413- SDOrdererDefaultAddition (Properties config ) {
1433+ public SDOrdererDefaultAddition (Properties config ) {
14141434 this .config = config == null ? new Properties () : (Properties ) config .clone ();
14151435
14161436 }
@@ -1464,10 +1484,10 @@ public Orderer addOrderer(SDOrdererAdditionInfo sdOrdererAdditionInfo) throws In
14641484 }
14651485 }
14661486
1467- private static class SDOPeerDefaultAddition implements SDPeerAddition {
1468- private final Properties config ;
1487+ public static class SDOPeerDefaultAddition implements SDPeerAddition {
1488+ protected final Properties config ;
14691489
1470- SDOPeerDefaultAddition (Properties config ) {
1490+ public SDOPeerDefaultAddition (Properties config ) {
14711491 this .config = config == null ? new Properties () : (Properties ) config .clone ();
14721492
14731493 }
@@ -1538,6 +1558,8 @@ static Object findClientProp(Properties config, final String prop, final String
15381558
15391559 /**
15401560 * Set service discovery peer addition override.
1561+ * <p>
1562+ * Any service discovery properties {@link #setServiceDiscoveryProperties(Properties)} should be set before calling this.
15411563 *
15421564 * @param sdPeerAddition
15431565 * @return
@@ -1548,10 +1570,32 @@ public SDPeerAddition setSDPeerAddition(SDPeerAddition sdPeerAddition) {
15481570
15491571 this .sdPeerAddition = sdPeerAddition ;
15501572
1573+ if (ret == null ) {
1574+ ret = new SDOPeerDefaultAddition (getServiceDiscoveryProperties ());
1575+ }
1576+
15511577 return ret ;
15521578
15531579 }
15541580
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+
15551599 /**
15561600 * load the peer organizations CA certificates into the channel's trust store so that we
15571601 * can verify signatures from peer messages
@@ -3444,7 +3488,7 @@ public LifecycleApproveChaincodeDefinitionForMyOrgProposalResponse sendLifecycle
34443488 * Approve chaincode to be run on this peer's organization.
34453489 *
34463490 * @param lifecycleApproveChaincodeDefinitionForMyOrgRequest the request see {@link LifecycleApproveChaincodeDefinitionForMyOrgRequest}
3447- * @param peers to send the request to.
3491+ * @param peers to send the request to.
34483492 * @return A {@link LifecycleApproveChaincodeDefinitionForMyOrgProposalResponse}
34493493 * @throws ProposalException
34503494 * @throws InvalidArgumentException
@@ -3534,7 +3578,7 @@ public Collection<LifecycleApproveChaincodeDefinitionForMyOrgProposalResponse> s
35343578 * Commit chaincode final approval to run on all organizations that have approved.
35353579 *
35363580 * @param lifecycleCommitChaincodeDefinitionRequest The request see {@link LifecycleCommitChaincodeDefinitionRequest}
3537- * @param peers to send the request to.
3581+ * @param peers to send the request to.
35383582 * @return A {@link LifecycleCommitChaincodeDefinitionProposalResponse}
35393583 * @throws InvalidArgumentException
35403584 * @throws ProposalException
0 commit comments