-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathLtiLaunch.java
More file actions
107 lines (85 loc) · 3.43 KB
/
LtiLaunch.java
File metadata and controls
107 lines (85 loc) · 3.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package org.imsglobal.lti.launch;
import javax.servlet.http.HttpServletRequest;
import java.util.Collection;
import java.util.Map;
/**
* Created by paul on 5/28/14.
*/
public class LtiLaunch {
private LtiUser user;
private String version;
private String messageType;
private String resourceLinkId;
private String contextId;
private String launchPresentationReturnUrl;
private String toolConsumerInstanceGuid;
public LtiLaunch(HttpServletRequest request) {
this.user = new LtiUser(request);
this.version = request.getParameter("lti_version");
this.messageType = request.getParameter("lti_message_type");
this.resourceLinkId = request.getParameter("resource_link_id");
this.contextId = request.getParameter("context_id");
this.launchPresentationReturnUrl = request.getParameter("launch_presentation_return_url");
this.toolConsumerInstanceGuid = request.getParameter("tool_consumer_instance_guid");
}
public LtiLaunch(Map<String, String> parameters) {
this.user = new LtiUser(parameters);
this.version = parameters.get("lti_version");
this.messageType = parameters.get("lti_message_type");
this.resourceLinkId = parameters.get("resource_link_id");
this.contextId = parameters.get("context_id");
this.launchPresentationReturnUrl = parameters.get("launch_presentation_return_url");
this.toolConsumerInstanceGuid = parameters.get("tool_consumer_instance_guid");
}
public LtiLaunch(Collection<? extends Map.Entry> parameters) {
this.user = new LtiUser(parameters);
this.version = LtiOauthVerifier.getKey(parameters, "lti_version");
this.messageType = LtiOauthVerifier.getKey(parameters, "lti_message_type");
this.resourceLinkId = LtiOauthVerifier.getKey(parameters, "resource_link_id");
this.contextId = LtiOauthVerifier.getKey(parameters, "context_id");
this.launchPresentationReturnUrl = LtiOauthVerifier.getKey(parameters, "launch_presentation_return_url");
this.toolConsumerInstanceGuid = LtiOauthVerifier.getKey(parameters, "tool_consumer_instance_guid");
}
public LtiUser getUser() {
return user;
}
public void setUser(LtiUser user) {
this.user = user;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public String getMessageType() {
return messageType;
}
public void setMessageType(String messageType) {
this.messageType = messageType;
}
public String getResourceLinkId() {
return resourceLinkId;
}
public void setResourceLinkId(String resourceLinkId) {
this.resourceLinkId = resourceLinkId;
}
public String getContextId() {
return contextId;
}
public void setContextId(String contextId) {
this.contextId = contextId;
}
public String getLaunchPresentationReturnUrl() {
return launchPresentationReturnUrl;
}
public void setLaunchPresentationReturnUrl(String launchPresentationReturnUrl) {
this.launchPresentationReturnUrl = launchPresentationReturnUrl;
}
public String getToolConsumerInstanceGuid() {
return toolConsumerInstanceGuid;
}
public void setToolConsumerInstanceGuid(String toolConsumerInstanceGuid) {
this.toolConsumerInstanceGuid = toolConsumerInstanceGuid;
}
}