protected Response getOrganizations(UriInfo info, final MediaType responseType) {
        List<Organization> organizations = null;

        String status = info.getQueryParameters().getFirst("Status");

        if(status != null && Organization.Status.getValueOf(status.toLowerCase()) != null){
            organizations = organizationsDao.getOrganizationsByStatus(Organization.Status.getValueOf(status.toLowerCase()));
        }else{
            organizations = organizationsDao.getAllOrganizations();
        }
        if (organizations == null || organizations.isEmpty()) {
            return status(NOT_FOUND).build();
        }
        if (APPLICATION_XML_TYPE.equals(responseType)) {
            final RestCommResponse response = new RestCommResponse(new OrganizationList(organizations));
            return ok(xstream.toXML(response), APPLICATION_XML).build();
        } else if (APPLICATION_JSON_TYPE.equals(responseType)) {
            return ok(gson.toJson(organizations), APPLICATION_JSON).build();
        } else {
            return null;
        }
    }
protected Response getOrganizations ( UriInfo info , final MediaType responseType ) { List < Organization > organizations = null ; String status = info . getQueryParameters ( ) . getFirst ( "Status" ) ; if ( status != null && Organization . Status . getValueOf ( status . toLowerCase ( ) ) != null ) { organizations = organizationsDao . getOrganizationsByStatus ( Organization . Status . getValueOf ( status . toLowerCase ( ) ) ) ; } else { organizations = organizationsDao . getAllOrganizations ( ) ; } if ( organizations == null || organizations . isEmpty ( ) ) { return status ( NOT_FOUND ) . build ( ) ; } if ( APPLICATION_XML_TYPE . equals ( responseType ) ) { final RestCommResponse response = new RestCommResponse ( new OrganizationList ( organizations ) ) ; return ok ( xstream . toXML ( response ) , APPLICATION_XML ) . build ( ) ; } else if ( APPLICATION_JSON_TYPE . equals ( responseType ) ) { return ok ( gson . toJson ( organizations ) , APPLICATION_JSON ) . build ( ) ; } else { return null ; } }
@param info
@param responseType
@return