Examples of withConstraints()


Examples of com.almende.eve.entity.activity.Activity.withConstraints()

    activity.withStatus().setAttendees(attendees);
    // TODO: is it needed to check if the attendees are changed?
    */
   
    // check time constraints
    Long duration = activity.withConstraints().withTime().getDuration();
    if (duration != null) {
      String start = activity.withStatus().getStart();
      String end = activity.withStatus().getEnd();
      if (start != null && end != null) {
        DateTime startTime = new DateTime(start);
View Full Code Here

Examples of com.almende.eve.entity.activity.Activity.withConstraints()

        }
      }
    }
   
    // location constraints
    String newLocation = activity.withConstraints().withLocation().getSummary();
    String oldLocation = activity.withStatus().withLocation().getSummary();
    if (newLocation != null && !newLocation.equals(oldLocation)) {
      activity.withStatus().withLocation().setSummary(newLocation);
      changed = true;
    }
View Full Code Here

Examples of com.almende.eve.entity.activity.Activity.withConstraints()

    boolean changed = false;
    if (activity != null) {
      String updatedBefore = activity.withStatus().getUpdated();

      for (Attendee attendee : activity.withConstraints().withAttendees()) {
        String agent = attendee.getAgent();
        if (agent != null) {
          if (attendee.getResponseStatus() != RESPONSE_STATUS.declined) {
            syncEvent(agent);
          }
View Full Code Here

Examples of com.almende.eve.entity.activity.Activity.withConstraints()

    if (preferred == null) {
      preferred = new ArrayList<Weight>();
    }
   
    // get the duration of the activity
    Long durationLong = activity.withConstraints().withTime().getDuration();
    Duration duration = null;
    if (durationLong != null) {
      duration = new Duration(durationLong);
    } else {
      // TODO: give error when duration is not defined?
View Full Code Here

Examples of com.almende.eve.entity.activity.Activity.withConstraints()

    // duration
    if (start != null && end != null) {
      Interval interval = new Interval(new DateTime(start), new DateTime(
          end));
      Long duration = interval.toDurationMillis();
      activity.withConstraints().withTime().setDuration(duration);
    }

    // location
    String location = null;
    if (event.has("location")) {
View Full Code Here

Examples of com.almende.eve.entity.activity.Activity.withConstraints()

    // location
    String location = null;
    if (event.has("location")) {
      location = event.get("location").asText();
    }
    activity.withConstraints().withLocation().setSummary(location);
   
    return activity;
  }

  /**
 
View Full Code Here

Examples of com.almende.eve.entity.activity.Activity.withConstraints()

        if (e.getCode() == 404) {
          // event was deleted by the user.

          //e.printStackTrace();
          Activity activity = (Activity) getState().get("activity");
          Attendee attendee = activity.withConstraints().withAttendee(agent);
          attendee.setResponseStatus(RESPONSE_STATUS.declined);
          getState().put("activity", activity);
         
          clearAttendee(agent); // TODO: seems not to work
        } else {
View Full Code Here

Examples of com.almende.eve.entity.activity.Activity.withConstraints()

    }
    if (activity.withStatus().getStart() == null ||
        activity.withStatus().getEnd() == null) {
      return; // activity is not yet planned. cancel synchronization
    }
    Attendee attendee = activity.withConstraints().getAttendee(agent);
    if (attendee == null) {
      return; // unknown attendee
    }
    if (attendee.getResponseStatus() == Attendee.RESPONSE_STATUS.declined) {
      // attendee does not want to attend
View Full Code Here

Examples of com.almende.eve.entity.activity.Activity.withConstraints()

   * Update the busy intervals of all attendees, and merge the results
   */
  private void updateBusyIntervals() {
    Activity activity = getActivity();
    if (activity != null) {
      List<Attendee> attendees = activity.withConstraints().withAttendees();
      for (Attendee attendee : attendees) {
        String agent = attendee.getAgent();
        if (attendee.getResponseStatus() != RESPONSE_STATUS.declined) {
          updateBusyInterval(agent);
        }
View Full Code Here

Examples of com.almende.eve.entity.activity.Activity.withConstraints()

    List<Weight> preferredIntervals = new ArrayList<Weight>();

    Activity activity = getActivity();
    if (activity != null) {
      // read and merge the stored busy intervals of all attendees
      for (Attendee attendee : activity.withConstraints().withAttendees()) {
        String agent = attendee.getAgent();
        if (attendee.getResponseStatus() == RESPONSE_STATUS.declined) {
          // This attendee declined.
          // Ignore this attendees busy interval
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.