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.jasonwhaley.rest; | |
| import javax.xml.bind.annotation.XmlElement; | |
| import javax.xml.bind.annotation.XmlRootElement; | |
| import javax.xml.bind.annotation.XmlTransient; | |
| @XmlRootElement(name = "player") | |
| public class Player { | |
| @XmlElement(name = "nickname") |
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.jasonwhaley.rest; | |
| import javax.ws.rs.GET; | |
| import javax.ws.rs.Path; | |
| import javax.ws.rs.PathParam; | |
| import javax.ws.rs.Produces; | |
| import javax.ws.rs.QueryParam; | |
| public class PlayerService { |
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
| [whaley@sunspot ~] | |
| > curl -H"Accept:application/json" 'http://localhost:8080/rest-sample/service/player/whaley?playerClass=Soldier' | |
| {"player":{"nickname":"whaley","playerClass":"Soldier"}} | |
| [whaley@sunspot ~] | |
| > curl -H"Accept:application/xml" 'http://localhost:8080/rest-sample/service/player/whaley?playerClass=Soldier' | |
| <?xml version="1.0" encoding="UTF-8" standalone="yes"?><player><nickname>whaley</nickname><playerClass>Soldier</playerClass></player> |
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
| <dependency> | |
| <groupId>org.apache.cxf</groupId> | |
| <artifactId>cxf-bundle-jaxrs</artifactId> | |
| <version>2.3.1</version> | |
| </dependency> |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <wsdl:definitions targetNamespace="http://www.example.com/webservice" | |
| xmlns:tns="http://www.example.com/webservice" | |
| xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" | |
| xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" | |
| xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" | |
| xmlns:wsoap12="http://schemas.xmlsoap.org/wsdl/soap12/" | |
| xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" | |
| xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" |
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
| [whaley@sunspot ~/opt/ec2/credentials] | |
| > ls -lh | |
| total 16 | |
| lrwxr-xr-x 1 whaley staff 46B Oct 22 06:44 current -> /Users/whaley/opt/ec2/credentials//jasonwhaley | |
| drwxr-xr-x 2 whaley staff 374B Apr 29 2010 client1 | |
| drwxr-xr-x 2 whaley staff 374B Jan 18 2010 client2 | |
| drwxr-xr-x 2 whaley staff 374B Jan 18 2010 jasonwhaley | |
| -rwxr--r-- 1 whaley staff 978B Jul 20 07:24 switch_ec2_creds.sh | |
| [whaley@sunspot ~/opt/ec2/credentials] |
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
| export EC2_CREDENTIAL_LOCATION=$HOME/opt/ec2/credentials/current/ | |
| export EC2_PRIVATE_KEY=$EC2_CREDENTIAL_LOCATION/pk | |
| export EC2_CERT=$EC2_CREDENTIAL_LOCATION/cert | |
| export EC2_KEYPAIR_KEY=$EC2_CREDENTIAL_LOCATION/keypair_pk |
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
| #!/bin/bash | |
| BASE_DIRECTORY=$HOME/opt/ec2/credentials/ | |
| function outputChoices { | |
| local count=0 | |
| for directory in ${directories[@]} | |
| do | |
| echo -e "$count:\t$(basename $directory)" | |
| ((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
| [whaley@sunspot ~/opt/ec2/credentials] | |
| > switch_ec2_creds | |
| 0: jasonwhaley | |
| 1: client1 | |
| 2: client2 | |
| Select one of [0-2] - any other input leaves creds unchanged: 2 | |
| Credentials set to /Users/whaley/opt/ec2/credentials//client2 | |
| [whaley@sunspot ~/opt/ec2/credentials] |
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.jasonwhaley.tictactoe | |
| sealed abstract class TicTacToeSpace { | |
| val representation : String | |
| override def toString() : String = { | |
| return representation | |
| } | |
| } | |
| case class X extends TicTacToeSpace { |