@GET
    public Response getApplication(@PathParam("version") String version,
                                   @HeaderParam("Accept") final String acceptHeader,
                                   @HeaderParam(EurekaAccept.HTTP_X_EUREKA_ACCEPT) String eurekaAccept) {
        if (!registry.shouldAllowAccess(false)) {
            return Response.status(Status.FORBIDDEN).build();
        }

        EurekaMonitors.GET_APPLICATION.increment();

        CurrentRequestVersion.set(Version.toEnum(version));
        KeyType keyType = Key.KeyType.JSON;
        if (acceptHeader == null || !acceptHeader.contains("json")) {
            keyType = Key.KeyType.XML;
        }

        Key cacheKey = new Key(
                Key.EntityType.Application,
                appName,
                keyType,
                CurrentRequestVersion.get(),
                EurekaAccept.fromString(eurekaAccept)
        );

        String payLoad = responseCache.get(cacheKey);

        if (payLoad != null) {
            logger.debug("Found: {}", appName);
            return Response.ok(payLoad).build();
        } else {
            logger.debug("Not Found: {}", appName);
            return Response.status(Status.NOT_FOUND).build();
        }
    }
@ GET public Response getApplication ( @ PathParam ( "version" ) String version , @ HeaderParam ( "Accept" ) final String acceptHeader , @ HeaderParam ( EurekaAccept . HTTP_X_EUREKA_ACCEPT ) String eurekaAccept ) { if ( ! registry . shouldAllowAccess ( false ) ) { return Response . status ( Status . FORBIDDEN ) . build ( ) ; } EurekaMonitors . GET_APPLICATION . increment ( ) ; CurrentRequestVersion . set ( Version . toEnum ( version ) ) ; KeyType keyType = Key . KeyType . JSON ; if ( acceptHeader == null || ! acceptHeader . contains ( "json" ) ) { keyType = Key . KeyType . XML ; } Key cacheKey = new Key ( Key . EntityType . Application , appName , keyType , CurrentRequestVersion . get ( ) , EurekaAccept . fromString ( eurekaAccept ) ) ; String payLoad = responseCache . get ( cacheKey ) ; if ( payLoad != null ) { logger . debug ( "Found: {}" , appName ) ; return Response . ok ( payLoad ) . build ( ) ; } else { logger . debug ( "Not Found: {}" , appName ) ; return Response . status ( Status . NOT_FOUND ) . build ( ) ; } }
Gets information about a particular {@link com.netflix.discovery.shared.Application}.

@param version
the version of the request.
@param acceptHeader
the accept header of the request to indicate whether to serve
JSON or XML data.
@return the response containing information about a particular
application.