RequestFactory.java revision 80849398a45dca1fb917716907d6ec99be6222c2
/*
* DO NOT REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2012 ForgeRock Inc. All rights reserved.
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* ""Portions Copyrighted [2012] [ForgeRock Inc]""
*/
/**
* Creates a request
*
*/
public class RequestFactory {
protected Form parameters;
try {
}
Constructor<T> constructor =
} catch (Exception e) {
// Should never happen.
throw new UndeclaredThrowableException(e);
}
}
parameters = new Form();
}
public Reference getEndpoint() {
return endpoint;
}
protected static abstract class TokenRequestFactory extends RequestFactory {
super(endpoint);
}
.getWebRepresentation());
if (null != challengeResponse) {
}
return request;
}
}
}
protected static abstract class AuthorizationRequestFactory extends RequestFactory {
super(endpoint);
}
return request;
}
}
}
public Request buildRequest() {
}
}
public Form getParameters() {
return parameters;
}
if (null != parameterSeries) {
continue;
}
}
}
}
} else {
}
}
}
return scope;
}
// Do nothing
} else {
.getScopeDelimiter(context)));
}
return parameters;
}
//
public class AuthorizationCodeRequest extends AuthorizationRequestFactory {
super(endpoint);
}
return this;
}
return this;
}
return this;
}
return this;
}
}
public class ImplicitRequest extends AuthorizationRequestFactory {
super(endpoint);
}
return this;
}
return this;
}
return this;
}
return this;
}
}
//
public class AuthorizationTokenRequest extends TokenRequestFactory {
super(endpoint);
}
this.challengeResponse = challengeResponse;
return this;
}
return this;
}
return this;
}
return this;
}
return this;
}
}
public class PasswordRequest extends TokenRequestFactory {
super(endpoint);
}
this.challengeResponse = challengeResponse;
return this;
}
return this;
}
return this;
}
return this;
}
}
public class ClientCredentialsRequest extends TokenRequestFactory {
super(endpoint);
}
this.challengeResponse = challengeResponse;
return this;
}
return this;
}
return this;
}
}
public class RefreshTokenRequest extends TokenRequestFactory {
super(endpoint);
}
this.challengeResponse = challengeResponse;
return this;
}
return this;
}
return this;
}
return this;
}
}
public class SAML20AssertionRequest extends TokenRequestFactory {
super(endpoint);
}
return this;
}
return this;
}
return this;
}
}
}