throw new BugException("illegal user set id: " + userSetId);
}
UserSetManager userSetManager = new UserSetManager(locale,session);
UserSet userSet = userSetManager.getUserSet(userSetId);
if (userSet == null && userSetId != -2) {
throw new ConfigurationException("illegal user set id: " + userSetId);
}
emailCommandEntry.setDestinationUserSet(userSet);
emailCommandEntry.setCurrentUserSetAsDestination(userSetId == -2 ? 1 : 0);
emailCommandEntry.setDestinationUser(null);
emailCommandEntry.setDestinationEmail(null);
emailCommandEntry.setDestinationPersonalName(null);
break;
case 2: // message to user
Long userId = f.getUserId();
if (userId.longValue() == -1){
throw new InputException(resources.getMessage(locale,"smssvc.MessageNotSentBecauseNoUserSelected"));
}
UserManager userManager = new UserManager(locale,session);
User user = userManager.getUserDetails(userId);
if (user == null){
throw new ConfigurationException("illegal user id: " + user);
}
emailCommandEntry.setDestinationUser(user);
emailCommandEntry.setDestinationUserSet(null);
emailCommandEntry.setDestinationEmail(null);
emailCommandEntry.setDestinationPersonalName(null);