-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #388 from snieguu/master
Version 2.103
- Loading branch information
Showing
8 changed files
with
176 additions
and
9 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
78 changes: 78 additions & 0 deletions
78
src/main/java/com/testdroid/api/model/APIAccountConcurrencyStatus.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,78 @@ | ||
package com.testdroid.api.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import com.testdroid.api.APIEntity; | ||
|
||
import javax.xml.bind.annotation.XmlRootElement; | ||
import java.util.Objects; | ||
|
||
/** | ||
* @author Damian Sniezek <[email protected]> | ||
*/ | ||
@XmlRootElement | ||
public class APIAccountConcurrencyStatus extends APIEntity { | ||
|
||
private Long runningSessions; | ||
|
||
private Long waitingSessions; | ||
|
||
private Long sessions; | ||
|
||
private Integer accountConcurrency; | ||
|
||
private String mainUserEmail; | ||
|
||
private Boolean unlimitedConcurrency; | ||
|
||
APIAccountConcurrencyStatus(){ | ||
|
||
} | ||
|
||
public Integer getAccountConcurrency() { | ||
return accountConcurrency; | ||
} | ||
|
||
public Long getRunningSessions() { | ||
return runningSessions; | ||
} | ||
|
||
public Long getWaitingSessions() { | ||
return waitingSessions; | ||
} | ||
|
||
public Long getSessions() { | ||
return sessions; | ||
} | ||
|
||
public String getMainUserEmail() { | ||
return mainUserEmail; | ||
} | ||
|
||
public Boolean getUnlimitedConcurrency() { | ||
return unlimitedConcurrency; | ||
} | ||
|
||
public APIAccountConcurrencyStatus( | ||
Long accountId, String mainUserEmail, Long waitingSessions, Long runningSessions, | ||
Integer accountConcurrency, Boolean hasMobileConcurrencyRole) { | ||
super(accountId); | ||
this.runningSessions = runningSessions; | ||
this.waitingSessions = waitingSessions; | ||
this.sessions = runningSessions + waitingSessions; | ||
this.mainUserEmail = mainUserEmail; | ||
this.accountConcurrency = accountConcurrency; | ||
this.unlimitedConcurrency = hasMobileConcurrencyRole && Objects.isNull(accountConcurrency); | ||
} | ||
|
||
@Override | ||
@JsonIgnore | ||
protected <T extends APIEntity> void clone(T from) { | ||
APIAccountConcurrencyStatus origin = (APIAccountConcurrencyStatus) from; | ||
cloneBase(from); | ||
this.runningSessions = origin.runningSessions; | ||
this.waitingSessions = origin.waitingSessions; | ||
this.sessions = origin.sessions; | ||
this.accountConcurrency = origin.accountConcurrency; | ||
this.mainUserEmail = origin.mainUserEmail; | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
src/main/java/com/testdroid/api/model/APIAccountPreference.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,61 @@ | ||
package com.testdroid.api.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import com.testdroid.api.APIEntity; | ||
|
||
import javax.xml.bind.annotation.XmlRootElement; | ||
import java.io.Serializable; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
/** | ||
* @author Damian Sniezek <[email protected]> | ||
*/ | ||
@XmlRootElement | ||
public class APIAccountPreference extends APIEntity implements Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private List<String> allowedFileExtensions = new ArrayList<>(); | ||
|
||
public List<String> getAllowedFileExtensions() { | ||
return allowedFileExtensions; | ||
} | ||
|
||
public APIAccountPreference setAllowedFileExtensions(List<String> allowedFileExtensions) { | ||
this.allowedFileExtensions = allowedFileExtensions; | ||
return this; | ||
} | ||
|
||
@Override | ||
public void setId(Long id) { | ||
super.setId(id); | ||
this.selfURI = String.format("/accounts/%s/preferences", id); | ||
} | ||
|
||
@Override | ||
@JsonIgnore | ||
protected <T extends APIEntity> void clone(T from) { | ||
APIAccountPreference prototype = (APIAccountPreference) from; | ||
cloneBase(from); | ||
this.allowedFileExtensions = prototype.allowedFileExtensions; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
APIAccountPreference that = (APIAccountPreference) o; | ||
return allowedFileExtensions.equals(that.allowedFileExtensions); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(allowedFileExtensions); | ||
} | ||
} |
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