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.club.server; 018 019import com.echothree.control.user.club.common.ClubRemote; 020import com.echothree.control.user.club.common.form.*; 021import com.echothree.control.user.club.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 ClubBean 028 extends ClubFormsImpl 029 implements ClubRemote, ClubLocal { 030 031 // ------------------------------------------------------------------------- 032 // Testing 033 // ------------------------------------------------------------------------- 034 035 @Override 036 public String ping() { 037 return "ClubBean is alive!"; 038 } 039 040 // -------------------------------------------------------------------------------- 041 // Clubs 042 // -------------------------------------------------------------------------------- 043 044 @Override 045 public CommandResult createClub(UserVisitPK userVisitPK, CreateClubForm form) { 046 return new CreateClubCommand(userVisitPK, form).run(); 047 } 048 049 @Override 050 public CommandResult getClubs(UserVisitPK userVisitPK, GetClubsForm form) { 051 return new GetClubsCommand(userVisitPK, form).run(); 052 } 053 054 @Override 055 public CommandResult getClub(UserVisitPK userVisitPK, GetClubForm form) { 056 return new GetClubCommand(userVisitPK, form).run(); 057 } 058 059 @Override 060 public CommandResult setDefaultClub(UserVisitPK userVisitPK, SetDefaultClubForm form) { 061 return new SetDefaultClubCommand(userVisitPK, form).run(); 062 } 063 064 @Override 065 public CommandResult deleteClub(UserVisitPK userVisitPK, DeleteClubForm form) { 066 return new DeleteClubCommand(userVisitPK, form).run(); 067 } 068 069 // -------------------------------------------------------------------------------- 070 // Club Descriptions 071 // -------------------------------------------------------------------------------- 072 073 @Override 074 public CommandResult createClubDescription(UserVisitPK userVisitPK, CreateClubDescriptionForm form) { 075 return new CreateClubDescriptionCommand(userVisitPK, form).run(); 076 } 077 078 @Override 079 public CommandResult getClubDescriptions(UserVisitPK userVisitPK, GetClubDescriptionsForm form) { 080 return new GetClubDescriptionsCommand(userVisitPK, form).run(); 081 } 082 083 @Override 084 public CommandResult editClubDescription(UserVisitPK userVisitPK, EditClubDescriptionForm form) { 085 return new EditClubDescriptionCommand(userVisitPK, form).run(); 086 } 087 088 @Override 089 public CommandResult deleteClubDescription(UserVisitPK userVisitPK, DeleteClubDescriptionForm form) { 090 return new DeleteClubDescriptionCommand(userVisitPK, form).run(); 091 } 092 093 // -------------------------------------------------------------------------------- 094 // Club Item Types 095 // -------------------------------------------------------------------------------- 096 097 @Override 098 public CommandResult createClubItemType(UserVisitPK userVisitPK, CreateClubItemTypeForm form) { 099 return new CreateClubItemTypeCommand(userVisitPK, form).run(); 100 } 101 102 @Override 103 public CommandResult getClubItemTypeChoices(UserVisitPK userVisitPK, GetClubItemTypeChoicesForm form) { 104 return new GetClubItemTypeChoicesCommand(userVisitPK, form).run(); 105 } 106 107 // -------------------------------------------------------------------------------- 108 // Club Item Type Descriptions 109 // -------------------------------------------------------------------------------- 110 111 @Override 112 public CommandResult createClubItemTypeDescription(UserVisitPK userVisitPK, CreateClubItemTypeDescriptionForm form) { 113 return new CreateClubItemTypeDescriptionCommand(userVisitPK, form).run(); 114 } 115 116 // -------------------------------------------------------------------------------- 117 // Club Items 118 // -------------------------------------------------------------------------------- 119 120 @Override 121 public CommandResult createClubItem(UserVisitPK userVisitPK, CreateClubItemForm form) { 122 return new CreateClubItemCommand(userVisitPK, form).run(); 123 } 124 125 @Override 126 public CommandResult getClubItems(UserVisitPK userVisitPK, GetClubItemsForm form) { 127 return new GetClubItemsCommand(userVisitPK, form).run(); 128 } 129 130 @Override 131 public CommandResult editClub(UserVisitPK userVisitPK, EditClubForm form) { 132 return new EditClubCommand(userVisitPK, form).run(); 133 } 134 135 @Override 136 public CommandResult deleteClubItem(UserVisitPK userVisitPK, DeleteClubItemForm form) { 137 return new DeleteClubItemCommand(userVisitPK, form).run(); 138 } 139 140}