diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-01-25 18:00:45 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-01-25 18:00:45 +0000 |
commit | 3852b601e7c5d71282cb5e37e9c6ce6e648503a2 (patch) | |
tree | 65e9367a1a4e6b3386f3b745f0611fb13ac67396 /sandbox/travelsample/trip-contribution | |
parent | fcc6917ad657da26eedccadf3e7b8d81d410b6a7 (diff) |
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
Diffstat (limited to 'sandbox/travelsample/trip-contribution')
-rw-r--r-- | sandbox/travelsample/trip-contribution/src/scatours/trip/TripImpl.java | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/sandbox/travelsample/trip-contribution/src/scatours/trip/TripImpl.java b/sandbox/travelsample/trip-contribution/src/scatours/trip/TripImpl.java index 5aa0cb4438..9d51c8078b 100644 --- a/sandbox/travelsample/trip-contribution/src/scatours/trip/TripImpl.java +++ b/sandbox/travelsample/trip-contribution/src/scatours/trip/TripImpl.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 TripImpl implements Search { +@Service(interfaces={Search.class, Book.class}) +public class TripImpl implements Search, Book { private List<TripInfo> trips = new ArrayList<TripInfo>(); @@ -45,16 +46,26 @@ public class TripImpl implements Search { @Init public void init() { - trips.add(new TripInfo("FS1APR4", + trips.add(new TripInfo("FS1DEC06", "Florence and Siena pre-packaged tour", "LGW", "FLR", - "04/04/09", - "11/04/09", + "06/12/09", + "13/12/09", "27", 450, "EUR", "http://localhost:8085/tbd" )); + trips.add(new TripInfo("FS1DEC13", + "Florence and Siena pre-packaged tour 2", + "LGW", + "FLR", + "13/12/09", + "20/12/09", + "27", + 550, + "EUR", + "http://localhost:8085/tbd" )); } public TripItem[] searchSynch(TripLeg tripLeg) { @@ -67,7 +78,7 @@ public class TripImpl implements Search { (trip.getFromDate().equals(tripLeg.getFromDate()))){ TripItem item = new TripItem("", "", - "Trip", + TripItem.TRIP, trip.getName(), trip.getDescription(), trip.getFromLocation() + " - " + trip.getToLocation(), @@ -88,4 +99,8 @@ public class TripImpl implements Search { // return available hotels searchCallback.searchResults(searchSynch(tripLeg)); } + + public String book(TripItem tripItem) { + return "trip1"; + } } |