All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.beans.demos.travel.flight.rules.CarrierRestrictionDip
java.lang.Object
|
+----com.ibm.beans.dip.SimpleDip
|
+----com.ibm.beans.demos.travel.flight.rules.CarrierRestrictionDip
- public class CarrierRestrictionDip
- extends SimpleDip
- implements DipPropertyChangeListener, Serializable
This class implements a business rule which restricts the flight
carriers (airlines) accessible via the FlightInfoDapProperties. It does this by
hooking to the sql property and adding an SQL query clause which
eliminates the particular carrier. The carrier to restrict is a
property of this dip.
See the Carrier Restriction Dip Usage Guide for information regarding how to
setup and use this dip.
-
CarrierRestrictionDip()
-
-
createImplementation(Object)
- Checks the object to which the dip is being applied to
ensure that the object is a FlightInfoDapProperties.
-
createPropertyChangeListener(Object, String[])
- Creates the object to receive notification when the SQL property changes.
-
getCarrier()
- Gets the name of the airline to restrict usage of.
-
includeInMorphedClass(String)
- Determines if a method should be included in a morphed class.
-
propertyChange(PropertyChangeEvent)
- Handles a property change event.
-
setCarrier(String)
- Sets the name of the airline to restrict usage of.
-
typeName()
- Defines this dip to be related to restricting use of an
airline carrier.
CarrierRestrictionDip
public CarrierRestrictionDip()
setCarrier
public void setCarrier(String carrierName)
- Sets the name of the airline to restrict usage of.
getCarrier
public String getCarrier()
- Gets the name of the airline to restrict usage of.
typeName
public final String typeName()
- Defines this dip to be related to restricting use of an
airline carrier.
- Returns:
- The type name of the dip.
- Overrides:
- typeName in class SimpleDip
includeInMorphedClass
public boolean includeInMorphedClass(String methodName)
- Determines if a method should be included in a morphed class.
When the dip is applied to a class as a pre-dip during morphing,
and the user elects to only override those methods in the dippable
class that the pre-dips agrees to, this method is used to determine
if a dip agrees to including a specific method.
The only method of the dippable bean that the CarrierRestrictionDip
needs to be wrapped is the setSQLString method.
- Parameters:
- methodName - Name of the method to be considered
- Returns:
- boolean indicating whether to wrap given method
- Overrides:
- includeInMorphedClass in class SimpleDip
createImplementation
public Object createImplementation(Object obj) throws DipRejectAdditionException
- Checks the object to which the dip is being applied to
ensure that the object is a FlightInfoDapProperties. If it is
not, then an exception is thrown and the application of the dip
is rejected.
- Parameters:
- obj - The bean being dipped.
- Throws: DipRejectAdditionException
- This method will throw
this exception if
obj is not a FlightInfoDapProperties.
- Overrides:
- createImplementation in class SimpleDip
createPropertyChangeListener
public DipPropertyChangeListener[] createPropertyChangeListener(Object imp,
String methods[]) throws DipRejectAdditionException
- Creates the object to receive notification when the SQL property changes.
- Parameters:
- imp - The implementation returned by createImplementation.
- methods - The array of methods in the dippable
bean.
- Returns:
- The array of DipPropertyChangeListeners with the dip itself set to
listen at the appropriate method index to receive
property change notifications.
- Throws: DipRejectAdditionException
- This method will throw this
exception if some needed methods of the dippable bean were not wrapped.
- Overrides:
- createPropertyChangeListener in class SimpleDip
propertyChange
public void propertyChange(PropertyChangeEvent e)
- Handles a property change event. The Carrier Restriction Dip
will enforce appropriate SQL clauses to remove the designated
carrier from the list of carriers possible.
All Packages Class Hierarchy This Package Previous Next Index