throws Exception {
final String method = Constants.SAVE;
doLogProcess(mapping, method);
User user = doGetUser(request);
if (user == null) {
return doFindLogon(mapping);
}
HttpSession session = request.getSession();
if (isCancelled(request)) {
doCancel(session, method, Constants.SUBSCRIPTION_KEY);
return doFindSuccess(mapping);
}
String action = doGet(form, TASK);
Subscription subscription = doGetSubscription(request);
boolean isDelete = action.equals(Constants.DELETE);
if (isDelete) {
return doRemoveSubscription(mapping, session, user, subscription);
}
if (subscription == null) {
subscription = user.createSubscription(doGet(form, HOST));
session.setAttribute(Constants.SUBSCRIPTION_KEY, subscription);
}
doPopulate(subscription, form);
doSaveUser(user);