From 3852b601e7c5d71282cb5e37e9c6ce6e648503a2 Mon Sep 17 00:00:00 2001 From: slaws Date: Sun, 25 Jan 2009 18:00:45 +0000 Subject: switch components so that the booking component talks directly to the trip suppliers. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@737553 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/scatours/flight/FlightImpl.java | 37 ++++++++++++---------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'sandbox/travelsample/flight-contribution/src/scatours/flight') diff --git a/sandbox/travelsample/flight-contribution/src/scatours/flight/FlightImpl.java b/sandbox/travelsample/flight-contribution/src/scatours/flight/FlightImpl.java index 106144aebd..72c1c7201c 100644 --- a/sandbox/travelsample/flight-contribution/src/scatours/flight/FlightImpl.java +++ b/sandbox/travelsample/flight-contribution/src/scatours/flight/FlightImpl.java @@ -26,6 +26,7 @@ import org.osoa.sca.annotations.Init; import org.osoa.sca.annotations.Scope; import org.osoa.sca.annotations.Service; +import scatours.common.Book; import scatours.common.Search; import scatours.common.SearchCallback; import scatours.common.TripItem; @@ -35,8 +36,8 @@ import scatours.common.TripLeg; * An implementation of the Hotel service */ @Scope("STATELESS") -@Service(interfaces={Search.class}) -public class FlightImpl implements Search { +@Service(interfaces={Search.class, Book.class}) +public class FlightImpl implements Search, Book { private List flights = new ArrayList(); @@ -45,25 +46,25 @@ public class FlightImpl implements Search { @Init public void init() { - flights.add(new FlightInfo("IA26", - "Island Airlines Boeing 747", + flights.add(new FlightInfo("EA26", + "Europe Airlines Airbus A300", "LGW", - "ANU", - "06/12/08", - "06/12/08", + "FLR", + "06/12/09", + "06/12/09", "350", 250, - "USD", + "EUR", "http://localhost:8085/tbd" )); - flights.add(new FlightInfo("IA27", - "Island Airlines Boeing 747", - "ANU", + flights.add(new FlightInfo("EA27", + "Europe Airlines Airbus A300", + "FLR", "LGW", - "13/12/08", - "13/12/08", + "13/12/09", + "13/12/09", "350", 250, - "USD", + "EUR", "http://localhost:8085/tbd" )); } @@ -78,7 +79,7 @@ public class FlightImpl implements Search { (flight.getFromDate().equals(tripLeg.getFromDate()))){ TripItem item = new TripItem("", "", - "Flight", + TripItem.FLIGHT, flight.getName(), flight.getDescription(), flight.getFromLocation() + " - " + flight.getToLocation(), @@ -98,7 +99,7 @@ public class FlightImpl implements Search { (flight.getFromDate().equals(tripLeg.getToDate()))){ TripItem item = new TripItem("", "", - "Flight", + TripItem.FLIGHT, flight.getName(), flight.getDescription(), flight.getFromLocation() + " - " + flight.getToLocation(), @@ -119,4 +120,8 @@ public class FlightImpl implements Search { // return available hotels searchCallback.searchResults(searchSynch(tripLeg)); } + + public String book(TripItem tripItem) { + return "flight1"; + } } -- cgit v1.2.3