Java 类com.sun.jmx.snmp.BerException 实例源码

项目:OpenJSharp    文件:SnmpV3Message.java   
/**
 * Decodes the specified bytes and initializes this message.
 * For internal use only.
 *
 * @param inputBytes The bytes to be decoded.
 *
 * @exception SnmpStatusException If the specified bytes are not a valid encoding.
 */
public void decodeMessage(byte[] inputBytes, int byteCount)
    throws SnmpStatusException {

    try {
        BerDecoder bdec = new BerDecoder(inputBytes);
        bdec.openSequence();
        version = bdec.fetchInteger();
        bdec.openSequence();
        msgId = bdec.fetchInteger();
        msgMaxSize = bdec.fetchInteger();
        msgFlags = bdec.fetchOctetString()[0];
        msgSecurityModel =bdec.fetchInteger();
        bdec.closeSequence();
        msgSecurityParameters = bdec.fetchOctetString();
        if( (msgFlags & SnmpDefinitions.privMask) == 0 ) {
            bdec.openSequence();
            contextEngineId = bdec.fetchOctetString();
            contextName = bdec.fetchOctetString();
            data = bdec.fetchAny();
            dataLength = data.length;
            bdec.closeSequence();
        }
        else {
            encryptedPdu = bdec.fetchOctetString();
        }
        bdec.closeSequence() ;
    }
    catch(BerException x) {
        x.printStackTrace();
        throw new SnmpStatusException("Invalid encoding") ;
    }

    if (SNMP_LOGGER.isLoggable(Level.FINER)) {
        final StringBuilder strb = new StringBuilder()
        .append("Unmarshalled message : \n")
        .append("version : ").append(version)
        .append("\n")
        .append("msgId : ").append(msgId)
        .append("\n")
        .append("msgMaxSize : ").append(msgMaxSize)
        .append("\n")
        .append("msgFlags : ").append(msgFlags)
        .append("\n")
        .append("msgSecurityModel : ").append(msgSecurityModel)
        .append("\n")
        .append("contextEngineId : ").append(contextEngineId == null ? null :
            SnmpEngineId.createEngineId(contextEngineId))
        .append("\n")
        .append("contextName : ").append(contextName)
        .append("\n")
        .append("data : ").append(data)
        .append("\n")
        .append("dat len : ").append((data == null) ? 0 : data.length)
        .append("\n")
        .append("encryptedPdu : ").append(encryptedPdu)
        .append("\n");
        SNMP_LOGGER.logp(Level.FINER, SnmpV3Message.class.getName(),
                "decodeMessage", strb.toString());
    }
}
项目:jdk8u-jdk    文件:SnmpV3Message.java   
/**
 * Decodes the specified bytes and initializes this message.
 * For internal use only.
 *
 * @param inputBytes The bytes to be decoded.
 *
 * @exception SnmpStatusException If the specified bytes are not a valid encoding.
 */
public void decodeMessage(byte[] inputBytes, int byteCount)
    throws SnmpStatusException {

    try {
        BerDecoder bdec = new BerDecoder(inputBytes);
        bdec.openSequence();
        version = bdec.fetchInteger();
        bdec.openSequence();
        msgId = bdec.fetchInteger();
        msgMaxSize = bdec.fetchInteger();
        msgFlags = bdec.fetchOctetString()[0];
        msgSecurityModel =bdec.fetchInteger();
        bdec.closeSequence();
        msgSecurityParameters = bdec.fetchOctetString();
        if( (msgFlags & SnmpDefinitions.privMask) == 0 ) {
            bdec.openSequence();
            contextEngineId = bdec.fetchOctetString();
            contextName = bdec.fetchOctetString();
            data = bdec.fetchAny();
            dataLength = data.length;
            bdec.closeSequence();
        }
        else {
            encryptedPdu = bdec.fetchOctetString();
        }
        bdec.closeSequence() ;
    }
    catch(BerException x) {
        x.printStackTrace();
        throw new SnmpStatusException("Invalid encoding") ;
    }

    if (SNMP_LOGGER.isLoggable(Level.FINER)) {
        final StringBuilder strb = new StringBuilder()
        .append("Unmarshalled message : \n")
        .append("version : ").append(version)
        .append("\n")
        .append("msgId : ").append(msgId)
        .append("\n")
        .append("msgMaxSize : ").append(msgMaxSize)
        .append("\n")
        .append("msgFlags : ").append(msgFlags)
        .append("\n")
        .append("msgSecurityModel : ").append(msgSecurityModel)
        .append("\n")
        .append("contextEngineId : ").append(contextEngineId == null ? null :
            SnmpEngineId.createEngineId(contextEngineId))
        .append("\n")
        .append("contextName : ").append(contextName)
        .append("\n")
        .append("data : ").append(data)
        .append("\n")
        .append("dat len : ").append((data == null) ? 0 : data.length)
        .append("\n")
        .append("encryptedPdu : ").append(encryptedPdu)
        .append("\n");
        SNMP_LOGGER.logp(Level.FINER, SnmpV3Message.class.getName(),
                "decodeMessage", strb.toString());
    }
}
项目:jdk8u_jdk    文件:SnmpV3Message.java   
/**
 * Decodes the specified bytes and initializes this message.
 * For internal use only.
 *
 * @param inputBytes The bytes to be decoded.
 *
 * @exception SnmpStatusException If the specified bytes are not a valid encoding.
 */
public void decodeMessage(byte[] inputBytes, int byteCount)
    throws SnmpStatusException {

    try {
        BerDecoder bdec = new BerDecoder(inputBytes);
        bdec.openSequence();
        version = bdec.fetchInteger();
        bdec.openSequence();
        msgId = bdec.fetchInteger();
        msgMaxSize = bdec.fetchInteger();
        msgFlags = bdec.fetchOctetString()[0];
        msgSecurityModel =bdec.fetchInteger();
        bdec.closeSequence();
        msgSecurityParameters = bdec.fetchOctetString();
        if( (msgFlags & SnmpDefinitions.privMask) == 0 ) {
            bdec.openSequence();
            contextEngineId = bdec.fetchOctetString();
            contextName = bdec.fetchOctetString();
            data = bdec.fetchAny();
            dataLength = data.length;
            bdec.closeSequence();
        }
        else {
            encryptedPdu = bdec.fetchOctetString();
        }
        bdec.closeSequence() ;
    }
    catch(BerException x) {
        x.printStackTrace();
        throw new SnmpStatusException("Invalid encoding") ;
    }

    if (SNMP_LOGGER.isLoggable(Level.FINER)) {
        final StringBuilder strb = new StringBuilder()
        .append("Unmarshalled message : \n")
        .append("version : ").append(version)
        .append("\n")
        .append("msgId : ").append(msgId)
        .append("\n")
        .append("msgMaxSize : ").append(msgMaxSize)
        .append("\n")
        .append("msgFlags : ").append(msgFlags)
        .append("\n")
        .append("msgSecurityModel : ").append(msgSecurityModel)
        .append("\n")
        .append("contextEngineId : ").append(contextEngineId == null ? null :
            SnmpEngineId.createEngineId(contextEngineId))
        .append("\n")
        .append("contextName : ").append(contextName)
        .append("\n")
        .append("data : ").append(data)
        .append("\n")
        .append("dat len : ").append((data == null) ? 0 : data.length)
        .append("\n")
        .append("encryptedPdu : ").append(encryptedPdu)
        .append("\n");
        SNMP_LOGGER.logp(Level.FINER, SnmpV3Message.class.getName(),
                "decodeMessage", strb.toString());
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:SnmpV3Message.java   
/**
 * Decodes the specified bytes and initializes this message.
 * For internal use only.
 *
 * @param inputBytes The bytes to be decoded.
 *
 * @exception SnmpStatusException If the specified bytes are not a valid encoding.
 */
public void decodeMessage(byte[] inputBytes, int byteCount)
    throws SnmpStatusException {

    try {
        BerDecoder bdec = new BerDecoder(inputBytes);
        bdec.openSequence();
        version = bdec.fetchInteger();
        bdec.openSequence();
        msgId = bdec.fetchInteger();
        msgMaxSize = bdec.fetchInteger();
        msgFlags = bdec.fetchOctetString()[0];
        msgSecurityModel =bdec.fetchInteger();
        bdec.closeSequence();
        msgSecurityParameters = bdec.fetchOctetString();
        if( (msgFlags & SnmpDefinitions.privMask) == 0 ) {
            bdec.openSequence();
            contextEngineId = bdec.fetchOctetString();
            contextName = bdec.fetchOctetString();
            data = bdec.fetchAny();
            dataLength = data.length;
            bdec.closeSequence();
        }
        else {
            encryptedPdu = bdec.fetchOctetString();
        }
        bdec.closeSequence() ;
    }
    catch(BerException x) {
        x.printStackTrace();
        throw new SnmpStatusException("Invalid encoding") ;
    }

    if (SNMP_LOGGER.isLoggable(Level.FINER)) {
        final StringBuilder strb = new StringBuilder()
        .append("Unmarshalled message : \n")
        .append("version : ").append(version)
        .append("\n")
        .append("msgId : ").append(msgId)
        .append("\n")
        .append("msgMaxSize : ").append(msgMaxSize)
        .append("\n")
        .append("msgFlags : ").append(msgFlags)
        .append("\n")
        .append("msgSecurityModel : ").append(msgSecurityModel)
        .append("\n")
        .append("contextEngineId : ").append(contextEngineId == null ? null :
            SnmpEngineId.createEngineId(contextEngineId))
        .append("\n")
        .append("contextName : ").append(contextName)
        .append("\n")
        .append("data : ").append(data)
        .append("\n")
        .append("dat len : ").append((data == null) ? 0 : data.length)
        .append("\n")
        .append("encryptedPdu : ").append(encryptedPdu)
        .append("\n");
        SNMP_LOGGER.logp(Level.FINER, SnmpV3Message.class.getName(),
                "decodeMessage", strb.toString());
    }
}
项目:infobip-open-jdk-8    文件:SnmpV3Message.java   
/**
 * Decodes the specified bytes and initializes this message.
 * For internal use only.
 *
 * @param inputBytes The bytes to be decoded.
 *
 * @exception SnmpStatusException If the specified bytes are not a valid encoding.
 */
public void decodeMessage(byte[] inputBytes, int byteCount)
    throws SnmpStatusException {

    try {
        BerDecoder bdec = new BerDecoder(inputBytes);
        bdec.openSequence();
        version = bdec.fetchInteger();
        bdec.openSequence();
        msgId = bdec.fetchInteger();
        msgMaxSize = bdec.fetchInteger();
        msgFlags = bdec.fetchOctetString()[0];
        msgSecurityModel =bdec.fetchInteger();
        bdec.closeSequence();
        msgSecurityParameters = bdec.fetchOctetString();
        if( (msgFlags & SnmpDefinitions.privMask) == 0 ) {
            bdec.openSequence();
            contextEngineId = bdec.fetchOctetString();
            contextName = bdec.fetchOctetString();
            data = bdec.fetchAny();
            dataLength = data.length;
            bdec.closeSequence();
        }
        else {
            encryptedPdu = bdec.fetchOctetString();
        }
        bdec.closeSequence() ;
    }
    catch(BerException x) {
        x.printStackTrace();
        throw new SnmpStatusException("Invalid encoding") ;
    }

    if (SNMP_LOGGER.isLoggable(Level.FINER)) {
        final StringBuilder strb = new StringBuilder()
        .append("Unmarshalled message : \n")
        .append("version : ").append(version)
        .append("\n")
        .append("msgId : ").append(msgId)
        .append("\n")
        .append("msgMaxSize : ").append(msgMaxSize)
        .append("\n")
        .append("msgFlags : ").append(msgFlags)
        .append("\n")
        .append("msgSecurityModel : ").append(msgSecurityModel)
        .append("\n")
        .append("contextEngineId : ").append(contextEngineId == null ? null :
            SnmpEngineId.createEngineId(contextEngineId))
        .append("\n")
        .append("contextName : ").append(contextName)
        .append("\n")
        .append("data : ").append(data)
        .append("\n")
        .append("dat len : ").append((data == null) ? 0 : data.length)
        .append("\n")
        .append("encryptedPdu : ").append(encryptedPdu)
        .append("\n");
        SNMP_LOGGER.logp(Level.FINER, SnmpV3Message.class.getName(),
                "decodeMessage", strb.toString());
    }
}
项目:jdk8u-dev-jdk    文件:SnmpV3Message.java   
/**
 * Decodes the specified bytes and initializes this message.
 * For internal use only.
 *
 * @param inputBytes The bytes to be decoded.
 *
 * @exception SnmpStatusException If the specified bytes are not a valid encoding.
 */
public void decodeMessage(byte[] inputBytes, int byteCount)
    throws SnmpStatusException {

    try {
        BerDecoder bdec = new BerDecoder(inputBytes);
        bdec.openSequence();
        version = bdec.fetchInteger();
        bdec.openSequence();
        msgId = bdec.fetchInteger();
        msgMaxSize = bdec.fetchInteger();
        msgFlags = bdec.fetchOctetString()[0];
        msgSecurityModel =bdec.fetchInteger();
        bdec.closeSequence();
        msgSecurityParameters = bdec.fetchOctetString();
        if( (msgFlags & SnmpDefinitions.privMask) == 0 ) {
            bdec.openSequence();
            contextEngineId = bdec.fetchOctetString();
            contextName = bdec.fetchOctetString();
            data = bdec.fetchAny();
            dataLength = data.length;
            bdec.closeSequence();
        }
        else {
            encryptedPdu = bdec.fetchOctetString();
        }
        bdec.closeSequence() ;
    }
    catch(BerException x) {
        x.printStackTrace();
        throw new SnmpStatusException("Invalid encoding") ;
    }

    if (SNMP_LOGGER.isLoggable(Level.FINER)) {
        final StringBuilder strb = new StringBuilder()
        .append("Unmarshalled message : \n")
        .append("version : ").append(version)
        .append("\n")
        .append("msgId : ").append(msgId)
        .append("\n")
        .append("msgMaxSize : ").append(msgMaxSize)
        .append("\n")
        .append("msgFlags : ").append(msgFlags)
        .append("\n")
        .append("msgSecurityModel : ").append(msgSecurityModel)
        .append("\n")
        .append("contextEngineId : ").append(contextEngineId == null ? null :
            SnmpEngineId.createEngineId(contextEngineId))
        .append("\n")
        .append("contextName : ").append(contextName)
        .append("\n")
        .append("data : ").append(data)
        .append("\n")
        .append("dat len : ").append((data == null) ? 0 : data.length)
        .append("\n")
        .append("encryptedPdu : ").append(encryptedPdu)
        .append("\n");
        SNMP_LOGGER.logp(Level.FINER, SnmpV3Message.class.getName(),
                "decodeMessage", strb.toString());
    }
}
项目:jdk7-jdk    文件:SnmpV3Message.java   
/**
 * Decodes the specified bytes and initializes this message.
 * For internal use only.
 *
 * @param inputBytes The bytes to be decoded.
 *
 * @exception SnmpStatusException If the specified bytes are not a valid encoding.
 */
public void decodeMessage(byte[] inputBytes, int byteCount)
    throws SnmpStatusException {

    try {
        BerDecoder bdec = new BerDecoder(inputBytes);
        bdec.openSequence();
        version = bdec.fetchInteger();
        bdec.openSequence();
        msgId = bdec.fetchInteger();
        msgMaxSize = bdec.fetchInteger();
        msgFlags = bdec.fetchOctetString()[0];
        msgSecurityModel =bdec.fetchInteger();
        bdec.closeSequence();
        msgSecurityParameters = bdec.fetchOctetString();
        if( (msgFlags & SnmpDefinitions.privMask) == 0 ) {
            bdec.openSequence();
            contextEngineId = bdec.fetchOctetString();
            contextName = bdec.fetchOctetString();
            data = bdec.fetchAny();
            dataLength = data.length;
            bdec.closeSequence();
        }
        else {
            encryptedPdu = bdec.fetchOctetString();
        }
        bdec.closeSequence() ;
    }
    catch(BerException x) {
        x.printStackTrace();
        throw new SnmpStatusException("Invalid encoding") ;
    }

    if (SNMP_LOGGER.isLoggable(Level.FINER)) {
        final StringBuilder strb = new StringBuilder()
        .append("Unmarshalled message : \n")
        .append("version : ").append(version)
        .append("\n")
        .append("msgId : ").append(msgId)
        .append("\n")
        .append("msgMaxSize : ").append(msgMaxSize)
        .append("\n")
        .append("msgFlags : ").append(msgFlags)
        .append("\n")
        .append("msgSecurityModel : ").append(msgSecurityModel)
        .append("\n")
        .append("contextEngineId : ").append(contextEngineId == null ? null :
            SnmpEngineId.createEngineId(contextEngineId))
        .append("\n")
        .append("contextName : ").append(contextName)
        .append("\n")
        .append("data : ").append(data)
        .append("\n")
        .append("dat len : ").append((data == null) ? 0 : data.length)
        .append("\n")
        .append("encryptedPdu : ").append(encryptedPdu)
        .append("\n");
        SNMP_LOGGER.logp(Level.FINER, SnmpV3Message.class.getName(),
                "decodeMessage", strb.toString());
    }
}
项目:openjdk-source-code-learn    文件:SnmpV3Message.java   
/**
 * Decodes the specified bytes and initializes this message.
 * For internal use only.
 *
 * @param inputBytes The bytes to be decoded.
 *
 * @exception SnmpStatusException If the specified bytes are not a valid encoding.
 */
public void decodeMessage(byte[] inputBytes, int byteCount)
    throws SnmpStatusException {

    try {
        BerDecoder bdec = new BerDecoder(inputBytes);
        bdec.openSequence();
        version = bdec.fetchInteger();
        bdec.openSequence();
        msgId = bdec.fetchInteger();
        msgMaxSize = bdec.fetchInteger();
        msgFlags = bdec.fetchOctetString()[0];
        msgSecurityModel =bdec.fetchInteger();
        bdec.closeSequence();
        msgSecurityParameters = bdec.fetchOctetString();
        if( (msgFlags & SnmpDefinitions.privMask) == 0 ) {
            bdec.openSequence();
            contextEngineId = bdec.fetchOctetString();
            contextName = bdec.fetchOctetString();
            data = bdec.fetchAny();
            dataLength = data.length;
            bdec.closeSequence();
        }
        else {
            encryptedPdu = bdec.fetchOctetString();
        }
        bdec.closeSequence() ;
    }
    catch(BerException x) {
        x.printStackTrace();
        throw new SnmpStatusException("Invalid encoding") ;
    }

    if (SNMP_LOGGER.isLoggable(Level.FINER)) {
        final StringBuilder strb = new StringBuilder()
        .append("Unmarshalled message : \n")
        .append("version : ").append(version)
        .append("\n")
        .append("msgId : ").append(msgId)
        .append("\n")
        .append("msgMaxSize : ").append(msgMaxSize)
        .append("\n")
        .append("msgFlags : ").append(msgFlags)
        .append("\n")
        .append("msgSecurityModel : ").append(msgSecurityModel)
        .append("\n")
        .append("contextEngineId : ").append(contextEngineId == null ? null :
            SnmpEngineId.createEngineId(contextEngineId))
        .append("\n")
        .append("contextName : ").append(contextName)
        .append("\n")
        .append("data : ").append(data)
        .append("\n")
        .append("dat len : ").append((data == null) ? 0 : data.length)
        .append("\n")
        .append("encryptedPdu : ").append(encryptedPdu)
        .append("\n");
        SNMP_LOGGER.logp(Level.FINER, SnmpV3Message.class.getName(),
                "decodeMessage", strb.toString());
    }
}
项目:OLD-OpenJDK8    文件:SnmpV3Message.java   
/**
 * Decodes the specified bytes and initializes this message.
 * For internal use only.
 *
 * @param inputBytes The bytes to be decoded.
 *
 * @exception SnmpStatusException If the specified bytes are not a valid encoding.
 */
public void decodeMessage(byte[] inputBytes, int byteCount)
    throws SnmpStatusException {

    try {
        BerDecoder bdec = new BerDecoder(inputBytes);
        bdec.openSequence();
        version = bdec.fetchInteger();
        bdec.openSequence();
        msgId = bdec.fetchInteger();
        msgMaxSize = bdec.fetchInteger();
        msgFlags = bdec.fetchOctetString()[0];
        msgSecurityModel =bdec.fetchInteger();
        bdec.closeSequence();
        msgSecurityParameters = bdec.fetchOctetString();
        if( (msgFlags & SnmpDefinitions.privMask) == 0 ) {
            bdec.openSequence();
            contextEngineId = bdec.fetchOctetString();
            contextName = bdec.fetchOctetString();
            data = bdec.fetchAny();
            dataLength = data.length;
            bdec.closeSequence();
        }
        else {
            encryptedPdu = bdec.fetchOctetString();
        }
        bdec.closeSequence() ;
    }
    catch(BerException x) {
        x.printStackTrace();
        throw new SnmpStatusException("Invalid encoding") ;
    }

    if (SNMP_LOGGER.isLoggable(Level.FINER)) {
        final StringBuilder strb = new StringBuilder()
        .append("Unmarshalled message : \n")
        .append("version : ").append(version)
        .append("\n")
        .append("msgId : ").append(msgId)
        .append("\n")
        .append("msgMaxSize : ").append(msgMaxSize)
        .append("\n")
        .append("msgFlags : ").append(msgFlags)
        .append("\n")
        .append("msgSecurityModel : ").append(msgSecurityModel)
        .append("\n")
        .append("contextEngineId : ").append(contextEngineId == null ? null :
            SnmpEngineId.createEngineId(contextEngineId))
        .append("\n")
        .append("contextName : ").append(contextName)
        .append("\n")
        .append("data : ").append(data)
        .append("\n")
        .append("dat len : ").append((data == null) ? 0 : data.length)
        .append("\n")
        .append("encryptedPdu : ").append(encryptedPdu)
        .append("\n");
        SNMP_LOGGER.logp(Level.FINER, SnmpV3Message.class.getName(),
                "decodeMessage", strb.toString());
    }
}
项目:openjdk-jdk7u-jdk    文件:SnmpV3Message.java   
/**
 * Decodes the specified bytes and initializes this message.
 * For internal use only.
 *
 * @param inputBytes The bytes to be decoded.
 *
 * @exception SnmpStatusException If the specified bytes are not a valid encoding.
 */
public void decodeMessage(byte[] inputBytes, int byteCount)
    throws SnmpStatusException {

    try {
        BerDecoder bdec = new BerDecoder(inputBytes);
        bdec.openSequence();
        version = bdec.fetchInteger();
        bdec.openSequence();
        msgId = bdec.fetchInteger();
        msgMaxSize = bdec.fetchInteger();
        msgFlags = bdec.fetchOctetString()[0];
        msgSecurityModel =bdec.fetchInteger();
        bdec.closeSequence();
        msgSecurityParameters = bdec.fetchOctetString();
        if( (msgFlags & SnmpDefinitions.privMask) == 0 ) {
            bdec.openSequence();
            contextEngineId = bdec.fetchOctetString();
            contextName = bdec.fetchOctetString();
            data = bdec.fetchAny();
            dataLength = data.length;
            bdec.closeSequence();
        }
        else {
            encryptedPdu = bdec.fetchOctetString();
        }
        bdec.closeSequence() ;
    }
    catch(BerException x) {
        x.printStackTrace();
        throw new SnmpStatusException("Invalid encoding") ;
    }

    if (SNMP_LOGGER.isLoggable(Level.FINER)) {
        final StringBuilder strb = new StringBuilder()
        .append("Unmarshalled message : \n")
        .append("version : ").append(version)
        .append("\n")
        .append("msgId : ").append(msgId)
        .append("\n")
        .append("msgMaxSize : ").append(msgMaxSize)
        .append("\n")
        .append("msgFlags : ").append(msgFlags)
        .append("\n")
        .append("msgSecurityModel : ").append(msgSecurityModel)
        .append("\n")
        .append("contextEngineId : ").append(contextEngineId == null ? null :
            SnmpEngineId.createEngineId(contextEngineId))
        .append("\n")
        .append("contextName : ").append(contextName)
        .append("\n")
        .append("data : ").append(data)
        .append("\n")
        .append("dat len : ").append((data == null) ? 0 : data.length)
        .append("\n")
        .append("encryptedPdu : ").append(encryptedPdu)
        .append("\n");
        SNMP_LOGGER.logp(Level.FINER, SnmpV3Message.class.getName(),
                "decodeMessage", strb.toString());
    }
}