org.xnap.plugin.opennap.util
Class OpenNapServerVersion

java.lang.Object
  extended by org.xnap.plugin.opennap.util.OpenNapServerVersion

public class OpenNapServerVersion
extends java.lang.Object

This class provides means to parse the version string that is submitted by most servers on login. This class is used by MessageSender to send messages that are only supported by specific server software version.


Field Summary
 OpenNapServerVersion nextVersion
           
static OpenNapServerVersion OPENNAP044
           
static OpenNapServerVersion SLAVANAP1
           
static OpenNapServerVersion SLAVANAP2
           
 java.lang.String software
           
static OpenNapServerVersion[] TOP_VERSIONS
           
static OpenNapServerVersion UNKNOWN
           
 int[] versions
           
 
Constructor Summary
OpenNapServerVersion(java.lang.String version)
           
OpenNapServerVersion(java.lang.String version, OpenNapServerVersion nextVersion)
           
 
Method Summary
 OpenNapServerVersion getClosestVersion()
          Find a known version that is smaller than ours.
 OpenNapServerVersion getNextVersion()
           
 boolean isCompatibleTo(OpenNapServerVersion v)
          Returns true, if this version is greater or equal than v.
 boolean isOpenNap()
           
 boolean isSlavaNap()
           
protected  void parse(java.lang.String version)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OPENNAP044

public static final OpenNapServerVersion OPENNAP044

SLAVANAP1

public static final OpenNapServerVersion SLAVANAP1

SLAVANAP2

public static final OpenNapServerVersion SLAVANAP2

UNKNOWN

public static final OpenNapServerVersion UNKNOWN

TOP_VERSIONS

public static final OpenNapServerVersion[] TOP_VERSIONS

software

public java.lang.String software

versions

public int[] versions

nextVersion

public OpenNapServerVersion nextVersion
Constructor Detail

OpenNapServerVersion

public OpenNapServerVersion(java.lang.String version,
                            OpenNapServerVersion nextVersion)

OpenNapServerVersion

public OpenNapServerVersion(java.lang.String version)
Method Detail

getClosestVersion

public OpenNapServerVersion getClosestVersion()
Find a known version that is smaller than ours. That should be compatible for sure.


getNextVersion

public OpenNapServerVersion getNextVersion()

isOpenNap

public boolean isOpenNap()

isSlavaNap

public boolean isSlavaNap()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isCompatibleTo

public boolean isCompatibleTo(OpenNapServerVersion v)
Returns true, if this version is greater or equal than v.


parse

protected void parse(java.lang.String version)


Copyright © 2001-2005 XNap Team. All Rights Reserved.