@@ -68,14 +68,21 @@ enum UriType {
6868 private int maxInflight = 10 ; // Max inflight messages
6969 private int connectionTimeout = 30 ; // Connection timeout in seconds
7070
71- MqttProperties connectionProperties = new MqttProperties ();
71+
7272 public MqttProperties getConnectionProperties () {
73+ MqttProperties connectionProperties = new MqttProperties ();
74+ connectionProperties .setSessionExpiryInterval (sessionExpiryInterval );
75+ connectionProperties .setReceiveMaximum (receiveMaximum );
76+ connectionProperties .setMaximumPacketSize (maximumPacketSize );
77+ connectionProperties .setTopicAliasMaximum (topicAliasMaximum );
78+ connectionProperties .setRequestResponseInfo (requestResponseInfo );
79+ connectionProperties .setRequestProblemInfo (requestProblemInfo );
80+ connectionProperties .setUserProperties (userProperties );
81+ connectionProperties .setAuthenticationMethod (authMethod );
82+ connectionProperties .setAuthenticationData (authData );
7383 return connectionProperties ;
7484 }
7585
76- public void setConnectionProperties (MqttProperties connectionProperties ) {
77- this .connectionProperties = connectionProperties ;
78- }
7986
8087 public MqttProperties getWillMessageProperties () {
8188 return willMessageProperties ;
@@ -94,11 +101,10 @@ public void setWillMessageProperties(MqttProperties willMessageProperties) {
94101 private MqttMessage willMessage = null ; // Will Message
95102 private String userName ; // Username
96103 private byte [] password ; // Password
97- private Integer sessionExpiryInterval = null ; // The Session expiry Interval in seconds, null is the default of
104+ private Long sessionExpiryInterval = null ; // The Session expiry Interval in seconds, null is the default of
98105 // never.
99- private Integer willDelayInterval = null ; // The Will Delay Interval in seconds, null is the default of 0.
100106 private Integer receiveMaximum = null ; // The Receive Maximum, null defaults to 65,535, cannot be 0.
101- private Integer maximumPacketSize = null ; // The Maximum packet size, null defaults to no limit.
107+ private Long maximumPacketSize = null ; // The Maximum packet size, null defaults to no limit.
102108 private Integer topicAliasMaximum = null ; // The Topic Alias Maximum, null defaults to 0.
103109 private Boolean requestResponseInfo = null ; // Request Response Information, null defaults to false.
104110 private Boolean requestProblemInfo = null ; // Request Problem Information, null defaults to true.
@@ -476,7 +482,7 @@ public int getAutomaticReconnectMaxDelay() {
476482 *
477483 * @return the Session Expiry Interval in seconds.
478484 */
479- public Integer getSessionExpiryInterval () {
485+ public Long getSessionExpiryInterval () {
480486 return sessionExpiryInterval ;
481487 }
482488
@@ -499,45 +505,16 @@ public Integer getSessionExpiryInterval() {
499505 * @param sessionExpiryInterval
500506 * The Session Expiry Interval in seconds.
501507 */
502- public void setSessionExpiryInterval (Integer sessionExpiryInterval ) {
508+ public void setSessionExpiryInterval (Long sessionExpiryInterval ) {
503509 this .sessionExpiryInterval = sessionExpiryInterval ;
504510 }
505511
506- /**
507- * Returns the Will Delay Interval. If <code>null</code>, it will default to 0
508- * and there is no will delay before the will message is published.
509- *
510- * @return The Will Delay Interval in seconds.
511- */
512- public Integer getWillDelayInterval () {
513- return willDelayInterval ;
514- }
515-
516- /**
517- * Sets the Will Delay Interval. This value, measured in seconds, defines the
518- * time that the server will wait to send the Client's will message after it has
519- * disconnected.
520- * <ul>
521- * <li>By default this value is null and so will not be sent, in this case, the
522- * default value is 0.</li>
523- * <li>If a 0 is sent, the will message will be sent immediately.</li>
524- * </ul>
525- *
526- * The Server delays publishing the Client's Will Message until the Will Delay
527- * Interval has passed or the Session ends, whichever happens first.
528- *
529- * @param willDelayInterval
530- * The will delay interval
531- */
532- public void setWillDelayInterval (Integer willDelayInterval ) {
533- this .willDelayInterval = willDelayInterval ;
534- }
535512
536513 /**
537514 * Returns the Receive Maximum value. If <code>null</code>, it will default to
538515 * 65,535.
539516 *
540- * @return the Receive Maxumum
517+ * @return the Receive Maximum
541518 */
542519 public Integer getReceiveMaximum () {
543520 return receiveMaximum ;
@@ -569,7 +546,7 @@ public void setReceiveMaximum(Integer receiveMaximum) {
569546 *
570547 * @return the Maximum Packet Size in bytes.
571548 */
572- public Integer getMaximumPacketSize () {
549+ public Long getMaximumPacketSize () {
573550 return maximumPacketSize ;
574551 }
575552
@@ -587,7 +564,7 @@ public Integer getMaximumPacketSize() {
587564 * @param maximumPacketSize
588565 * The Maximum packet size.
589566 */
590- public void setMaximumPacketSize (Integer maximumPacketSize ) {
567+ public void setMaximumPacketSize (Long maximumPacketSize ) {
591568 this .maximumPacketSize = maximumPacketSize ;
592569 }
593570
0 commit comments