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