@ GET @ Path ( "/check" ) @ Produces ( APPLICATION_JSON ) @ Timed @ ExceptionMetered public VersionCheckResponse versionCheck ( @ QueryParam ( "client" ) @ DefaultValue ( "" ) final String client ) { final PomVersion serverVersion = PomVersion . parse ( Version . POM_VERSION ) ; final VersionCompatibility . Status status ; if ( isNullOrEmpty ( client ) ) { return new VersionCheckResponse ( VersionCompatibility . Status . MISSING , serverVersion , Version . RECOMMENDED_VERSION ) ; } final PomVersion clientVersion = PomVersion . parse ( client ) ; status = VersionCompatibility . getStatus ( serverVersion , clientVersion ) ; return new VersionCheckResponse ( status , serverVersion , Version . RECOMMENDED_VERSION ) ; }
Given the client version returns the version status i . e . whether or not they should be compatible or not .