import javax.naming.NamingException;
import org.mxchange.jcontacts.contact.Contact;
import org.mxchange.jcontacts.contact.ContactSessionBeanRemote;
-import org.mxchange.jcontacts.events.contact.add.AdminAddedContactEvent;
import org.mxchange.jjobs.beans.BaseJobsController;
import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController;
import org.mxchange.jjobs.beans.features.JobsFeaturesWebApplicationController;
}
}
- @Override
- public void afterAdminAddedContact (@Observes final AdminAddedContactEvent event) {
- // The event must be valid
- if (null == event) {
- // Throw NPE
- throw new NullPointerException("event is null"); //NOI18N
- } else if (event.getAddedContact() == null) {
- // Throw again ...
- throw new NullPointerException("event.addedContact is null"); //NOI18N
- } else if (event.getAddedContact().getContactId() == null) {
- // ... and again
- throw new NullPointerException("event.addedContact.customerId is null"); //NOI18N
- } else if (event.getAddedContact().getContactId() < 1) {
- // Not valid
- throw new IllegalArgumentException(MessageFormat.format("event.addedContact.customerId={0} is not valid", event.getAddedContact().getContactId())); //NOI18N //NOI18N
- }
-
- // Call other method
- this.selectableContacts.add(event.getAddedContact());
- }
-
@Override
public void afterAdminAddedUserEvent (@Observes final AdminAddedUserEvent event) {
// Trace message
}
}
}
-
- // Set contact list
- this.selectableContacts = allContacts;
}
@Override
return user;
}
- @Override
- public List<Contact> selectableContacts () {
- return Collections.unmodifiableList(this.selectableContacts);
- }
-
/**
* Adds user's name to bean's internal list. It also updates the public user
* list if the user has decided to have a public account,
*/
User lookupUserByEmailAddress (final String emailAddress) throws UserEmailAddressNotFoundException;
- /**
- * Returns a list of all selectable contacts for user creation. Contacts
- * from already existing users are excluded in this list.
- * <p>
- * @return A list of all selectable contacts
- */
- List<Contact> selectableContacts ();
-
/**
* Creates an instance from all properties
* <p>