001// -------------------------------------------------------------------------------- 002// Copyright 2002-2025 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.contact.server; 018 019import com.echothree.control.user.contact.common.ContactRemote; 020import com.echothree.control.user.contact.common.form.*; 021import com.echothree.control.user.contact.server.command.*; 022import com.echothree.model.data.user.common.pk.UserVisitPK; 023import com.echothree.util.common.command.CommandResult; 024import javax.ejb.Stateless; 025import javax.enterprise.inject.spi.CDI; 026 027@Stateless 028public class ContactBean 029 extends ContactFormsImpl 030 implements ContactRemote, ContactLocal { 031 032 // ------------------------------------------------------------------------- 033 // Testing 034 // ------------------------------------------------------------------------- 035 036 @Override 037 public String ping() { 038 return "ContactBean is alive!"; 039 } 040 041 // -------------------------------------------------------------------------------- 042 // Contact Mechanism Types 043 // -------------------------------------------------------------------------------- 044 045 @Override 046 public CommandResult createContactMechanismType(UserVisitPK userVisitPK, CreateContactMechanismTypeForm form) { 047 return CDI.current().select(CreateContactMechanismTypeCommand.class).get().run(userVisitPK, form); 048 } 049 050 @Override 051 public CommandResult getContactMechanismTypes(UserVisitPK userVisitPK, GetContactMechanismTypesForm form) { 052 return CDI.current().select(GetContactMechanismTypesCommand.class).get().run(userVisitPK, form); 053 } 054 055 @Override 056 public CommandResult getContactMechanismTypeChoices(UserVisitPK userVisitPK, GetContactMechanismTypeChoicesForm form) { 057 return CDI.current().select(GetContactMechanismTypeChoicesCommand.class).get().run(userVisitPK, form); 058 } 059 060 // -------------------------------------------------------------------------------- 061 // Contact Mechanism Type Descriptions 062 // -------------------------------------------------------------------------------- 063 064 @Override 065 public CommandResult createContactMechanismTypeDescription(UserVisitPK userVisitPK, CreateContactMechanismTypeDescriptionForm form) { 066 return CDI.current().select(CreateContactMechanismTypeDescriptionCommand.class).get().run(userVisitPK, form); 067 } 068 069 // -------------------------------------------------------------------------------- 070 // Contact Mechanism Alias Types 071 // -------------------------------------------------------------------------------- 072 073 @Override 074 public CommandResult createContactMechanismAliasType(UserVisitPK userVisitPK, CreateContactMechanismAliasTypeForm form) { 075 return CDI.current().select(CreateContactMechanismAliasTypeCommand.class).get().run(userVisitPK, form); 076 } 077 078 @Override 079 public CommandResult getContactMechanismAliasTypes(UserVisitPK userVisitPK, GetContactMechanismAliasTypesForm form) { 080 return CDI.current().select(GetContactMechanismAliasTypesCommand.class).get().run(userVisitPK, form); 081 } 082 083 @Override 084 public CommandResult getContactMechanismAliasTypeChoices(UserVisitPK userVisitPK, GetContactMechanismAliasTypeChoicesForm form) { 085 return CDI.current().select(GetContactMechanismAliasTypeChoicesCommand.class).get().run(userVisitPK, form); 086 } 087 088 // -------------------------------------------------------------------------------- 089 // Contact Mechanism Alias Type Descriptions 090 // -------------------------------------------------------------------------------- 091 092 @Override 093 public CommandResult createContactMechanismAliasTypeDescription(UserVisitPK userVisitPK, CreateContactMechanismAliasTypeDescriptionForm form) { 094 return CDI.current().select(CreateContactMechanismAliasTypeDescriptionCommand.class).get().run(userVisitPK, form); 095 } 096 097 // -------------------------------------------------------------------------------- 098 // Contact Mechanism Purposes 099 // -------------------------------------------------------------------------------- 100 101 @Override 102 public CommandResult createContactMechanismPurpose(UserVisitPK userVisitPK, CreateContactMechanismPurposeForm form) { 103 return CDI.current().select(CreateContactMechanismPurposeCommand.class).get().run(userVisitPK, form); 104 } 105 106 @Override 107 public CommandResult getContactMechanismPurpose(UserVisitPK userVisitPK, GetContactMechanismPurposeForm form) { 108 return CDI.current().select(GetContactMechanismPurposeCommand.class).get().run(userVisitPK, form); 109 } 110 111 @Override 112 public CommandResult getContactMechanismPurposes(UserVisitPK userVisitPK, GetContactMechanismPurposesForm form) { 113 return CDI.current().select(GetContactMechanismPurposesCommand.class).get().run(userVisitPK, form); 114 } 115 116 @Override 117 public CommandResult getContactMechanismPurposeChoices(UserVisitPK userVisitPK, GetContactMechanismPurposeChoicesForm form) { 118 return CDI.current().select(GetContactMechanismPurposeChoicesCommand.class).get().run(userVisitPK, form); 119 } 120 121 // -------------------------------------------------------------------------------- 122 // Contact Mechanism Purpose Descriptions 123 // -------------------------------------------------------------------------------- 124 125 @Override 126 public CommandResult createContactMechanismPurposeDescription(UserVisitPK userVisitPK, CreateContactMechanismPurposeDescriptionForm form) { 127 return CDI.current().select(CreateContactMechanismPurposeDescriptionCommand.class).get().run(userVisitPK, form); 128 } 129 130 // -------------------------------------------------------------------------------- 131 // Contact Mechanisms 132 // -------------------------------------------------------------------------------- 133 134 @Override 135 public CommandResult getContactMechanismChoices(UserVisitPK userVisitPK, GetContactMechanismChoicesForm form) { 136 return CDI.current().select(GetContactMechanismChoicesCommand.class).get().run(userVisitPK, form); 137 } 138 139 @Override 140 public CommandResult getEmailAddressStatusChoices(UserVisitPK userVisitPK, GetEmailAddressStatusChoicesForm form) { 141 return CDI.current().select(GetEmailAddressStatusChoicesCommand.class).get().run(userVisitPK, form); 142 } 143 144 @Override 145 public CommandResult setEmailAddressStatus(UserVisitPK userVisitPK, SetEmailAddressStatusForm form) { 146 return CDI.current().select(SetEmailAddressStatusCommand.class).get().run(userVisitPK, form); 147 } 148 149 @Override 150 public CommandResult getEmailAddressVerificationChoices(UserVisitPK userVisitPK, GetEmailAddressVerificationChoicesForm form) { 151 return CDI.current().select(GetEmailAddressVerificationChoicesCommand.class).get().run(userVisitPK, form); 152 } 153 154 @Override 155 public CommandResult setEmailAddressVerification(UserVisitPK userVisitPK, SetEmailAddressVerificationForm form) { 156 return CDI.current().select(SetEmailAddressVerificationCommand.class).get().run(userVisitPK, form); 157 } 158 159 @Override 160 public CommandResult getPostalAddressStatusChoices(UserVisitPK userVisitPK, GetPostalAddressStatusChoicesForm form) { 161 return CDI.current().select(GetPostalAddressStatusChoicesCommand.class).get().run(userVisitPK, form); 162 } 163 164 @Override 165 public CommandResult setPostalAddressStatus(UserVisitPK userVisitPK, SetPostalAddressStatusForm form) { 166 return CDI.current().select(SetPostalAddressStatusCommand.class).get().run(userVisitPK, form); 167 } 168 169 @Override 170 public CommandResult getTelephoneStatusChoices(UserVisitPK userVisitPK, GetTelephoneStatusChoicesForm form) { 171 return CDI.current().select(GetTelephoneStatusChoicesCommand.class).get().run(userVisitPK, form); 172 } 173 174 @Override 175 public CommandResult setTelephoneStatus(UserVisitPK userVisitPK, SetTelephoneStatusForm form) { 176 return CDI.current().select(SetTelephoneStatusCommand.class).get().run(userVisitPK, form); 177 } 178 179 180 @Override 181 public CommandResult getWebAddressStatusChoices(UserVisitPK userVisitPK, GetWebAddressStatusChoicesForm form) { 182 return CDI.current().select(GetWebAddressStatusChoicesCommand.class).get().run(userVisitPK, form); 183 } 184 185 @Override 186 public CommandResult setWebAddressStatus(UserVisitPK userVisitPK, SetWebAddressStatusForm form) { 187 return CDI.current().select(SetWebAddressStatusCommand.class).get().run(userVisitPK, form); 188 } 189 190 @Override 191 public CommandResult getContactMechanism(UserVisitPK userVisitPK, GetContactMechanismForm form) { 192 return CDI.current().select(GetContactMechanismCommand.class).get().run(userVisitPK, form); 193 } 194 195 @Override 196 public CommandResult deleteContactMechanism(UserVisitPK userVisitPK, DeleteContactMechanismForm form) { 197 return CDI.current().select(DeleteContactMechanismCommand.class).get().run(userVisitPK, form); 198 } 199 200 // -------------------------------------------------------------------------------- 201 // Contact Mechanism Aliases 202 // -------------------------------------------------------------------------------- 203 204 @Override 205 public CommandResult createContactMechanismAlias(UserVisitPK userVisitPK, CreateContactMechanismAliasForm form) { 206 return CDI.current().select(CreateContactMechanismAliasCommand.class).get().run(userVisitPK, form); 207 } 208 209 @Override 210 public CommandResult deleteContactMechanismAlias(UserVisitPK userVisitPK, DeleteContactMechanismAliasForm form) { 211 return CDI.current().select(DeleteContactMechanismAliasCommand.class).get().run(userVisitPK, form); 212 } 213 214 // -------------------------------------------------------------------------------- 215 // Party Contact Mechanism Aliases 216 // -------------------------------------------------------------------------------- 217 218 @Override 219 public CommandResult createPartyContactMechanismAlias(UserVisitPK userVisitPK, CreatePartyContactMechanismAliasForm form) { 220 return CDI.current().select(CreatePartyContactMechanismAliasCommand.class).get().run(userVisitPK, form); 221 } 222 223 @Override 224 public CommandResult deletePartyContactMechanismAlias(UserVisitPK userVisitPK, DeletePartyContactMechanismAliasForm form) { 225 return CDI.current().select(DeletePartyContactMechanismAliasCommand.class).get().run(userVisitPK, form); 226 } 227 228 // -------------------------------------------------------------------------------- 229 // Contact Email Addresses 230 // -------------------------------------------------------------------------------- 231 232 @Override 233 public CommandResult createContactEmailAddress(UserVisitPK userVisitPK, CreateContactEmailAddressForm form) { 234 return CDI.current().select(CreateContactEmailAddressCommand.class).get().run(userVisitPK, form); 235 } 236 237 @Override 238 public CommandResult editContactEmailAddress(UserVisitPK userVisitPK, EditContactEmailAddressForm form) { 239 return CDI.current().select(EditContactEmailAddressCommand.class).get().run(userVisitPK, form); 240 } 241 242 // -------------------------------------------------------------------------------- 243 // Contact Postal Addresses 244 // -------------------------------------------------------------------------------- 245 246 @Override 247 public CommandResult createContactPostalAddress(UserVisitPK userVisitPK, CreateContactPostalAddressForm form) { 248 return CDI.current().select(CreateContactPostalAddressCommand.class).get().run(userVisitPK, form); 249 } 250 251 @Override 252 public CommandResult editContactPostalAddress(UserVisitPK userVisitPK, EditContactPostalAddressForm form) { 253 return CDI.current().select(EditContactPostalAddressCommand.class).get().run(userVisitPK, form); 254 } 255 256 // -------------------------------------------------------------------------------- 257 // Contact Telephones 258 // -------------------------------------------------------------------------------- 259 260 @Override 261 public CommandResult createContactTelephone(UserVisitPK userVisitPK, CreateContactTelephoneForm form) { 262 return CDI.current().select(CreateContactTelephoneCommand.class).get().run(userVisitPK, form); 263 } 264 265 @Override 266 public CommandResult editContactTelephone(UserVisitPK userVisitPK, EditContactTelephoneForm form) { 267 return CDI.current().select(EditContactTelephoneCommand.class).get().run(userVisitPK, form); 268 } 269 270 // -------------------------------------------------------------------------------- 271 // Contact Web Addresses 272 // -------------------------------------------------------------------------------- 273 274 @Override 275 public CommandResult createContactWebAddress(UserVisitPK userVisitPK, CreateContactWebAddressForm form) { 276 return CDI.current().select(CreateContactWebAddressCommand.class).get().run(userVisitPK, form); 277 } 278 279 @Override 280 public CommandResult editContactWebAddress(UserVisitPK userVisitPK, EditContactWebAddressForm form) { 281 return CDI.current().select(EditContactWebAddressCommand.class).get().run(userVisitPK, form); 282 } 283 284 // -------------------------------------------------------------------------------- 285 // Party Contact Mechanism Purposes 286 // -------------------------------------------------------------------------------- 287 288 @Override 289 public CommandResult createPartyContactMechanismPurpose(UserVisitPK userVisitPK, CreatePartyContactMechanismPurposeForm form) { 290 return CDI.current().select(CreatePartyContactMechanismPurposeCommand.class).get().run(userVisitPK, form); 291 } 292 293 @Override 294 public CommandResult setDefaultPartyContactMechanismPurpose(UserVisitPK userVisitPK, SetDefaultPartyContactMechanismPurposeForm form) { 295 return CDI.current().select(SetDefaultPartyContactMechanismPurposeCommand.class).get().run(userVisitPK, form); 296 } 297 298 @Override 299 public CommandResult deletePartyContactMechanismPurpose(UserVisitPK userVisitPK, DeletePartyContactMechanismPurposeForm form) { 300 return CDI.current().select(DeletePartyContactMechanismPurposeCommand.class).get().run(userVisitPK, form); 301 } 302 303 // -------------------------------------------------------------------------------- 304 // Party Contact Mechanism Relationships 305 // -------------------------------------------------------------------------------- 306 307 @Override 308 public CommandResult createPartyContactMechanismRelationship(UserVisitPK userVisitPK, CreatePartyContactMechanismRelationshipForm form) { 309 return CDI.current().select(CreatePartyContactMechanismRelationshipCommand.class).get().run(userVisitPK, form); 310 } 311 312 @Override 313 public CommandResult deletePartyContactMechanismRelationship(UserVisitPK userVisitPK, DeletePartyContactMechanismRelationshipForm form) { 314 return CDI.current().select(DeletePartyContactMechanismRelationshipCommand.class).get().run(userVisitPK, form); 315 } 316 317 // -------------------------------------------------------------------------------- 318 // Postal Address Element Types 319 // -------------------------------------------------------------------------------- 320 321 @Override 322 public CommandResult createPostalAddressElementType(UserVisitPK userVisitPK, CreatePostalAddressElementTypeForm form) { 323 return CDI.current().select(CreatePostalAddressElementTypeCommand.class).get().run(userVisitPK, form); 324 } 325 326 @Override 327 public CommandResult getPostalAddressElementTypeChoices(UserVisitPK userVisitPK, GetPostalAddressElementTypeChoicesForm form) { 328 return CDI.current().select(GetPostalAddressElementTypeChoicesCommand.class).get().run(userVisitPK, form); 329 } 330 331 // -------------------------------------------------------------------------------- 332 // Postal Address Element Type Descriptions 333 // -------------------------------------------------------------------------------- 334 335 @Override 336 public CommandResult createPostalAddressElementTypeDescription(UserVisitPK userVisitPK, CreatePostalAddressElementTypeDescriptionForm form) { 337 return CDI.current().select(CreatePostalAddressElementTypeDescriptionCommand.class).get().run(userVisitPK, form); 338 } 339 340 // ------------------------------------------------------------------------- 341 // Postal Address Formats 342 // ------------------------------------------------------------------------- 343 344 @Override 345 public CommandResult createPostalAddressFormat(UserVisitPK userVisitPK, CreatePostalAddressFormatForm form) { 346 return CDI.current().select(CreatePostalAddressFormatCommand.class).get().run(userVisitPK, form); 347 } 348 349 @Override 350 public CommandResult getPostalAddressFormat(UserVisitPK userVisitPK, GetPostalAddressFormatForm form) { 351 return CDI.current().select(GetPostalAddressFormatCommand.class).get().run(userVisitPK, form); 352 } 353 354 @Override 355 public CommandResult getPostalAddressFormats(UserVisitPK userVisitPK, GetPostalAddressFormatsForm form) { 356 return CDI.current().select(GetPostalAddressFormatsCommand.class).get().run(userVisitPK, form); 357 } 358 359 @Override 360 public CommandResult getPostalAddressFormatChoices(UserVisitPK userVisitPK, GetPostalAddressFormatChoicesForm form) { 361 return CDI.current().select(GetPostalAddressFormatChoicesCommand.class).get().run(userVisitPK, form); 362 } 363 364 @Override 365 public CommandResult setDefaultPostalAddressFormat(UserVisitPK userVisitPK, SetDefaultPostalAddressFormatForm form) { 366 return CDI.current().select(SetDefaultPostalAddressFormatCommand.class).get().run(userVisitPK, form); 367 } 368 369 @Override 370 public CommandResult editPostalAddressFormat(UserVisitPK userVisitPK, EditPostalAddressFormatForm form) { 371 return CDI.current().select(EditPostalAddressFormatCommand.class).get().run(userVisitPK, form); 372 } 373 374 @Override 375 public CommandResult deletePostalAddressFormat(UserVisitPK userVisitPK, DeletePostalAddressFormatForm form) { 376 return CDI.current().select(DeletePostalAddressFormatCommand.class).get().run(userVisitPK, form); 377 } 378 379 // ------------------------------------------------------------------------- 380 // Postal Address Format Descriptions 381 // ------------------------------------------------------------------------- 382 383 @Override 384 public CommandResult createPostalAddressFormatDescription(UserVisitPK userVisitPK, CreatePostalAddressFormatDescriptionForm form) { 385 return CDI.current().select(CreatePostalAddressFormatDescriptionCommand.class).get().run(userVisitPK, form); 386 } 387 388 @Override 389 public CommandResult getPostalAddressFormatDescriptions(UserVisitPK userVisitPK, GetPostalAddressFormatDescriptionsForm form) { 390 return CDI.current().select(GetPostalAddressFormatDescriptionsCommand.class).get().run(userVisitPK, form); 391 } 392 393 @Override 394 public CommandResult editPostalAddressFormatDescription(UserVisitPK userVisitPK, EditPostalAddressFormatDescriptionForm form) { 395 return CDI.current().select(EditPostalAddressFormatDescriptionCommand.class).get().run(userVisitPK, form); 396 } 397 398 @Override 399 public CommandResult deletePostalAddressFormatDescription(UserVisitPK userVisitPK, DeletePostalAddressFormatDescriptionForm form) { 400 return CDI.current().select(DeletePostalAddressFormatDescriptionCommand.class).get().run(userVisitPK, form); 401 } 402 403 // -------------------------------------------------------------------------------- 404 // Postal Address Lines 405 // -------------------------------------------------------------------------------- 406 407 @Override 408 public CommandResult createPostalAddressLine(UserVisitPK userVisitPK, CreatePostalAddressLineForm form) { 409 return CDI.current().select(CreatePostalAddressLineCommand.class).get().run(userVisitPK, form); 410 } 411 412 @Override 413 public CommandResult getPostalAddressLines(UserVisitPK userVisitPK, GetPostalAddressLinesForm form) { 414 return CDI.current().select(GetPostalAddressLinesCommand.class).get().run(userVisitPK, form); 415 } 416 417 @Override 418 public CommandResult editPostalAddressLine(UserVisitPK userVisitPK, EditPostalAddressLineForm form) { 419 return CDI.current().select(EditPostalAddressLineCommand.class).get().run(userVisitPK, form); 420 } 421 422 @Override 423 public CommandResult deletePostalAddressLine(UserVisitPK userVisitPK, DeletePostalAddressLineForm form) { 424 return CDI.current().select(DeletePostalAddressLineCommand.class).get().run(userVisitPK, form); 425 } 426 427 // -------------------------------------------------------------------------------- 428 // Postal Address Line Elements 429 // -------------------------------------------------------------------------------- 430 431 @Override 432 public CommandResult createPostalAddressLineElement(UserVisitPK userVisitPK, CreatePostalAddressLineElementForm form) { 433 return CDI.current().select(CreatePostalAddressLineElementCommand.class).get().run(userVisitPK, form); 434 } 435 436 @Override 437 public CommandResult getPostalAddressLineElements(UserVisitPK userVisitPK, GetPostalAddressLineElementsForm form) { 438 return CDI.current().select(GetPostalAddressLineElementsCommand.class).get().run(userVisitPK, form); 439 } 440 441 @Override 442 public CommandResult editPostalAddressLineElement(UserVisitPK userVisitPK, EditPostalAddressLineElementForm form) { 443 return CDI.current().select(EditPostalAddressLineElementCommand.class).get().run(userVisitPK, form); 444 } 445 446 @Override 447 public CommandResult deletePostalAddressLineElement(UserVisitPK userVisitPK, DeletePostalAddressLineElementForm form) { 448 return CDI.current().select(DeletePostalAddressLineElementCommand.class).get().run(userVisitPK, form); 449 } 450 451}