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