Package com.apps.datastore.dao

Examples of com.apps.datastore.dao.ContactInformationObject


      else {
        boolean success;
        try {
          UniqueCourseObject uco = new UniqueCourseObject(dept,course,section);
          d.addCourse(uco);
          success = d.addNotifier(uco, new ContactInformationObject(email,phoneNumber,seatcfg,notifycfg,carrier));
          if(success)
            xmlout += "\t<message>Notification request was successfully added</message>\n";
          else
            xmlout += "\t<message>Notification request failed</message>\n";
        } catch (EntityNotFoundException e) {
View Full Code Here


  }

  private ContactInformationObject getContactInformation(Key contactKey)
      throws EntityNotFoundException {
    Entity e = datastore.get(contactKey);
    ContactInformationObject cio = new ContactInformationObject(
        (String) e.getProperty("emailAddress"),
        (String) e.getProperty("phoneNumber"),
        (Long) e.getProperty("seatConfig"),
        (Long) e.getProperty("notifyConfig"),
        (String) e.getProperty("carrier"));
View Full Code Here

      long gSeats = (Long) e.getProperty("generalSeats");
      long rSeats = (Long) e.getProperty("restrictedSeats");
      List<Entity> ceel = getContactEntryEntityList(e.getKey());
      for (Iterator j = ceel.iterator(); j.hasNext();) {
        Entity ce = (Entity)j.next();
        ContactInformationObject cio = getContactInformation((Key)ce.getProperty("contactKey"));
        if (cio.getSeatConfig() == 1 && gSeats > 0) {
          // notify gen seats avail
          if (cio.getNotifyConfig() == 1
              && cio.getEmailAddress() != null
              && cio.getEmailAddress() != "") {
            // email notify
            EmailNotifier en = new EmailNotifier();
            String msg = prepareMessage(EMAIL_NOTIFICATION,
                uco.getDepartmentName(), uco.getCourseNumber(),
                uco.getSectionNumber(), gSeats, "general");
            EmailNotifier.sendMessage(cio.getEmailAddress(), msg);
            destroyContactEntry(ce.getKey());
          }
          if (cio.getNotifyConfig() == 2
              && cio.getPhoneNumber() != null
              && cio.getPhoneNumber() != ""
              && cio.getCarrier() != CARRIER.NULL) {
            // sms notify
            SMSNotifier smsn = new SMSNotifier();
            String msg = prepareMessage(SMS_NOTIFICATION,
                uco.getDepartmentName(), uco.getCourseNumber(),
                uco.getSectionNumber(), gSeats, "general");
            SMSNotifier.sendMessage(cio.getPhoneNumber(),
                cio.getCarrier(), msg);
            destroyContactEntry(ce.getKey());
          }
        }
        if (cio.getSeatConfig() == 2 && rSeats > 0) {
          // notify res seats avail
          if (cio.getNotifyConfig() == 1
              && cio.getEmailAddress() != null
              && cio.getEmailAddress() != "") {
            // email notify
            EmailNotifier en = new EmailNotifier();
            String msg = prepareMessage(EMAIL_NOTIFICATION,
                uco.getDepartmentName(), uco.getCourseNumber(),
                uco.getSectionNumber(), rSeats, "restricted");
            EmailNotifier.sendMessage(cio.getEmailAddress(), msg);
            destroyContactEntry(ce.getKey());
          }
          if (cio.getNotifyConfig() == 2
              && cio.getPhoneNumber() != null
              && cio.getPhoneNumber() != ""
              && cio.getCarrier() != CARRIER.NULL) {
            // sms notify
            SMSNotifier smsn = new SMSNotifier();
            String msg = prepareMessage(SMS_NOTIFICATION,
                uco.getDepartmentName(), uco.getCourseNumber(),
                uco.getSectionNumber(), rSeats, "restricted");
            SMSNotifier.sendMessage(cio.getPhoneNumber(),
                cio.getCarrier(), msg);
            destroyContactEntry(ce.getKey());
          }
        }

      }
View Full Code Here

  private boolean checkNotifierExist(UniqueCourseObject uco,
      ContactInformationObject cio) throws EntityNotFoundException {
    List<ContactInformationObject> ciol = getContactEntryList(uco);
    for (Iterator i = ciol.iterator(); i.hasNext();) {
      ContactInformationObject cio2 = (ContactInformationObject) i.next();
      if (cio2.equals(cio))
        return true;
    }
    return false;
  }
View Full Code Here

TOP

Related Classes of com.apps.datastore.dao.ContactInformationObject

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.