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
Showing
130 changed files
with
4,880 additions
and
2,307 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
|
||
/** | ||
* Web server initialization. | ||
* | ||
*/ | ||
@EnableScheduling | ||
@SpringBootApplication | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package edu.tamu.app.cache; | ||
|
||
public abstract class AbstractCache<T> implements Cache<T> { | ||
|
||
private T cache; | ||
|
||
public synchronized T get() { | ||
return cache; | ||
} | ||
|
||
public synchronized void set(T cache) { | ||
this.cache = cache; | ||
} | ||
|
||
} |
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,14 @@ | ||
package edu.tamu.app.cache; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import edu.tamu.app.cache.model.Sprint; | ||
|
||
public class ActiveSprintsCache extends AbstractCache<List<Sprint>> { | ||
|
||
public ActiveSprintsCache() { | ||
set(new ArrayList<Sprint>()); | ||
} | ||
|
||
} |
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,9 @@ | ||
package edu.tamu.app.cache; | ||
|
||
public interface Cache<T> { | ||
|
||
public T get(); | ||
|
||
public void set(T cache); | ||
|
||
} |
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,15 @@ | ||
package edu.tamu.app.cache; | ||
|
||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import edu.tamu.app.cache.model.RemoteProject; | ||
|
||
public class RemoteProjectsCache extends AbstractCache<Map<Long, List<RemoteProject>>> { | ||
|
||
public RemoteProjectsCache() { | ||
set(new HashMap<Long, List<RemoteProject>>()); | ||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/edu/tamu/app/cache/controller/AbstractCacheController.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,31 @@ | ||
package edu.tamu.app.cache.controller; | ||
|
||
import static edu.tamu.weaver.response.ApiStatus.SUCCESS; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.security.access.prepost.PreAuthorize; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
|
||
import edu.tamu.app.cache.service.AbstractScheduledCacheService; | ||
import edu.tamu.weaver.response.ApiResponse; | ||
|
||
public abstract class AbstractCacheController<S extends AbstractScheduledCacheService<?, ?>> implements CacheController { | ||
|
||
@Autowired | ||
private S cacheService; | ||
|
||
@GetMapping | ||
@PreAuthorize("hasRole('ANONYMOUS')") | ||
public ApiResponse get() { | ||
return new ApiResponse(SUCCESS, cacheService.get()); | ||
} | ||
|
||
@GetMapping("/update") | ||
@PreAuthorize("hasRole('MANAGER')") | ||
public ApiResponse update() { | ||
cacheService.update(); | ||
cacheService.broadcast(); | ||
return new ApiResponse(SUCCESS); | ||
} | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/edu/tamu/app/cache/controller/ActiveSprintsCacheController.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,12 @@ | ||
package edu.tamu.app.cache.controller; | ||
|
||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import edu.tamu.app.cache.service.ActiveSprintsScheduledCacheService; | ||
|
||
@RestController | ||
@RequestMapping("/active-sprints") | ||
public class ActiveSprintsCacheController extends AbstractCacheController<ActiveSprintsScheduledCacheService> { | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/edu/tamu/app/cache/controller/CacheController.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,11 @@ | ||
package edu.tamu.app.cache.controller; | ||
|
||
import edu.tamu.weaver.response.ApiResponse; | ||
|
||
public interface CacheController { | ||
|
||
public ApiResponse get(); | ||
|
||
public ApiResponse update(); | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/edu/tamu/app/cache/controller/RemoteProjectsCacheController.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,12 @@ | ||
package edu.tamu.app.cache.controller; | ||
|
||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import edu.tamu.app.cache.service.RemoteProjectsScheduledCacheService; | ||
|
||
@RestController | ||
@RequestMapping("/remote-projects") | ||
public class RemoteProjectsCacheController extends AbstractCacheController<RemoteProjectsScheduledCacheService> { | ||
|
||
} |
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,88 @@ | ||
package edu.tamu.app.cache.model; | ||
|
||
import java.io.Serializable; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonInclude.Include; | ||
|
||
public class Card implements Serializable { | ||
|
||
private static final long serialVersionUID = 5692495387386239114L; | ||
|
||
private final String id; | ||
|
||
private final String number; | ||
|
||
private final String type; | ||
|
||
private final String status; | ||
|
||
private final String name; | ||
|
||
@JsonInclude(Include.NON_NULL) | ||
private final String description; | ||
|
||
@JsonInclude(Include.NON_NULL) | ||
private final Float estimate; | ||
|
||
private final List<Member> assignees; | ||
|
||
public Card() { | ||
super(); | ||
this.id = ""; | ||
this.number = ""; | ||
this.type = ""; | ||
this.name = ""; | ||
this.description = ""; | ||
this.status = ""; | ||
this.estimate = null; | ||
this.assignees = new ArrayList<Member>(); | ||
} | ||
|
||
public Card(String id, String number, String type, String name, String description, String status, Float estimate, List<Member> assignees) { | ||
super(); | ||
this.id = id; | ||
this.number = number; | ||
this.type = type; | ||
this.name = name; | ||
this.description = description; | ||
this.status = status; | ||
this.estimate = estimate; | ||
this.assignees = assignees; | ||
} | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public String getNumber() { | ||
return number; | ||
} | ||
|
||
public String getType() { | ||
return type; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public String getStatus() { | ||
return status; | ||
} | ||
|
||
public Float getEstimate() { | ||
return estimate; | ||
} | ||
|
||
public List<Member> getAssignees() { | ||
return assignees; | ||
} | ||
|
||
} |
Oops, something went wrong.