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.printer.server; 018 019import com.echothree.control.user.printer.common.PrinterRemote; 020import com.echothree.control.user.printer.common.form.*; 021import com.echothree.control.user.printer.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 PrinterBean 028 extends PrinterFormsImpl 029 implements PrinterRemote, PrinterLocal { 030 031 // ------------------------------------------------------------------------- 032 // Testing 033 // ------------------------------------------------------------------------- 034 035 @Override 036 public String ping() { 037 return "PrinterBean is alive!"; 038 } 039 040 // ------------------------------------------------------------------------- 041 // Printer Groups 042 // ------------------------------------------------------------------------- 043 044 @Override 045 public CommandResult createPrinterGroup(UserVisitPK userVisitPK, CreatePrinterGroupForm form) { 046 return new CreatePrinterGroupCommand(userVisitPK, form).run(); 047 } 048 049 @Override 050 public CommandResult getPrinterGroupChoices(UserVisitPK userVisitPK, GetPrinterGroupChoicesForm form) { 051 return new GetPrinterGroupChoicesCommand(userVisitPK, form).run(); 052 } 053 054 @Override 055 public CommandResult getPrinterGroup(UserVisitPK userVisitPK, GetPrinterGroupForm form) { 056 return new GetPrinterGroupCommand(userVisitPK, form).run(); 057 } 058 059 @Override 060 public CommandResult getPrinterGroups(UserVisitPK userVisitPK, GetPrinterGroupsForm form) { 061 return new GetPrinterGroupsCommand(userVisitPK, form).run(); 062 } 063 064 @Override 065 public CommandResult setDefaultPrinterGroup(UserVisitPK userVisitPK, SetDefaultPrinterGroupForm form) { 066 return new SetDefaultPrinterGroupCommand(userVisitPK, form).run(); 067 } 068 069 @Override 070 public CommandResult editPrinterGroup(UserVisitPK userVisitPK, EditPrinterGroupForm form) { 071 return new EditPrinterGroupCommand(userVisitPK, form).run(); 072 } 073 074 @Override 075 public CommandResult getPrinterGroupStatusChoices(UserVisitPK userVisitPK, GetPrinterGroupStatusChoicesForm form) { 076 return new GetPrinterGroupStatusChoicesCommand(userVisitPK, form).run(); 077 } 078 079 @Override 080 public CommandResult setPrinterGroupStatus(UserVisitPK userVisitPK, SetPrinterGroupStatusForm form) { 081 return new SetPrinterGroupStatusCommand(userVisitPK, form).run(); 082 } 083 084 @Override 085 public CommandResult deletePrinterGroup(UserVisitPK userVisitPK, DeletePrinterGroupForm form) { 086 return new DeletePrinterGroupCommand(userVisitPK, form).run(); 087 } 088 089 // ------------------------------------------------------------------------- 090 // Printer Group Descriptions 091 // ------------------------------------------------------------------------- 092 093 @Override 094 public CommandResult createPrinterGroupDescription(UserVisitPK userVisitPK, CreatePrinterGroupDescriptionForm form) { 095 return new CreatePrinterGroupDescriptionCommand(userVisitPK, form).run(); 096 } 097 098 @Override 099 public CommandResult getPrinterGroupDescription(UserVisitPK userVisitPK, GetPrinterGroupDescriptionForm form) { 100 return new GetPrinterGroupDescriptionCommand(userVisitPK, form).run(); 101 } 102 103 @Override 104 public CommandResult getPrinterGroupDescriptions(UserVisitPK userVisitPK, GetPrinterGroupDescriptionsForm form) { 105 return new GetPrinterGroupDescriptionsCommand(userVisitPK, form).run(); 106 } 107 108 @Override 109 public CommandResult editPrinterGroupDescription(UserVisitPK userVisitPK, EditPrinterGroupDescriptionForm form) { 110 return new EditPrinterGroupDescriptionCommand(userVisitPK, form).run(); 111 } 112 113 @Override 114 public CommandResult deletePrinterGroupDescription(UserVisitPK userVisitPK, DeletePrinterGroupDescriptionForm form) { 115 return new DeletePrinterGroupDescriptionCommand(userVisitPK, form).run(); 116 } 117 118 // ------------------------------------------------------------------------- 119 // Printers 120 // ------------------------------------------------------------------------- 121 122 @Override 123 public CommandResult createPrinter(UserVisitPK userVisitPK, CreatePrinterForm form) { 124 return new CreatePrinterCommand(userVisitPK, form).run(); 125 } 126 127 @Override 128 public CommandResult getPrinter(UserVisitPK userVisitPK, GetPrinterForm form) { 129 return new GetPrinterCommand(userVisitPK, form).run(); 130 } 131 132 @Override 133 public CommandResult getPrinters(UserVisitPK userVisitPK, GetPrintersForm form) { 134 return new GetPrintersCommand(userVisitPK, form).run(); 135 } 136 137 @Override 138 public CommandResult editPrinter(UserVisitPK userVisitPK, EditPrinterForm form) { 139 return new EditPrinterCommand(userVisitPK, form).run(); 140 } 141 142 @Override 143 public CommandResult getPrinterStatusChoices(UserVisitPK userVisitPK, GetPrinterStatusChoicesForm form) { 144 return new GetPrinterStatusChoicesCommand(userVisitPK, form).run(); 145 } 146 147 @Override 148 public CommandResult setPrinterStatus(UserVisitPK userVisitPK, SetPrinterStatusForm form) { 149 return new SetPrinterStatusCommand(userVisitPK, form).run(); 150 } 151 152 @Override 153 public CommandResult deletePrinter(UserVisitPK userVisitPK, DeletePrinterForm form) { 154 return new DeletePrinterCommand(userVisitPK, form).run(); 155 } 156 157 // ------------------------------------------------------------------------- 158 // Printer Descriptions 159 // ------------------------------------------------------------------------- 160 161 @Override 162 public CommandResult createPrinterDescription(UserVisitPK userVisitPK, CreatePrinterDescriptionForm form) { 163 return new CreatePrinterDescriptionCommand(userVisitPK, form).run(); 164 } 165 166 @Override 167 public CommandResult getPrinterDescription(UserVisitPK userVisitPK, GetPrinterDescriptionForm form) { 168 return new GetPrinterDescriptionCommand(userVisitPK, form).run(); 169 } 170 171 @Override 172 public CommandResult getPrinterDescriptions(UserVisitPK userVisitPK, GetPrinterDescriptionsForm form) { 173 return new GetPrinterDescriptionsCommand(userVisitPK, form).run(); 174 } 175 176 @Override 177 public CommandResult editPrinterDescription(UserVisitPK userVisitPK, EditPrinterDescriptionForm form) { 178 return new EditPrinterDescriptionCommand(userVisitPK, form).run(); 179 } 180 181 @Override 182 public CommandResult deletePrinterDescription(UserVisitPK userVisitPK, DeletePrinterDescriptionForm form) { 183 return new DeletePrinterDescriptionCommand(userVisitPK, form).run(); 184 } 185 186 // ------------------------------------------------------------------------- 187 // Printer Group Jobs 188 // ------------------------------------------------------------------------- 189 190 @Override 191 public CommandResult createPrinterGroupJob(UserVisitPK userVisitPK, CreatePrinterGroupJobForm form) { 192 return new CreatePrinterGroupJobCommand(userVisitPK, form).run(); 193 } 194 195 @Override 196 public CommandResult getPrinterGroupJob(UserVisitPK userVisitPK, GetPrinterGroupJobForm form) { 197 return new GetPrinterGroupJobCommand(userVisitPK, form).run(); 198 } 199 200 @Override 201 public CommandResult getPrinterGroupJobs(UserVisitPK userVisitPK, GetPrinterGroupJobsForm form) { 202 return new GetPrinterGroupJobsCommand(userVisitPK, form).run(); 203 } 204 205 @Override 206 public CommandResult getPrinterGroupJobStatusChoices(UserVisitPK userVisitPK, GetPrinterGroupJobStatusChoicesForm form) { 207 return new GetPrinterGroupJobStatusChoicesCommand(userVisitPK, form).run(); 208 } 209 210 @Override 211 public CommandResult setPrinterGroupJobStatus(UserVisitPK userVisitPK, SetPrinterGroupJobStatusForm form) { 212 return new SetPrinterGroupJobStatusCommand(userVisitPK, form).run(); 213 } 214 215 @Override 216 public CommandResult deletePrinterGroupJob(UserVisitPK userVisitPK, DeletePrinterGroupJobForm form) { 217 return new DeletePrinterGroupJobCommand(userVisitPK, form).run(); 218 } 219 220 // ------------------------------------------------------------------------- 221 // Printer Group Use Types 222 // ------------------------------------------------------------------------- 223 224 @Override 225 public CommandResult createPrinterGroupUseType(UserVisitPK userVisitPK, CreatePrinterGroupUseTypeForm form) { 226 return new CreatePrinterGroupUseTypeCommand(userVisitPK, form).run(); 227 } 228 229 @Override 230 public CommandResult getPrinterGroupUseTypeChoices(UserVisitPK userVisitPK, GetPrinterGroupUseTypeChoicesForm form) { 231 return new GetPrinterGroupUseTypeChoicesCommand(userVisitPK, form).run(); 232 } 233 234 @Override 235 public CommandResult getPrinterGroupUseType(UserVisitPK userVisitPK, GetPrinterGroupUseTypeForm form) { 236 return new GetPrinterGroupUseTypeCommand(userVisitPK, form).run(); 237 } 238 239 @Override 240 public CommandResult getPrinterGroupUseTypes(UserVisitPK userVisitPK, GetPrinterGroupUseTypesForm form) { 241 return new GetPrinterGroupUseTypesCommand(userVisitPK, form).run(); 242 } 243 244 @Override 245 public CommandResult setDefaultPrinterGroupUseType(UserVisitPK userVisitPK, SetDefaultPrinterGroupUseTypeForm form) { 246 return new SetDefaultPrinterGroupUseTypeCommand(userVisitPK, form).run(); 247 } 248 249 @Override 250 public CommandResult editPrinterGroupUseType(UserVisitPK userVisitPK, EditPrinterGroupUseTypeForm form) { 251 return new EditPrinterGroupUseTypeCommand(userVisitPK, form).run(); 252 } 253 254 @Override 255 public CommandResult deletePrinterGroupUseType(UserVisitPK userVisitPK, DeletePrinterGroupUseTypeForm form) { 256 return new DeletePrinterGroupUseTypeCommand(userVisitPK, form).run(); 257 } 258 259 // ------------------------------------------------------------------------- 260 // Printer Group Use Type Descriptions 261 // ------------------------------------------------------------------------- 262 263 @Override 264 public CommandResult createPrinterGroupUseTypeDescription(UserVisitPK userVisitPK, CreatePrinterGroupUseTypeDescriptionForm form) { 265 return new CreatePrinterGroupUseTypeDescriptionCommand(userVisitPK, form).run(); 266 } 267 268 @Override 269 public CommandResult getPrinterGroupUseTypeDescription(UserVisitPK userVisitPK, GetPrinterGroupUseTypeDescriptionForm form) { 270 return new GetPrinterGroupUseTypeDescriptionCommand(userVisitPK, form).run(); 271 } 272 273 @Override 274 public CommandResult getPrinterGroupUseTypeDescriptions(UserVisitPK userVisitPK, GetPrinterGroupUseTypeDescriptionsForm form) { 275 return new GetPrinterGroupUseTypeDescriptionsCommand(userVisitPK, form).run(); 276 } 277 278 @Override 279 public CommandResult editPrinterGroupUseTypeDescription(UserVisitPK userVisitPK, EditPrinterGroupUseTypeDescriptionForm form) { 280 return new EditPrinterGroupUseTypeDescriptionCommand(userVisitPK, form).run(); 281 } 282 283 @Override 284 public CommandResult deletePrinterGroupUseTypeDescription(UserVisitPK userVisitPK, DeletePrinterGroupUseTypeDescriptionForm form) { 285 return new DeletePrinterGroupUseTypeDescriptionCommand(userVisitPK, form).run(); 286 } 287 288 // ------------------------------------------------------------------------- 289 // Party Printer Group Uses 290 // ------------------------------------------------------------------------- 291 292 @Override 293 public CommandResult createPartyPrinterGroupUse(UserVisitPK userVisitPK, CreatePartyPrinterGroupUseForm form) { 294 return new CreatePartyPrinterGroupUseCommand(userVisitPK, form).run(); 295 } 296 297 @Override 298 public CommandResult getPartyPrinterGroupUse(UserVisitPK userVisitPK, GetPartyPrinterGroupUseForm form) { 299 return new GetPartyPrinterGroupUseCommand(userVisitPK, form).run(); 300 } 301 302 @Override 303 public CommandResult getPartyPrinterGroupUses(UserVisitPK userVisitPK, GetPartyPrinterGroupUsesForm form) { 304 return new GetPartyPrinterGroupUsesCommand(userVisitPK, form).run(); 305 } 306 307 @Override 308 public CommandResult editPartyPrinterGroupUse(UserVisitPK userVisitPK, EditPartyPrinterGroupUseForm form) { 309 return new EditPartyPrinterGroupUseCommand(userVisitPK, form).run(); 310 } 311 312 @Override 313 public CommandResult deletePartyPrinterGroupUse(UserVisitPK userVisitPK, DeletePartyPrinterGroupUseForm form) { 314 return new DeletePartyPrinterGroupUseCommand(userVisitPK, form).run(); 315 } 316 317}