forked from sakaiproject/sakai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KNL-1336 Do a redirect to a different server.
Rather than just removing the cookie we now have the option to pick another server at random in the cluster. We also now use ENUMs in the DB.
- Loading branch information
Showing
13 changed files
with
174 additions
and
34 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
28 changes: 28 additions & 0 deletions
28
kernel/api/src/main/java/org/sakaiproject/cluster/api/ClusterNode.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,28 @@ | ||
package org.sakaiproject.cluster.api; | ||
|
||
import java.util.Date; | ||
|
||
/** | ||
* This holds information about a node in the cluster. | ||
*/ | ||
public interface ClusterNode { | ||
|
||
/** | ||
* Gets the status of a node. | ||
* @return The current node status, or {@link org.sakaiproject.cluster.api.ClusterService.Status#UNKNOWN} | ||
* if the status isn't known. | ||
*/ | ||
ClusterService.Status getStatus(); | ||
|
||
/** | ||
* Gets the server ID of a node. | ||
* @return The server ID. | ||
*/ | ||
String getServerId(); | ||
|
||
/** | ||
* Gets when the status of the node was last updated. | ||
* @return The date when the status of the node was last updated. | ||
*/ | ||
Date getUpdated(); | ||
} |
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
38 changes: 38 additions & 0 deletions
38
kernel/kernel-impl/src/main/java/org/sakaiproject/cluster/impl/ClusterNodeImpl.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,38 @@ | ||
package org.sakaiproject.cluster.impl; | ||
|
||
import org.sakaiproject.cluster.api.ClusterNode; | ||
import org.sakaiproject.cluster.api.ClusterService; | ||
|
||
import java.util.Date; | ||
|
||
/** | ||
* Simple immutable implementation of ClusterNode. | ||
*/ | ||
public class ClusterNodeImpl implements ClusterNode { | ||
|
||
private final String serverId; | ||
private final ClusterService.Status status; | ||
private final Date updated; | ||
|
||
|
||
public ClusterNodeImpl(String serverId, ClusterService.Status status, Date updated) { | ||
this.serverId = serverId; | ||
this.status = status; | ||
this.updated = updated; | ||
} | ||
|
||
@Override | ||
public ClusterService.Status getStatus() { | ||
return status; | ||
} | ||
|
||
@Override | ||
public String getServerId() { | ||
return serverId; | ||
} | ||
|
||
@Override | ||
public Date getUpdated() { | ||
return updated; | ||
} | ||
} |
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
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
Oops, something went wrong.