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/common-contribution/src | |
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 '')
-rw-r--r-- | sandbox/travelsample/common-contribution/src/scatours/common/Book.java | 31 | ||||
-rw-r--r-- | sandbox/travelsample/common-contribution/src/scatours/common/TripItem.java | 55 |
2 files changed, 86 insertions, 0 deletions
diff --git a/sandbox/travelsample/common-contribution/src/scatours/common/Book.java b/sandbox/travelsample/common-contribution/src/scatours/common/Book.java new file mode 100644 index 0000000000..f42db4341b --- /dev/null +++ b/sandbox/travelsample/common-contribution/src/scatours/common/Book.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package scatours.common; + +import java.util.List; + +import org.osoa.sca.annotations.Callback; +import org.osoa.sca.annotations.OneWay; +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Book { + String book(TripItem tripItem); +} diff --git a/sandbox/travelsample/common-contribution/src/scatours/common/TripItem.java b/sandbox/travelsample/common-contribution/src/scatours/common/TripItem.java index f1e3581d86..e991668cbc 100644 --- a/sandbox/travelsample/common-contribution/src/scatours/common/TripItem.java +++ b/sandbox/travelsample/common-contribution/src/scatours/common/TripItem.java @@ -19,9 +19,16 @@ package scatours.common; +import java.util.List; + public class TripItem { + public static String FLIGHT = "Flight"; + public static String HOTEL = "Hotel"; + public static String CAR = "Car"; + public static String TRIP = "Trip"; + private String id; private String tripId; private String type; @@ -33,6 +40,10 @@ public class TripItem { private double price; private String currency; private String link; + private TripItem[] tripItems; // used for a trip made up of trip items + private String customerDetails; + private String agentDetails; + private String bookingCode; public TripItem() { } @@ -162,4 +173,48 @@ public class TripItem { public void setLink(String link) { this.link = link; } + + public TripItem[] getTripItems() { + return tripItems; + } + + public void setTripItems(TripItem[] tripItems) { + this.tripItems = tripItems; + } + + public String getCustomerDetails() { + return customerDetails; + } + + public void setCustomerDetails(String customerDetails) { + this.customerDetails = customerDetails; + } + + public String getAgentDetails() { + return agentDetails; + } + + public void setAgentDetails(String agentDetails) { + this.agentDetails = agentDetails; + } + + public String getBookingCode() { + return bookingCode; + } + + public void setBookingCode(String bookingCode) { + this.bookingCode = bookingCode; + } + + @Override + public boolean equals(Object obj) { + + if (obj instanceof TripItem){ + if (((TripItem)obj).getId().equals(getId())){ + return true; + } + } + + return super.equals(obj); + } } |