# DisconnectReason (sshj 0.4.0 API)
Date: 2011-06-06

## net.schmizz.sshj.common
Enum DisconnectReason

    java.lang.Object
      java.lang.Enum<DisconnectReason>
          net.schmizz.sshj.common.DisconnectReason

All Implemented Interfaces:
  Serializable, Comparable<DisconnectReason>

    public enum DisconnectReason

extends Enum<DisconnectReason>

Disconnect error codes

Enum Constant Summary
`AUTH_CANCELLED_BY_USER`
`BY_APPLICATION`
`COMPRESSION_ERROR`
`CONNECTION_LOST`
`HOST_KEY_NOT_VERIFIABLE`
`HOST_NOT_ALLOWED_TO_CONNECT`
`ILLEGAL_USER_NAME`
`KEY_EXCHANGE_FAILED`
`MAC_ERROR`
`NO_MORE_AUTH_METHODS_AVAILABLE`
`PROTOCOL_ERROR`
`PROTOCOL_VERSION_NOT_SUPPORTED`
`RESERVED`
`SERVICE_NOT_AVAILABLE`
`TOO_MANY_CONNECTIONS`
`UNKNOWN`

Method Summary
`static DisconnectReason` `fromInt(int code)`
`int` `toInt()`
`static DisconnectReason` `valueOf(String name)` Returns the enum constant of this type with the specified name.
`static DisconnectReason[]` `values()` Returns an array containing the constants of this enum type, in the order they are declared.

Methods inherited from class java.lang.Enum
`clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, wait, wait, wait`

Enum Constant Detail

### UNKNOWN

    public static final DisconnectReason UNKNOWN

### HOST_NOT_ALLOWED_TO_CONNECT

    public static final DisconnectReason HOST_NOT_ALLOWED_TO_CONNECT

### PROTOCOL_ERROR

    public static final DisconnectReason PROTOCOL_ERROR

### KEY_EXCHANGE_FAILED

    public static final DisconnectReason KEY_EXCHANGE_FAILED

### RESERVED

    public static final DisconnectReason RESERVED

### MAC_ERROR

    public static final DisconnectReason MAC_ERROR

### COMPRESSION_ERROR

    public static final DisconnectReason COMPRESSION_ERROR

### SERVICE_NOT_AVAILABLE

    public static final DisconnectReason SERVICE_NOT_AVAILABLE

### PROTOCOL_VERSION_NOT_SUPPORTED

    public static final DisconnectReason PROTOCOL_VERSION_NOT_SUPPORTED

### HOST_KEY_NOT_VERIFIABLE

    public static final DisconnectReason HOST_KEY_NOT_VERIFIABLE

### CONNECTION_LOST

    public static final DisconnectReason CONNECTION_LOST

### BY_APPLICATION

    public static final DisconnectReason BY_APPLICATION

### TOO_MANY_CONNECTIONS

    public static final DisconnectReason TOO_MANY_CONNECTIONS

### AUTH_CANCELLED_BY_USER

    public static final DisconnectReason AUTH_CANCELLED_BY_USER

### NO_MORE_AUTH_METHODS_AVAILABLE

    public static final DisconnectReason NO_MORE_AUTH_METHODS_AVAILABLE

### ILLEGAL_USER_NAME

    public static final DisconnectReason ILLEGAL_USER_NAME

Method Detail

### values

    public static DisconnectReason[] values()

  Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

      for (DisconnectReason c : DisconnectReason.values())
          System.out.println(c);

  Returns:
    an array containing the constants of this enum type, in the order they are declared

### valueOf

    public static DisconnectReason valueOf(String name)

  Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

  Parameters:
    `name` - the name of the enum constant to be returned.
  Returns:
    the enum constant with the specified name
  Throws:
    `IllegalArgumentException` - if this enum type has no constant with the specified name
    `NullPointerException` - if the argument is null

### fromInt

    public static DisconnectReason fromInt(int code)

### toInt

    public int toInt()

Copyright © 2009-2011. All Rights Reserved.