This identification string does not contain the optional 'comments'
string and is thusly terminated by a CR and LF immediately after the
'softwareversion' string.
- Version:
- 1.0
- Author:
- Alex Usun
Constructor Summary |
ProtocolVersion(java.lang.String banner,
java.lang.String line)
|
ProtocolVersion(java.lang.String banner,
java.lang.String softVersion,
java.lang.String comments)
Creates a new protocol version instance with default protocol version "2.0". |
ProtocolVersion(java.lang.String banner,
java.lang.String protocolVersion,
java.lang.String softVersion,
java.lang.String comments)
Creates a new protocol version instance. |
Method Summary |
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
java.lang.String |
getBanner()
Returns the banner message. |
java.lang.String |
getComments()
Returns the comments. |
java.lang.String |
getSoftVersion()
Returns the software version. |
java.lang.String |
getVersion()
Returns the SSH protocol version. |
int |
hashCode()
Returns the object hash code. |
boolean |
isCompatible(ProtocolVersion that)
Checks if two protocol version are compatible. |
static ProtocolVersion |
readFrom(java.io.InputStream in)
|
java.lang.String |
toString()
Returns a string representation of the object. |
void |
writeTo(java.io.OutputStream out)
|
Methods inherited from class java.lang.Object |
equals, getClass, notify, notifyAll, wait, wait, wait |
ProtocolVersion
public ProtocolVersion(java.lang.String banner,
java.lang.String protocolVersion,
java.lang.String softVersion,
java.lang.String comments)
- Creates a new protocol version instance.
- Parameters:
banner
- the banner messageprotocolVersion
- the current protocol versionsoftVersion
- the software versioncomments
- the comments
ProtocolVersion
public ProtocolVersion(java.lang.String banner,
java.lang.String softVersion,
java.lang.String comments)
- Creates a new protocol version instance with default protocol version "2.0".
- Parameters:
banner
- the banner messagesoftVersion
- the software versioncomments
- the comments
ProtocolVersion
public ProtocolVersion(java.lang.String banner,
java.lang.String line)
readFrom
public static ProtocolVersion readFrom(java.io.InputStream in)
throws java.io.IOException
- Parameters:
in
-
- Returns:
- ProtocolVersion
- Throws:
java.io.IOException
getBanner
public java.lang.String getBanner()
- Returns the banner message.
- Returns:
- the banner message
getVersion
public java.lang.String getVersion()
- Returns the SSH protocol version.
- Returns:
- the SSH protocol version
getSoftVersion
public java.lang.String getSoftVersion()
- Returns the software version.
- Returns:
- the software version
getComments
public java.lang.String getComments()
- Returns the comments.
- Returns:
- the comments
toString
public java.lang.String toString()
- Returns a string representation of the object.
- Overrides:
toString
in class java.lang.Object
- Returns:
- a string representation of the object
isCompatible
public boolean isCompatible(ProtocolVersion that)
- Checks if two protocol version are compatible.
- Parameters:
that
- peer version
- Returns:
true
if versions are compatible;
false
otherwise
hashCode
public int hashCode()
- Returns the object hash code.
- Overrides:
hashCode
in class java.lang.Object
- Returns:
- the object hash code
compareTo
public int compareTo(java.lang.Object o)
- Compares this object with the specified object for order.
- Specified by:
compareTo
in interface java.lang.Comparable
- Parameters:
o
- the object to be compared
- Returns:
- a negative integer, zero, or a positive integer as this
object is less than, equal to, or greater than the specified object
writeTo
public void writeTo(java.io.OutputStream out)
throws java.io.IOException
- Parameters:
out
-
- Throws:
java.io.IOException
Copyright © JSCAPE LLC. 1999-2011. All Rights Reserved