public class GiftCenterFacadeClient extends AbstractGiftCenterFacadeClient
This class provides common methods that this and other utility classes of the GiftCenter facade can use. This class also provides a set of convenient Java APIs to represent particular GiftCenter operations. This set of Java APIs also includes APIs for Web-based requests to transform the name-value pair request into the appropriate request documents.
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
GiftCenterFacadeClient()
This method creates an instance of the client to communicate with the GiftCenter facade.
|
GiftCenterFacadeClient(BusinessContextType businessContext, javax.security.auth.callback.CallbackHandler callbackHandler)
This method creates an instance of the client to communicate with the GiftCenter facade.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map | addGiftListCoRegistrants(java.util.Map parameters)
This method adds new coregistrant details to the registry.
|
java.util.Map | addItem(java.util.Map parameters)
This method adds an item to the GiftList.
|
java.util.Map | announceGiftList(java.util.Map parameters)
This method invokes the gift list announcement service based on the input parameters.
|
java.util.Map | authenticate(java.util.Map parameters)
This method invokes the authenticate service to authenticate the user for the gift list.
|
protected ContactInfoType | buildAddressObject(java.util.Map parameters, int index, java.lang.String action, java.lang.String prefix)
This method builds an object of ContactInfoType from the input map.
|
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListAccessSpecifierType | buildGiftListAccessSpecifier(java.util.Map parameters, java.lang.String action)
This method creates an object of GiftListAccessSpecifierType type.
|
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListAnnouncementType | buildGiftListAnnouncement(java.util.Map parameters, java.lang.String action)
This method builds the GiftListAnnouncementType object based on the input parameters.
|
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListRegistrantType[] | buildGiftListCoRegistrants(java.util.Map parameters, java.lang.String action)
This method creates an array of GiftListRegistrantType type for the co-registrants.
|
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListRegistrantType[] | buildGiftListCoRegistrantsForDeleteAction(java.util.Map parameters)
This method creates an array of GiftListRegistrantType type for the coregistrants.
|
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListType | buildGiftListDataObject(java.util.Map parameters, java.lang.String action)
This method constructs a GiftListType from a map based on the action.
|
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListDescriptionType | buildGiftListDescription(java.util.Map parameters, java.lang.String action)
This method builds a GiftListDescriptionType based on the input map.
|
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListEventInformationType | buildGiftListEventInformation(java.util.Map parameters, java.lang.String action, com.ibm.commerce.giftcenter.facade.datatypes.GiftListType giftListType)
This method builds a GiftListEventInformationType
|
protected com.ibm.commerce.foundation.common.datatypes.GiftListIdentifierType | buildGiftListIdentifier(java.util.Map parameters, java.lang.String action)
This method builds the gift list identifier based on the input map and action to be performed.
|
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListItemType[] | buildGiftListItems(java.util.Map parameters, java.lang.String action)
This method creates an array of GiftListItemType items for a gift list.
|
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListPurchaseRecordType[] | buildGiftListPurchaseRecords(java.util.Map parameters, java.lang.String action)
This method creates an array of GiftListPurchaseRecordType for a gift list.
|
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListRegistrantType | buildGiftListRegistrant(java.util.Map parameters, java.lang.String action)
This method creates an object of GiftListRegistrantType type.
|
protected StoreIdentifierType | buildStoreIdentifierObject(java.util.Map parameters)
This method builds the store identifier based on the input map.
|
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListType | changeGiftList(java.lang.String actionCode, java.util.List<java.lang.String> actionExpressions, com.ibm.commerce.giftcenter.facade.datatypes.GiftListType giftList)
This method invokes the Change gift list service based on the action code and the list of action expressions.
|
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListType | changeGiftList(java.lang.String actionCode, java.lang.String actionExpression, com.ibm.commerce.giftcenter.facade.datatypes.GiftListType giftList)
This method invokes the Change gift list service based on the action code and the action expression.
|
java.util.Map | changeGiftListStatus(java.util.Map parameters)
This method performs a Change GiftList status request.
|
java.util.Map | completeGiftList(java.util.Map parameters)
This method invokes the gift list complete service to complete a gift registry.
|
protected java.util.Map | convertParameters(java.util.Map parameters)
This method converts the input request parameters to the form that is consumed by the buildXXX() methods.
|
java.util.Map | createGiftList(java.util.Map parameters)
This method creates a gift list using the input provided in the map.
|
java.util.Map | deleteGiftList(java.util.Map parameters)
This method deletes a GiftList.
|
java.util.Map | deleteGiftListCoRegistrants(java.util.Map parameters)
This method deletes coregistrant details from the registry.
|
java.util.Map | deleteItem(java.util.Map parameters)
This method deletes an item from the gift list.
|
java.util.Map | deletePurchaseRecord(java.util.Map parameters)
This method delete purchase record of a Gift List.
|
java.util.List | getCustomersWishListIds(java.util.List wishListParameters, java.lang.Long userId, java.lang.Integer storeId, java.lang.Boolean create, java.util.Locale locale)
This method finds a customer's wish lists.
|
protected int | getMaxGiftListSize()
This method returns the maximum count of items that a gift list can contain in a request.
|
protected java.lang.String | getWishListName(java.util.Locale locale)
This method returns the name that should be given to the customer's default wish list when a wish list is created for the customer.
|
protected void | populateGiftListResponse(java.util.Map response, com.ibm.commerce.giftcenter.facade.datatypes.GiftListType giftList)
This method populates the response map after the service is invoked.
|
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListType | processGiftList(java.lang.String actionCode, java.lang.String actionExpression, com.ibm.commerce.giftcenter.facade.datatypes.GiftListType giftList)
This method invokes the Process gift list service based on the action code and the action expression.
|
protected java.lang.String[] | resolveParameter(java.util.Map parameters, java.lang.String key)
This method resolves parameters from the input Map
|
protected java.util.HashMap | resolveParameterForHashMap(java.util.Map parameters, java.lang.String key)
This method resolves parameters (Vector type) from the input map.
|
protected java.lang.String[] | resolveParameterWithEnumerationGrp(java.util.HashMap paraTable, int count)
This method populates parameters to a string array from the input HashMap.
|
protected java.lang.String | retrieveKeyFromEnumerationKey(java.lang.String enumerationKey)
This method retrieves the original key from the enumerated key.
|
java.util.Map | updateAccessOptions(java.util.Map parameters)
This method updates the gift list access options.
|
java.util.Map | updateDescription(java.util.Map parameters)
This method updates the description of the gift list.
|
java.util.Map | updateEventInformation(java.util.Map parameters)
This method updates event information for the gift list.
|
java.util.Map | updateGiftList(java.util.Map parameters)
This method updates the gift list using the input provided in the map.
|
java.util.Map | updateGiftListCoRegistrants(java.util.Map parameters)
This method updates Gift List CoRegistrant details.
|
java.util.Map | updateGiftListRegistrant(java.util.Map parameters)
This method updates registrant details.
|
java.util.Map | updateItem(java.util.Map parameters)
This method updates an item in the gift list.
|
java.util.Map | updatePurchaseRecord(java.util.Map parameters)
This method updates purchase record to the GiftList.
|
public static final java.lang.String COPYRIGHT
public GiftCenterFacadeClient()
public GiftCenterFacadeClient(BusinessContextType businessContext, javax.security.auth.callback.CallbackHandler callbackHandler)
public java.util.Map createGiftList(java.util.Map parameters) throws GiftListException
public java.util.Map deleteGiftList(java.util.Map parameters) throws GiftListException
public java.util.Map authenticate(java.util.Map parameters) throws GiftCenterException
public java.util.Map announceGiftList(java.util.Map parameters) throws GiftListException
public java.util.Map completeGiftList(java.util.Map parameters) throws GiftListException
public java.util.Map addItem(java.util.Map parameters) throws GiftListException
public java.util.Map updateItem(java.util.Map parameters) throws GiftListException
public java.util.Map deleteItem(java.util.Map parameters) throws GiftListException
public java.util.Map addGiftListCoRegistrants(java.util.Map parameters) throws GiftListException
public java.util.Map updateGiftListCoRegistrants(java.util.Map parameters) throws GiftListException
public java.util.Map deleteGiftListCoRegistrants(java.util.Map parameters) throws GiftListException
public java.util.Map updateDescription(java.util.Map parameters) throws GiftCenterException
public java.util.Map updateEventInformation(java.util.Map parameters) throws GiftCenterException
public java.util.Map updateAccessOptions(java.util.Map parameters) throws GiftCenterException
public java.util.Map updateGiftListRegistrant(java.util.Map parameters) throws GiftCenterException
public java.util.Map updatePurchaseRecord(java.util.Map parameters) throws GiftListException
public java.util.Map deletePurchaseRecord(java.util.Map parameters) throws GiftListException
public java.util.Map updateGiftList(java.util.Map parameters) throws GiftListException
public java.util.Map changeGiftListStatus(java.util.Map parameters) throws GiftListException
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListType processGiftList(java.lang.String actionCode, java.lang.String actionExpression, com.ibm.commerce.giftcenter.facade.datatypes.GiftListType giftList) throws GiftListException
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListType changeGiftList(java.lang.String actionCode, java.lang.String actionExpression, com.ibm.commerce.giftcenter.facade.datatypes.GiftListType giftList) throws GiftListException
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListType changeGiftList(java.lang.String actionCode, java.util.List<java.lang.String> actionExpressions, com.ibm.commerce.giftcenter.facade.datatypes.GiftListType giftList) throws GiftListException
protected void populateGiftListResponse(java.util.Map response, com.ibm.commerce.giftcenter.facade.datatypes.GiftListType giftList) throws GiftListException
protected java.lang.String[] resolveParameter(java.util.Map parameters, java.lang.String key) throws GiftListException
protected java.util.HashMap resolveParameterForHashMap(java.util.Map parameters, java.lang.String key) throws GiftListException
protected java.lang.String[] resolveParameterWithEnumerationGrp(java.util.HashMap paraTable, int count) throws GiftListException
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListType buildGiftListDataObject(java.util.Map parameters, java.lang.String action) throws GiftListException
The following actions are supported by this method.
The map input to this method is that which is returned by convertParameters method.
The following is a sample usage of the method. Map rawParametersFromWeb = new HashMap(); parameters.put("uniqueId", new String[] { "10001" }); parameters.put("catentryId_0", new String[] { "10002"); parameters.put("quantity_0", new String[] { "4" }); parameters.put("attrName_0_0", new String[]{"Comment"}); parameters.put("attrValue_0_0", new String[]{"Nice Item."}); Map convertedParameters = convertedParameters(rawParametersFromWeb); GiftListType[] giftLists = buildGiftListDataObject(convertedParameters, "addItem");
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListItemType[] buildGiftListItems(java.util.Map parameters, java.lang.String action) throws GiftListException
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListPurchaseRecordType[] buildGiftListPurchaseRecords(java.util.Map parameters, java.lang.String action) throws GiftListException
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListAccessSpecifierType buildGiftListAccessSpecifier(java.util.Map parameters, java.lang.String action) throws GiftListException
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListRegistrantType buildGiftListRegistrant(java.util.Map parameters, java.lang.String action) throws GiftListException
This method creates an object of GiftListRegistrantType type. It invokes the buildAddressObject method with registrant prefix.
The following parameters are looked up in the input parameters.protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListRegistrantType[] buildGiftListCoRegistrants(java.util.Map parameters, java.lang.String action) throws GiftListException
This method creates an array of GiftListRegistrantType type for the co-registrants. It invokes the buildAddressObject method with coRegistrant prefix.
The following parameters are looked up in the input parameters.For multiple co-registrants, use the naming convention of coRegistrantFirstName_<index> where index is the index of the coRegistrant. The index starts from 1.
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListRegistrantType[] buildGiftListCoRegistrantsForDeleteAction(java.util.Map parameters) throws GiftListException
This method creates an array of GiftListRegistrantType type for the coregistrants. Only the RegistrantID element is populated in GiftListRegistrantType because only the RegistrantID is needed for the delete coregistrants action.
For multiple co-registrants, use the naming convention of coRegistrantId_<index> where index is the index of the coRegistrant. The index starts from 1.
protected com.ibm.commerce.foundation.common.datatypes.GiftListIdentifierType buildGiftListIdentifier(java.util.Map parameters, java.lang.String action) throws GiftListException
protected StoreIdentifierType buildStoreIdentifierObject(java.util.Map parameters) throws GiftListException
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListDescriptionType buildGiftListDescription(java.util.Map parameters, java.lang.String action) throws GiftListException
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListEventInformationType buildGiftListEventInformation(java.util.Map parameters, java.lang.String action, com.ibm.commerce.giftcenter.facade.datatypes.GiftListType giftListType) throws GiftListException
protected ContactInfoType buildAddressObject(java.util.Map parameters, int index, java.lang.String action, java.lang.String prefix) throws GiftListException
The name of the address parameter to be looked up in the map is constructed by prefixing the prefix parameter to the default address field name entries. For For example, to find the first name of the registrant, the name is constructed as registrantFirstName where registrant is the prefix and FirstName is the address field being looked for.
protected com.ibm.commerce.giftcenter.facade.datatypes.GiftListAnnouncementType buildGiftListAnnouncement(java.util.Map parameters, java.lang.String action) throws GiftListException
protected final java.util.Map convertParameters(java.util.Map parameters) throws GiftListException
For example, String[] catEntryId = new String[]{"10001"}; String[] catEntryId_1 = new String[]{"10002"}; HashMap inMap = new HashMap(); inMap.put("catEntryId", catEntryId); inMap.put("catEntryId_1", catEntryId_1); HashMap outMap = convertParameters(inMap); outMap.get("catEntryId"); => {"10001", "10002"}
protected java.lang.String retrieveKeyFromEnumerationKey(java.lang.String enumerationKey)
public java.util.List getCustomersWishListIds(java.util.List wishListParameters, java.lang.Long userId, java.lang.Integer storeId, java.lang.Boolean create, java.util.Locale locale) throws GiftListException
protected java.lang.String getWishListName(java.util.Locale locale)
protected int getMaxGiftListSize()