summaryrefslogtreecommitdiffstats
path: root/sandbox/travelsample/flight-contribution/src/scatours/flight
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-01-25 18:00:45 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-01-25 18:00:45 +0000
commit3852b601e7c5d71282cb5e37e9c6ce6e648503a2 (patch)
tree65e9367a1a4e6b3386f3b745f0611fb13ac67396 /sandbox/travelsample/flight-contribution/src/scatours/flight
parentfcc6917ad657da26eedccadf3e7b8d81d410b6a7 (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/flight-contribution/src/scatours/flight')
-rw-r--r--sandbox/travelsample/flight-contribution/src/scatours/flight/FlightImpl.java37
1 files changed, 21 insertions, 16 deletions
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<FlightInfo> flights = new ArrayList<FlightInfo>();
@@ -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";
+ }
}