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/hotel/HotelImpl.java | 35 ++++++++++++---------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'sandbox/travelsample/hotel-contribution/src/scatours/hotel/HotelImpl.java') diff --git a/sandbox/travelsample/hotel-contribution/src/scatours/hotel/HotelImpl.java b/sandbox/travelsample/hotel-contribution/src/scatours/hotel/HotelImpl.java index 81012ea08b..a9a6d1bbde 100644 --- a/sandbox/travelsample/hotel-contribution/src/scatours/hotel/HotelImpl.java +++ b/sandbox/travelsample/hotel-contribution/src/scatours/hotel/HotelImpl.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 HotelImpl implements Search { +@Service(interfaces={Search.class, Book.class}) +public class HotelImpl implements Search, Book { private List hotels = new ArrayList(); @@ -47,35 +48,35 @@ public class HotelImpl implements Search { public void init() { hotels.add(new HotelInfo("Deep Bay Hotel", "Wonderful sea views and a relaxed atmosphere", - "ANU", - "06/12/08", + "FLR", + "06/12/09", "200", 100, - "USD", + "EUR", "http://localhost:8085/tbd" )); hotels.add(new HotelInfo("Long Bay Hotel", "Friendly staff and an ocean breeze", - "ANU", - "06/12/08", + "FLR", + "06/12/09", "200", 100, - "USD", + "EUR", "http://localhost:8085/tbd" )); hotels.add(new HotelInfo("City Hotel", "Smart rooms and early breakfasts", - "NY", - "06/12/08", + "FLR", + "06/12/09", "200", 100, - "USD", + "EUR", "http://localhost:8085/tbd" )); hotels.add(new HotelInfo("County Hotel", "The smell of the open country", - "SOU", - "06/12/08", + "FLR", + "06/12/09", "200", 100, - "USD", + "EUR", "http://localhost:8085/tbd" )); } @@ -87,7 +88,7 @@ public class HotelImpl implements Search { if (hotel.getLocation().equals(tripLeg.getToLocation())){ TripItem item = new TripItem("", "", - "Hotel", + TripItem.HOTEL, hotel.getName(), hotel.getDescription(), hotel.getLocation(), @@ -108,4 +109,8 @@ public class HotelImpl implements Search { // return available hotels searchCallback.searchResults(searchSynch(tripLeg)); } + + public String book(TripItem tripItem) { + return "hotel1"; + } } -- cgit v1.2.3