Package de.justi.yagwapi.common

Examples of de.justi.yagwapi.common.RetryClientFilter


      return this.apieStatesCache.get("", new Callable<Map<String, IAPIStateDTO>>() {
        @Override
        public Map<String, IAPIStateDTO> call() throws Exception {
          try {
            final WebResource resource = ServiceConstants.REST_CLIENT.resource(API_STATES_URL.toExternalForm());
            resource.addFilter(new RetryClientFilter(RETRY_COUNT));
            final WebResource.Builder builder = resource.accept(MediaType.APPLICATION_JSON_TYPE);
            try {
              final String response = builder.get(String.class).replaceAll(Pattern.quote("\\"), "");
              LOGGER.trace("Retrieved response=" + response);
              final Map<String, IAPIStateDTO> result = GW2StatsService.this.gw2statsDTOFactory.newAPIStatesOf(response);
View Full Code Here


    try {
      return this.apieStateDescriptionsCache.get("", new Callable<Map<String, IAPIStateDescriptionDTO>>() {
        @Override
        public Map<String, IAPIStateDescriptionDTO> call() throws Exception {
          final WebResource resource = ServiceConstants.REST_CLIENT.resource(API_STATE_DESCRIPTIONS_URL.toExternalForm());
          resource.addFilter(new RetryClientFilter(RETRY_COUNT));
          final WebResource.Builder builder = resource.accept(MediaType.APPLICATION_JSON_TYPE);
          try {
            final String response = builder.get(String.class);
            LOGGER.trace("Retrieved response=" + response);
            final Map<String, IAPIStateDescriptionDTO> result = GW2StatsService.this.gw2statsDTOFactory.newAPIStateDescriptionsOf(response);
View Full Code Here

    try {
      return this.matchesCache.get("", new Callable<Optional<IWVWMatchesDTO>>() {
        @Override
        public Optional<IWVWMatchesDTO> call() throws Exception {
          final WebResource resource = ServiceUtils.REST_CLIENT.resource(MATCHES_URL.toExternalForm());
          resource.addFilter(new RetryClientFilter(ServiceUtils.REST_RETRY_COUNT));
          final WebResource.Builder builder = resource.accept(MediaType.APPLICATION_JSON_TYPE);
          try {
            final String response = builder.get(String.class);
            LOGGER.trace("Retrieved response=" + response);
            final IWVWMatchesDTO result = WVWService.this.wvwDTOFactory.newMatchesOf(response);
View Full Code Here

    try {
      return this.matchDetailsCache.get(id, new Callable<Optional<IWVWMatchDetailsDTO>>() {
        @Override
        public Optional<IWVWMatchDetailsDTO> call() throws Exception {
          final WebResource resource = ServiceUtils.REST_CLIENT.resource(MATCH_DETAILS_URL.toExternalForm()).queryParam("match_id", id);
          resource.addFilter(new RetryClientFilter(ServiceUtils.REST_RETRY_COUNT));
          final WebResource.Builder builder = resource.accept(MediaType.APPLICATION_JSON_TYPE);
          try {
            final String response = builder.get(String.class);
            LOGGER.trace("Retrieved response=" + response);
            final IWVWMatchDetailsDTO result = WVWService.this.wvwDTOFactory.newMatchDetailsOf(response);
View Full Code Here

    try {
      return this.objectiveNamesCache.get(key, new Callable<Optional<IWVWObjectiveNameDTO[]>>() {
        @Override
        public Optional<IWVWObjectiveNameDTO[]> call() throws Exception {
          final WebResource resource = ServiceUtils.REST_CLIENT.resource(OBJECTIVE_NAMES_URL.toExternalForm()).queryParam("lang", key.getLanguage());
          resource.addFilter(new RetryClientFilter(ServiceUtils.REST_RETRY_COUNT));
          final WebResource.Builder builder = resource.accept(MediaType.APPLICATION_JSON_TYPE);
          try {
            final String response = builder.get(String.class);
            LOGGER.trace("Retrieved response=" + response);
            final IWVWObjectiveNameDTO[] result = WVWService.this.wvwDTOFactory.newObjectiveNamesOf(response);
View Full Code Here

    try {
      return this.guildDetailsCache.get(id, new Callable<Optional<IGuildDetailsDTO>>() {
        @Override
        public Optional<IGuildDetailsDTO> call() throws Exception {
          final WebResource resource = ServiceUtils.REST_CLIENT.resource(GUILD_DETAILS_URL.toExternalForm()).queryParam("guild_id", id);
          resource.addFilter(new RetryClientFilter(ServiceUtils.REST_RETRY_COUNT));
          final WebResource.Builder builder = resource.accept(MediaType.APPLICATION_JSON_TYPE);
          try {
            final String response = builder.get(String.class);
            LOGGER.trace("Retrieved response=" + response);
            final IGuildDetailsDTO result = GuildService.this.guildDTOFactory.newGuildDetailsOf(response);
View Full Code Here

      return this.worldNamesCache.get(key, new Callable<Optional<IWorldNameDTO[]>>() {
        @Override
        public Optional<IWorldNameDTO[]> call() throws Exception {
          checkNotNull(key);
          final WebResource resource = ServiceUtils.REST_CLIENT.resource(WORL_NAMES_URL.toExternalForm()).queryParam("lang", key.getLanguage());
          resource.addFilter(new RetryClientFilter(ServiceUtils.REST_RETRY_COUNT));
          final WebResource.Builder builder = resource.accept(MediaType.APPLICATION_JSON_TYPE);
          try {
            final String response = builder.get(String.class);
            LOGGER.trace("Retrieved response=" + response);
            final IWorldNameDTO[] result = WorldService.this.worldDTOFactory.newWorldNamesOf(response);
View Full Code Here

TOP

Related Classes of de.justi.yagwapi.common.RetryClientFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.