Examples of withConstraints()


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()

    ArrayList<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

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

          }
        }       
      }

      // read the time preferences and add them to the soft constraints
      List<Preference> preferences = activity.withConstraints()
        .withTime().withPreferences();
      for (Preference p : preferences) {
        if (p != null) {
          Weight wi = new Weight(
              new DateTime(p.getStart()),
View Full Code Here

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

  @Access(AccessType.UNAVAILABLE)
  public void clear () {
    Activity activity = getActivity();

    if (activity != null) {
      List<Attendee> attendees = activity.withConstraints().withAttendees();
      for (Attendee attendee : attendees) {
        String agent = attendee.getAgent();
        if (agent != null) {
          clearAttendee(agent);
        }
View Full Code Here

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

      @Required(false) @Name("location") String location,
      @Name("duration") Integer duration,
      @Name("agents") List<String> agents) {
    Activity activity = new Activity();
    activity.setSummary(summary);
    activity.withConstraints().withLocation().setSummary(location);
    for (String agent : agents) {
      Attendee attendee = new Attendee();
      attendee.setAgent(agent);
      activity.withConstraints().withAttendees().add(attendee);
    }
View Full Code Here

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

    activity.setSummary(summary);
    activity.withConstraints().withLocation().setSummary(location);
    for (String agent : agents) {
      Attendee attendee = new Attendee();
      attendee.setAgent(agent);
      activity.withConstraints().withAttendees().add(attendee);
    }

    update();
  }
View Full Code Here

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

    // ensure the url of the meeting agent is filled in
    String myUrl = getFirstUrl();
    activity.setAgent(myUrl);

    // create duration when missing
    Long duration = activity.withConstraints().withTime().getDuration();
    if (duration == null) {
      duration = Duration.standardHours(1).getMillis(); // 1 hour in ms
      activity.withConstraints().withTime().setDuration(duration);
    }
View Full Code Here

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

    // create duration when missing
    Long duration = activity.withConstraints().withTime().getDuration();
    if (duration == null) {
      duration = Duration.standardHours(1).getMillis(); // 1 hour in ms
      activity.withConstraints().withTime().setDuration(duration);
    }

    // remove calendar events from removed attendees
    Set<String> currentAttendees = getAgents(activity);
    Set<String> removedAttendees = new TreeSet<String>(prevAttendees);
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.