This file contains hidden or 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
@After | |
public void after() { | |
System.clearProperty("AWS_ACCESS_KEY_ID"); | |
System.clearProperty("AWS_SECRET_KEY"); | |
} | |
@Test | |
public void should_get_aws_credentials_in_local_environment() throws Exception { | |
// setup test |
This file contains hidden or 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
select | |
max(library.name) as libraryName, | |
libraryId, | |
max(tv_rating_system) as tv_rating_system, | |
max(movie_rating_system) as movie_rating_system, | |
max(ab_enabled) as ab_enabled, | |
max(movie_enabled) as movie_enabled, | |
max(music_enabled) as music_enabled, | |
max(tv_enabled) as tv_enabled | |
from ( |
This file contains hidden or 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.processor; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.stereotype.Component; | |
@Component("pushNotificationMessageProcessor") | |
public class PushNotificationMessageProcessor { | |
private static final Logger log = LoggerFactory.getLogger(PushNotificationMessageProcessor.class); |
This file contains hidden or 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
// todo: figure out how to load this from PEM file | |
// (ANDROID) not applicable; this will be null; | |
// (iOS) the certificate in pem format with \n at the end of each line. | |
private String principal; | |
// todo: figure out how to load this from PEM file | |
// (ANDROID) the server api key from the google api console | |
// (iOS) the private key in pem format with \n at the end of each line. | |
private String credential; |
This file contains hidden or 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 CreatePlatformApplicationResult createPlatformApplication(String applicationName, Platform platform, String principal, String credential) { | |
CreatePlatformApplicationRequest platformApplicationRequest = new CreatePlatformApplicationRequest(); | |
Map<String, String> attributes = new HashMap<String, String>(); | |
attributes.put("PlatformPrincipal", principal == null ? "" : principal); | |
attributes.put("PlatformCredential", credential); | |
platformApplicationRequest.setAttributes(attributes); | |
platformApplicationRequest.setName(applicationName); | |
platformApplicationRequest.setPlatform(platform.name()); | |
return snsClient.createPlatformApplication(platformApplicationRequest); | |
} |
This file contains hidden or 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
@Mock | |
private PublishResult publishResult; | |
@Value("${GOOGLE_SERVER_API_KEY}") | |
private String googleServerApiKey; | |
@Value("${APPLE_CERT_FILE}") | |
private String appleCertificate; | |
@Value("${APPLE_PRIVATE_KEY_FILE}") |
This file contains hidden or 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.processor; | |
import com.alex.integration.bean.PatronDevice; | |
import com.alex.integration.bean.Platform; | |
import com.alex.integration.bean.PushNotificationMessage; | |
import com.amazonaws.AmazonClientException; | |
import com.amazonaws.AmazonServiceException; | |
import com.amazonaws.services.sns.AmazonSNS; | |
import com.amazonaws.services.sns.model.*; | |
import com.fasterxml.jackson.core.JsonProcessingException; |
This file contains hidden or 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
<select id="getRemainingBorrowsForMonth" resultType="java.lang.Integer"> | |
select | |
( | |
select circsPerPatronMonth | |
from Account | |
where libraryId = (select libraryId from Patron where id=#{value}) | |
) | |
- | |
( | |
select count(*) |
This file contains hidden or 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.alexandria.licenseproxy.stripes.ebook; | |
import com.alexandria.licenseproxy.helper.CircHelper; | |
import com.alexandria.licenseproxy.helper.EBookHelper; | |
import com.google.inject.Inject; | |
import net.sourceforge.stripes.action.*; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import javax.servlet.http.HttpServletResponse; |
This file contains hidden or 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
@Component("pushNotificationListProcessor") | |
public class PushNotificationListProcessor { | |
private static final Logger log = LoggerFactory.getLogger(PushNotificationMessageProcessor.class); | |
private final PatronDeviceHelper patronDeviceHelper; | |
@Autowired | |
public PushNotificationListProcessor(final PatronDeviceHelper patronDeviceHelper) { | |
this.patronDeviceHelper = patronDeviceHelper; | |
} |