This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private BorrowedListMessage getResponse(boolean forceRefresh) { | |
final BorrowedListMessage response; | |
if (forceRefresh) { | |
// force is true - try the service | |
final BorrowedListMessage serviceResponse = borrowedService.getBorrowed(patron); | |
if (serviceResponse.getResponseStatus().equals(ResponseStatus.OK)) { | |
// service response is good - use it | |
response = serviceResponse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public BorrowedListMessage getBorrowed(Context context) { | |
final BorrowedListMessage message; | |
final App app = App.getInstance(); | |
if(null == app.getBorrowed()){ | |
message = serializableCache.loadCachedData(BorrowedListMessage.class, context.getCacheDir()); | |
app.setBorrowed(message); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void setBorrowed(final BorrowedListMessage message, final Context context) { | |
App.getInstance().setBorrowed(message); | |
new AsyncTask<Void, Void, Void>(){ | |
@Override | |
protected Void doInBackground(final Void... params) { | |
serializableCache.saveCachedData(message, context.getCacheDir()); | |
return null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void deleteTitlesFromCloudSearch(List<AmazonSearchDataFormat> amazonSearchRecords) { | |
logger.debug("Deleting {} titles from CloudSearch", amazonSearchRecords.size()); | |
if (amazonSearchRecords.isEmpty()) return; | |
try { | |
postBatchToCloudSearch(cloudSearchTitlesEndpoint, amazonSearchRecords); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.alex.integration.aws; | |
import com.amazonaws.auth.AWSCredentials; | |
import com.amazonaws.auth.AWSCredentialsProvider; | |
import com.amazonaws.auth.BasicAWSCredentials; | |
import com.amazonaws.auth.InstanceProfileCredentialsProvider; | |
import org.apache.commons.lang3.StringUtils; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.beans.factory.annotation.Value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<build> | |
<finalName>${project.artifactId}-${project.version}-${maven.build.timestamp}</finalName> | |
<plugins> | |
<plugin> | |
<groupId>org.codehaus.mojo</groupId> | |
<artifactId>cobertura-maven-plugin</artifactId> | |
<version>2.5.1</version> | |
<configuration> | |
<formats> | |
<format>html</format> |
OlderNewer