Package evolaris.framework.sys.business.exception

Examples of evolaris.framework.sys.business.exception.BugException


        break;
      case 4: // message to user set
        smsCommandEntry.setDestinationContact(0);
        Long userSetId = msgForm.getUserSetId();
        if(userSetId.longValue() == -1){
          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);
        }
        smsCommandEntry.setDestinationUserSet(userSet);
        smsCommandEntry.setCurrentUserSetAsDestination(userSetId == -2 ? 1 : 0);
        smsCommandEntry.setDestinationMsisdn(null);
        smsCommandEntry.setDestinationUser(null);
        break;
      case 5: // message to user
        smsCommandEntry.setDestinationContact(0);
        Long userId = msgForm.getUserId();
        if (userId.longValue() == -1){
          String noUserSelectedString = getResources(req).getMessage(locale,"smssvc.MessageNotSentBecauseNoUserSelected");
          throw new InputException(noUserSelectedString);
        }
        UserManager userManager = new UserManager(locale,session);
        User user = userManager.getUserDetails(userId);
        if (user == null){
          throw new ConfigurationException("illegal user id: " + user);
        }
        smsCommandEntry.setDestinationUser(user);
        smsCommandEntry.setDestinationUserSet(null);
        smsCommandEntry.setDestinationMsisdn(null);
        break;
      case 6: // message to msisdn
        smsCommandEntry.setDestinationContact(0);
        String countryCode = msgForm.getCountryCode();
        String mobileNumber = msgForm.getMobileNumber();
        try {
          long countryCodeNumber = Long.parseLong(countryCode);
          long mobileNumberNumber = Long.parseLong(mobileNumber);
          long msisdn = Long.parseLong(countryCodeNumber + "" + mobileNumberNumber)// ignores leading zeros
          smsCommandEntry.setDestinationUserSet(null);
          smsCommandEntry.setDestinationMsisdn(msisdn);
          smsCommandEntry.setDestinationUser(null);
        } catch (NumberFormatException e){
          throw new BugException("validation of countryCode and mobileNumber failed");
        }
        break;
      default:
        throw new BugException("illegal destination selection number");
    }

    LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase()
        + ": Created message command entry #" + smsCommandEntry.getId()
        + "; label: " + smsCommandEntry.getSortLabel() + "; with message: " + smsCommandEntry.getTextContent()
View Full Code Here


  protected ActionForward duplicateBasedOnMappingSet(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp){
    InvocationEnterOrEditForm f = (InvocationEnterOrEditForm)form;
    // get mappings from session
    Object mappingSetFromSession = req.getSession().getAttribute("mappingSet");
    if (!(mappingSetFromSession instanceof MappingSet)) {
      throw new BugException("invalid mappingSet parameter: " + mappingSetFromSession);
    }
    MappingSet mappingSet = (MappingSet) mappingSetFromSession;
    mappingSet.reload(locale, session);
   
    Object oldInvocationId = req.getSession().getAttribute("oldInteractionListId");
View Full Code Here

  private TimerEvent eventFromSession(HttpServletRequest req) {
    // get the current event from the session
    SmsServiceDbManager serviceMgr = new SmsServiceDbManager(locale,session);
    Object eventIdParam = req.getSession().getAttribute("interactionListId");
    if (eventIdParam == null || !(eventIdParam instanceof Long)) {
      throw new BugException("no event id found for association");
    }
    long eventId = ((Long)eventIdParam).longValue();
    if (eventId == -1) {
      throw new BugException("id -1 in session");
    }
    TimerEvent event = serviceMgr.getTimerEvent(eventId);
    if(event == null) {
      throw new ConfigurationException("There is no event with id: " + eventId + " -> cannot add a new interaction");
    }
View Full Code Here

        throw new InputException(getResources(req).getMessage(locale, "smssvc.insufficientRights"));
      }
      serviceDbManager.deleteTimerEvent(timerEvent);
      LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase() + ": Timer event #" + timerEventId + " has been deleted");
    } else {
      throw new BugException("missing or invalid id parameter passed to delete action: " + idAttribute);
    }
    return mapping.findForward("deleted");
  }
View Full Code Here

  /* (non-Javadoc)
     * @see evolaris.platform.smssvc.web.action.InteractionListBaseAction#adaptCreated(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
     */
    @Override
    protected ActionForward adaptCreated(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
      throw new BugException("no interaction editing supported within this list");
    }
View Full Code Here

  /* (non-Javadoc)
     * @see evolaris.platform.smssvc.web.action.InteractionListBaseAction#adaptModified(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
     */
    @Override
    protected ActionForward adaptModified(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
      throw new BugException("no interaction editing supported within this list");
    }
View Full Code Here

  /* (non-Javadoc)
     * @see evolaris.platform.smssvc.web.action.InteractionListBaseAction#setNewInteractionAttributes(org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, java.lang.Long)
     */
    @Override
    protected void setNewInteractionAttributes(ActionForm form, HttpServletRequest req, long groupId,long applicationId) {
      throw new BugException("no interaction editing supported within this list");
    }
View Full Code Here

    UserManagerBase userManager = new UserManager(locale,session);
    User user = userManager.getUserDetails(req.getUserPrincipal().getName().toLowerCase());

    String idParam = req.getParameter("id");
    if (idParam == null) {
      throw new BugException("missing id parameter");
    }
    long id = Long.parseLong(idParam);
    detailForm.setId(id);

    SendTaskManager sendTaskMgm = new SendTaskManager(locale, session);
View Full Code Here

  public ActionForward search(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
   
    // evaluate session content
    Map<String, String[][]> criteriasInGroupsAndCategories = (Map<String,String[][]>)req.getSession().getAttribute(ATTR_CRITERIAS_IN_GROUPS_AND_CATEGORIES);
    if (criteriasInGroupsAndCategories == null) {
      throw new BugException("Missing attribute in session: " + ATTR_CRITERIAS_IN_GROUPS_AND_CATEGORIES);
    }
    ApplicationType[] foundApplications = findAppropriateApplications(req, criteriasInGroupsAndCategories);
   
    // put search result into session - for being displayed in another action later on.
    List<Long> resultIds = new ArrayList<Long>();
View Full Code Here

   */
  private ActionForward sendToUsersWithEmail(EmailAddress fromAddress, Set<User> users, ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp, Date sendAt) {
    EmailSendForm msgForm = (EmailSendForm) form;
    for (User user : users) {
      if (!req.isUserInRole(UserManagerBase.ADMINISTRATOR) && user.getGroup() != webUser.getGroup()){
        throw new BugException("user selected as SMS destination, who must not be accessed: " + user.getId());
      }
    }
    SortedSet<EmailAddress> receivers = EmailAddress.availableAddresses(users);
    if (receivers.size() == 0) {
      String noUsersWithEmailString = getResources(req).getMessage(locale,"smssvc.noUsersWithEmail");
View Full Code Here

TOP

Related Classes of evolaris.framework.sys.business.exception.BugException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.