001// -------------------------------------------------------------------------------- 002// Copyright 2002-2024 Echo Three, LLC 003// 004// Licensed under the Apache License, Version 2.0 (the "License"); 005// you may not use this file except in compliance with the License. 006// You may obtain a copy of the License at 007// 008// http://www.apache.org/licenses/LICENSE-2.0 009// 010// Unless required by applicable law or agreed to in writing, software 011// distributed under the License is distributed on an "AS IS" BASIS, 012// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013// See the License for the specific language governing permissions and 014// limitations under the License. 015// -------------------------------------------------------------------------------- 016 017package com.echothree.control.user.shipping.server; 018 019import com.echothree.control.user.shipping.common.ShippingRemote; 020import com.echothree.control.user.shipping.common.form.*; 021import com.echothree.control.user.shipping.server.command.*; 022import com.echothree.model.data.user.common.pk.UserVisitPK; 023import com.echothree.util.common.command.CommandResult; 024import javax.ejb.Stateless; 025 026@Stateless 027public class ShippingBean 028 extends ShippingFormsImpl 029 implements ShippingRemote, ShippingLocal { 030 031 // ------------------------------------------------------------------------- 032 // Testing 033 // ------------------------------------------------------------------------- 034 035 @Override 036 public String ping() { 037 return "ShippingBean is alive!"; 038 } 039 040 // ------------------------------------------------------------------------- 041 // Shipping Methods 042 // ------------------------------------------------------------------------- 043 044 @Override 045 public CommandResult createShippingMethod(UserVisitPK userVisitPK, CreateShippingMethodForm form) { 046 return new CreateShippingMethodCommand(userVisitPK, form).run(); 047 } 048 049 @Override 050 public CommandResult getShippingMethod(UserVisitPK userVisitPK, GetShippingMethodForm form) { 051 return new GetShippingMethodCommand(userVisitPK, form).run(); 052 } 053 054 @Override 055 public CommandResult getShippingMethods(UserVisitPK userVisitPK, GetShippingMethodsForm form) { 056 return new GetShippingMethodsCommand(userVisitPK, form).run(); 057 } 058 059 @Override 060 public CommandResult getShippingMethodChoices(UserVisitPK userVisitPK, GetShippingMethodChoicesForm form) { 061 return new GetShippingMethodChoicesCommand(userVisitPK, form).run(); 062 } 063 064 @Override 065 public CommandResult editShippingMethod(UserVisitPK userVisitPK, EditShippingMethodForm form) { 066 return new EditShippingMethodCommand(userVisitPK, form).run(); 067 } 068 069 @Override 070 public CommandResult deleteShippingMethod(UserVisitPK userVisitPK, DeleteShippingMethodForm form) { 071 return new DeleteShippingMethodCommand(userVisitPK, form).run(); 072 } 073 074 // ------------------------------------------------------------------------- 075 // Shipping Method Descriptions 076 // ------------------------------------------------------------------------- 077 078 @Override 079 public CommandResult createShippingMethodDescription(UserVisitPK userVisitPK, CreateShippingMethodDescriptionForm form) { 080 return new CreateShippingMethodDescriptionCommand(userVisitPK, form).run(); 081 } 082 083 @Override 084 public CommandResult getShippingMethodDescription(UserVisitPK userVisitPK, GetShippingMethodDescriptionForm form) { 085 return new GetShippingMethodDescriptionCommand(userVisitPK, form).run(); 086 } 087 088 @Override 089 public CommandResult getShippingMethodDescriptions(UserVisitPK userVisitPK, GetShippingMethodDescriptionsForm form) { 090 return new GetShippingMethodDescriptionsCommand(userVisitPK, form).run(); 091 } 092 093 @Override 094 public CommandResult editShippingMethodDescription(UserVisitPK userVisitPK, EditShippingMethodDescriptionForm form) { 095 return new EditShippingMethodDescriptionCommand(userVisitPK, form).run(); 096 } 097 098 @Override 099 public CommandResult deleteShippingMethodDescription(UserVisitPK userVisitPK, DeleteShippingMethodDescriptionForm form) { 100 return new DeleteShippingMethodDescriptionCommand(userVisitPK, form).run(); 101 } 102 103 // ------------------------------------------------------------------------- 104 // Shipping Method Carrier Services 105 // ------------------------------------------------------------------------- 106 107 @Override 108 public CommandResult createShippingMethodCarrierService(UserVisitPK userVisitPK, CreateShippingMethodCarrierServiceForm form) { 109 return new CreateShippingMethodCarrierServiceCommand(userVisitPK, form).run(); 110 } 111 112 @Override 113 public CommandResult getShippingMethodCarrierService(UserVisitPK userVisitPK, GetShippingMethodCarrierServiceForm form) { 114 return new GetShippingMethodCarrierServiceCommand(userVisitPK, form).run(); 115 } 116 117 @Override 118 public CommandResult getShippingMethodCarrierServices(UserVisitPK userVisitPK, GetShippingMethodCarrierServicesForm form) { 119 return new GetShippingMethodCarrierServicesCommand(userVisitPK, form).run(); 120 } 121 122 @Override 123 public CommandResult deleteShippingMethodCarrierService(UserVisitPK userVisitPK, DeleteShippingMethodCarrierServiceForm form) { 124 return new DeleteShippingMethodCarrierServiceCommand(userVisitPK, form).run(); 125 } 126 127}