src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpV3Message.java

Print this page
rev 10552 : 8055723[core]: Replace concat String to append in StringBuilder parameters
Contributed-by: Otavio Santana <otaviojava@java.net>


 462             .append("\n")
 463             .append("msgSecurityModel : ").append(pdu.msgSecurityModel)
 464             .append("\n")
 465             .append("contextEngineId : ").append(pdu.contextEngineId)
 466             .append("\n")
 467             .append("contextName : ").append(pdu.contextName)
 468             .append("\n");
 469             SNMP_LOGGER.logp(Level.FINER, SnmpV3Message.class.getName(),
 470                     "decodeSnmpPdu", strb.toString());
 471         }
 472         return pdu ;
 473     }
 474 
 475     /**
 476      * Dumps this message in a string.
 477      *
 478      * @return The string containing the dump.
 479      */
 480     public String printMessage() {
 481         StringBuilder sb = new StringBuilder();
 482         sb.append("msgId : " + msgId + "\n");
 483         sb.append("msgMaxSize : " + msgMaxSize + "\n");
 484         sb.append("msgFlags : " + msgFlags + "\n");
 485         sb.append("msgSecurityModel : " + msgSecurityModel + "\n");
 486 
 487         if (contextEngineId == null) {
 488             sb.append("contextEngineId : null");
 489         }
 490         else {
 491             sb.append("contextEngineId : {\n");
 492             sb.append(dumpHexBuffer(contextEngineId,
 493                                     0,
 494                                     contextEngineId.length));
 495             sb.append("\n}\n");
 496         }
 497 
 498         if (contextName == null) {
 499             sb.append("contextName : null");
 500         }
 501         else {
 502             sb.append("contextName : {\n");
 503             sb.append(dumpHexBuffer(contextName,
 504                                     0,
 505                                     contextName.length));


 462             .append("\n")
 463             .append("msgSecurityModel : ").append(pdu.msgSecurityModel)
 464             .append("\n")
 465             .append("contextEngineId : ").append(pdu.contextEngineId)
 466             .append("\n")
 467             .append("contextName : ").append(pdu.contextName)
 468             .append("\n");
 469             SNMP_LOGGER.logp(Level.FINER, SnmpV3Message.class.getName(),
 470                     "decodeSnmpPdu", strb.toString());
 471         }
 472         return pdu ;
 473     }
 474 
 475     /**
 476      * Dumps this message in a string.
 477      *
 478      * @return The string containing the dump.
 479      */
 480     public String printMessage() {
 481         StringBuilder sb = new StringBuilder();
 482         sb.append("msgId : ").append(msgId).append('\n');
 483         sb.append("msgMaxSize : ").append(msgMaxSize).append('\n');
 484         sb.append("msgFlags : ").append(msgFlags).append('\n');
 485         sb.append("msgSecurityModel : ").append(msgSecurityModel).append('\n');
 486 
 487         if (contextEngineId == null) {
 488             sb.append("contextEngineId : null");
 489         }
 490         else {
 491             sb.append("contextEngineId : {\n");
 492             sb.append(dumpHexBuffer(contextEngineId,
 493                                     0,
 494                                     contextEngineId.length));
 495             sb.append("\n}\n");
 496         }
 497 
 498         if (contextName == null) {
 499             sb.append("contextName : null");
 500         }
 501         else {
 502             sb.append("contextName : {\n");
 503             sb.append(dumpHexBuffer(contextName,
 504                                     0,
 505                                     contextName.length));