1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.apache.amber.oauth2.ext.dynamicreg.server.request;
23
24 import javax.servlet.http.HttpServletRequest;
25
26 import org.apache.amber.oauth2.common.exception.OAuthSystemException;
27 import org.apache.amber.oauth2.common.validators.OAuthValidator;
28 import org.apache.amber.oauth2.ext.dynamicreg.common.OAuthRegistration;
29 import org.apache.amber.oauth2.as.request.OAuthRequest;
30 import org.apache.amber.oauth2.common.exception.OAuthProblemException;
31 import org.apache.amber.oauth2.ext.dynamicreg.server.validator.PushPullValidator;
32
33
34
35
36
37
38
39 public class OAuthServerRegistrationRequest extends OAuthRequest {
40
41 private String type;
42
43 private boolean isDiscovered;
44
45 public OAuthServerRegistrationRequest(JSONHttpServletRequestWrapper request)
46 throws OAuthSystemException, OAuthProblemException {
47 this(request, false);
48 }
49
50 public OAuthServerRegistrationRequest(JSONHttpServletRequestWrapper request, boolean discover)
51 throws OAuthSystemException, OAuthProblemException {
52 super(request);
53 if (discover) {
54 discover();
55 }
56 }
57
58 @Override
59 protected OAuthValidator initValidator() throws OAuthProblemException, OAuthSystemException {
60 return new PushPullValidator();
61 }
62
63 public void discover() throws OAuthSystemException {
64 if (OAuthRegistration.Type.PULL.equals(type)) {
65
66 }
67 isDiscovered = true;
68 }
69
70 public String getType() {
71 return getParam(OAuthRegistration.Request.TYPE);
72 }
73
74 public String getClientName() {
75 return getParam(OAuthRegistration.Request.CLIENT_NAME);
76 }
77
78 public String getClientUrl() {
79 return getParam(OAuthRegistration.Request.CLIENT_URL);
80 }
81
82 public String getClientDescription() {
83 return getParam(OAuthRegistration.Request.CLIENT_DESCRIPTION);
84 }
85
86 public String getClientIcon() {
87 return getParam(OAuthRegistration.Request.CLIENT_ICON);
88 }
89
90 public String getRedirectURI() {
91 return getParam(OAuthRegistration.Request.REDIRECT_URL);
92 }
93
94 public boolean isDiscovered() {
95 return isDiscovered;
96 }
97
98 }