-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Hidiroglu Alper
committed
Nov 14, 2018
1 parent
a702334
commit e9eba7d
Showing
97 changed files
with
5,803 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
continuity.api/src/main/java/org/continuity/api/entities/artifact/ForecastBundle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package org.continuity.api.entities.artifact; | ||
|
||
import java.util.Date; | ||
import java.util.LinkedList; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
|
||
/** | ||
* | ||
* @author Alper Hidiroglu | ||
* | ||
*/ | ||
public class ForecastBundle { | ||
|
||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH-mm-ss-SSSX") | ||
private Date timestamp; | ||
|
||
private int workloadIntensity; | ||
|
||
private LinkedList<Double> probabilities; | ||
|
||
public ForecastBundle(Date timestamp, Integer workloadIntensity, LinkedList<Double> probabilities) { | ||
this.timestamp = timestamp; | ||
this.workloadIntensity = workloadIntensity; | ||
this.probabilities = probabilities; | ||
} | ||
|
||
public ForecastBundle() { | ||
|
||
} | ||
|
||
public Date getTimestamp() { | ||
return timestamp; | ||
} | ||
|
||
public void setTimestamp(Date timestamp) { | ||
this.timestamp = timestamp; | ||
} | ||
|
||
public Integer getWorkloadIntensity() { | ||
return workloadIntensity; | ||
} | ||
|
||
public void setWorkloadIntensity(Integer workloadIntensity) { | ||
this.workloadIntensity = workloadIntensity; | ||
} | ||
|
||
public LinkedList<Double> getProbabilities() { | ||
return probabilities; | ||
} | ||
|
||
public void setProbabilities(LinkedList<Double> probabilities) { | ||
this.probabilities = probabilities; | ||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
continuity.api/src/main/java/org/continuity/api/entities/artifact/SessionsBundle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.continuity.api.entities.artifact; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* | ||
* @author Alper Hidiroglu | ||
* | ||
*/ | ||
public class SessionsBundle { | ||
|
||
private int behaviorId; | ||
private List<SimplifiedSession> sessions; | ||
|
||
public SessionsBundle(int behaviorId, List<SimplifiedSession> sessions) { | ||
this.behaviorId = behaviorId; | ||
this.sessions = sessions; | ||
} | ||
|
||
public SessionsBundle() { | ||
|
||
} | ||
|
||
public int getBehaviorId() { | ||
return behaviorId; | ||
} | ||
public void setBehaviorId(int behaviorId) { | ||
this.behaviorId = behaviorId; | ||
} | ||
public List<SimplifiedSession> getSessions() { | ||
return sessions; | ||
} | ||
public void setSessions(List<SimplifiedSession> sessions) { | ||
this.sessions = sessions; | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
continuity.api/src/main/java/org/continuity/api/entities/artifact/SessionsBundlePack.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package org.continuity.api.entities.artifact; | ||
|
||
import java.util.Date; | ||
import java.util.List; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
|
||
public class SessionsBundlePack { | ||
|
||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH-mm-ss-SSSX") | ||
private Date timestamp; | ||
|
||
private List<SessionsBundle> sessionsBundles; | ||
|
||
public SessionsBundlePack(Date timestamp, List<SessionsBundle> sessionsBundles) { | ||
super(); | ||
this.timestamp = timestamp; | ||
this.sessionsBundles = sessionsBundles; | ||
} | ||
|
||
public SessionsBundlePack() { | ||
|
||
} | ||
|
||
public Date getTimestamp() { | ||
return timestamp; | ||
} | ||
|
||
public void setTimestamp(Date timestamp) { | ||
this.timestamp = timestamp; | ||
} | ||
|
||
public List<SessionsBundle> getSessionsBundles() { | ||
return sessionsBundles; | ||
} | ||
|
||
public void setSessionsBundles(List<SessionsBundle> sessionsBundles) { | ||
this.sessionsBundles = sessionsBundles; | ||
} | ||
|
||
} |
48 changes: 48 additions & 0 deletions
48
continuity.api/src/main/java/org/continuity/api/entities/artifact/SimplifiedSession.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package org.continuity.api.entities.artifact; | ||
|
||
/** | ||
* Represents a simplified session. | ||
* @author Alper Hidiroglu | ||
* | ||
*/ | ||
public class SimplifiedSession { | ||
|
||
private String id; | ||
private long startTime; | ||
private long endTime; | ||
|
||
/** | ||
* Constructor. | ||
* @param id | ||
* @param startTime | ||
* @param endTime | ||
*/ | ||
public SimplifiedSession(String id, long startTime, long endTime) { | ||
this.id = id; | ||
this.startTime = startTime; | ||
this.endTime = endTime; | ||
} | ||
|
||
public SimplifiedSession() { | ||
|
||
} | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
public long getStartTime() { | ||
return startTime; | ||
} | ||
public void setStartTime(long startTime) { | ||
this.startTime = startTime; | ||
} | ||
public long getEndTime() { | ||
return endTime; | ||
} | ||
public void setEndTime(long endTime) { | ||
this.endTime = endTime; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
continuity.api/src/main/java/org/continuity/api/entities/links/ForecastLinks.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package org.continuity.api.entities.links; | ||
|
||
import java.lang.reflect.Field; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonInclude.Include; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public class ForecastLinks extends AbstractLinks<ForecastLinks> { | ||
|
||
@JsonProperty(value = "link", required = false) | ||
@JsonInclude(Include.NON_NULL) | ||
private String link; | ||
|
||
public ForecastLinks(LinkExchangeModel parent) { | ||
super(parent); | ||
} | ||
|
||
public ForecastLinks() { | ||
this(null); | ||
} | ||
|
||
public String getLink() { | ||
return link; | ||
} | ||
|
||
public ForecastLinks setLink(String forecastLink) { | ||
this.link = forecastLink; | ||
return this; | ||
} | ||
|
||
@Override | ||
public boolean isEmpty() { | ||
for (Field field : ForecastLinks.class.getDeclaredFields()) { | ||
try { | ||
if ((field.getName() != "parent") && (field.get(this) != null)) { | ||
return false; | ||
} | ||
} catch (IllegalArgumentException | IllegalAccessException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
return true; | ||
} | ||
|
||
@Override | ||
public void merge(ForecastLinks other) throws IllegalArgumentException, IllegalAccessException { | ||
for (Field field : ForecastLinks.class.getDeclaredFields()) { | ||
if ((field.getName() != "parent") && (field.get(this) == null)) { | ||
field.set(this, field.get(other)); | ||
} | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.