Package com.almende.eve.entity.activity

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


    // updated
    String updated = null;
    if (event.has("updated")) {
      updated = event.get("updated").asText();
    }
    activity.withStatus().setUpdated(updated);

    // start
    String start = null;
    if (event.with("start").has("dateTime")) {
      start = event.with("start").get("dateTime").asText();
View Full Code Here


    // start
    String start = null;
    if (event.with("start").has("dateTime")) {
      start = event.with("start").get("dateTime").asText();
    }
    activity.withStatus().setStart(start);

    // end
    String end = null;
    if (event.with("end").has("dateTime")) {
      end = event.with("end").get("dateTime").asText();
View Full Code Here

    // end
    String end = null;
    if (event.with("end").has("dateTime")) {
      end = event.with("end").get("dateTime").asText();
    }
    activity.withStatus().setEnd(end);

    // duration
    if (start != null && end != null) {
      Interval interval = new Interval(new DateTime(start), new DateTime(
          end));
View Full Code Here

    // verify all kind of stuff
    Activity activity = (Activity) state.get("activity");
    if (activity == null) {
      return; // oops no activity at all
    }
    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) {
View Full Code Here

    Activity activity = (Activity) state.get("activity");
    if (activity == null) {
      return; // oops no activity at all
    }
    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
View Full Code Here

   
    // check if the activity or the retrieved event is changed since the
    // last synchronization
    AgentData agentData = getAgentData(agent);
    boolean activityChanged = !equalsDateTime(agentData.activityUpdated,
        activity.withStatus().getUpdated());
    boolean eventChanged = !equalsDateTime(agentData.eventUpdated,
        eventActivity.withStatus().getUpdated());
    boolean changed = activityChanged || eventChanged;   
    if (changed && activity.isNewerThan(eventActivity)) {
      // activity is updated (event is out-dated or not yet existing)
View Full Code Here

            ObjectNode.class);

        // update the agent data
        agentData.eventId = updatedEvent.get("id").asText();
        agentData.eventUpdated = updatedEvent.get("updated").asText();
        agentData.activityUpdated = activity.withStatus().getUpdated();
        putAgentData(agent, agentData);
      } catch (JSONRPCException e) {
        addIssue(TYPE.warning, Issue.JSONRPCEXCEPTION, e.getMessage());
        e.printStackTrace(); // TODO remove printing stacktrace
      } catch (Exception e) {
View Full Code Here

    } else if (changed) {
      // event is updated (activity is out-dated or both have the same
      // updated timestamp)
     
      // if start is changed, add this as preferences to the constraints
      if (!equalsDateTime(activity.withStatus().getStart(),
          eventActivity.withStatus().getStart())) {
        /* TODO: store the old interval as undesired?
        String oldStart = activity.withStatus().getStart();
        String oldEnd = activity.withStatus().getEnd();
        if (oldStart != null && oldEnd != null) {
View Full Code Here

      state.put("activity", activity);

      // update the agent data
      agentData.eventId = event.get("id").asText();
      agentData.eventUpdated = event.get("updated").asText();
      agentData.activityUpdated = activity.withStatus().getUpdated();
      putAgentData(agent, agentData);
    }
    else {
      // activity and eventActivity have the same updated timestamp
      // nothing to do.
View Full Code Here

    */
   
    // 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);
        DateTime endTime = new DateTime(end);
        Interval interval = new Interval(startTime, endTime);
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.