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 class TemplateApplication extends Application<ServiceConfiguration> { | |
public static void main(String[] args) throws Exception { | |
new TemplateApplication().run(args); | |
} | |
@Override | |
public void run(ServiceConfiguration configuration, Environment environment) throws Exception { |
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.example.helloworld.resources; | |
import javax.jws.WebMethod; | |
@javax.jws.WebService( | |
name = "AddNumbersPortType", | |
serviceName = "AddNumbersService", | |
targetNamespace = "http://duke.example.org") | |
@javax.jws.soap.SOAPBinding( | |
style = javax.jws.soap.SOAPBinding.Style.DOCUMENT, |
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 class DateTimeDeserializer extends JsonDeserializer<DateTime> { | |
@Override | |
public DateTime deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { | |
if (jp.getCurrentToken() == JsonToken.VALUE_NUMBER_INT) { | |
return new DateTime(jp.getLongValue()); | |
} | |
throw ctxt.mappingException("Expected JSON Number"); | |
} |
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
#!/bin/bash | |
FAIL_COUNT=0 | |
TIME=1 | |
while true; do | |
ping -c 1 -t 1 google.com > /dev/null | |
if [ $? -ne 0 ]; then | |