UmaUrisFactory.java revision 3a9e5adf8ed71f7841c483df0173964166267d9b
/*
* 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 legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2015-2016 ForgeRock AS.
*/
/**
* <p>A factory for creating/retrieving UmaUris instances.</p>
*
* @since 13.0.0
*/
public class UmaUrisFactory {
private final UmaProviderSettingsFactory umaProviderSettingsFactory;
private final BaseURLProviderFactory baseURLProviderFactory;
private final JacksonRepresentationFactory jacksonRepresentationFactory;
/**
* Constructs a new UmaUrisFactory.
*
* @param oAuth2UriFactory An instance of the OAuth2UrisFactory.
* @param umaProviderSettingsFactory An instance of the UmaProviderSettingsFactory.
* @param baseURLProviderFactory An instance of the BaseURLProviderFactory.
*/
UmaUrisFactory(OAuth2UrisFactory<RealmInfo> oAuth2UriFactory, UmaProviderSettingsFactory umaProviderSettingsFactory,
BaseURLProviderFactory baseURLProviderFactory, JacksonRepresentationFactory jacksonRepresentationFactory) {
this.oAuth2UriFactory = oAuth2UriFactory;
}
/**
* Gets a UmaUris instance.
*
* @param req The Restlet request.
* @return A UmaProviderSettings instance.
*/
}
}
/**
* <p>Gets the instance of the UmaUris.</p>
*
* <p>Cache each provider settings on the realm it was created for.</p>
*
* @param request The request instance from which the base URL can be deduced.
* @param realmInfo The realm.
* @return The OAuth2ProviderSettings instance.
*/
public UmaUris get(HttpServletRequest request, RealmInfo realmInfo) throws NotFoundException, ServerException {
try {
} catch (InvalidBaseUrlException e) {
throw new ServerException("Configuration error");
}
}
return uris;
}
/**
* <p>Gets the instance of the UmaProviderSettings.</p>
*
* <p>Cache each provider settings on the realm it was created for.</p>
*
* @param context The context instance from which the base URL can be deduced.
* @param realmInfo The realm.
* @return The OAuth2ProviderSettings instance.
*/
public UmaUris get(Context context, RealmInfo realmInfo) throws NotFoundException, ServerException {
try {
baseUrl = baseURLProviderFactory.get(absoluteRealm).getRealmURL(httpContext, "/uma", absoluteRealm);
} catch (InvalidBaseUrlException e) {
throw new ServerException("Configuration error");
}
}
return uris;
}
private UmaUris get(String absoluteRealm, OAuth2Uris oAuth2Uris, String baseUrlPattern) throws NotFoundException {
}
return uris;
}
private synchronized UmaUris getUmaUris(String absoluteRealm, OAuth2Uris oAuth2Uris, String baseUrlPattern)
throws NotFoundException {
return uris;
}
return providerSettings;
}
static final class UmaUrisImpl implements UmaUris {
private final UmaProviderSettings umaProviderSettings;
private final OAuth2Uris oauth2Uris;
this.oauth2Uris = oauth2Uris;
this.baseUrl = deploymentUrl;
}
public boolean isEnabled() {
return umaProviderSettings.isEnabled();
}
}
public URI getTokenEndpoint() {
}
public URI getAuthorizationEndpoint() {
}
public URI getTokenIntrospectionEndpoint() {
}
public URI getResourceSetRegistrationEndpoint() {
}
public URI getPermissionRegistrationEndpoint() {
}
public URI getRPTEndpoint() {
}
public URI getDynamicClientEndpoint() {
}
/**
* OpenAM currently does not support requesting party claims so no endpoint isEnabled.
*
* @return {@code null}.
*/
public URI getRequestingPartyClaimsEndpoint() {
return null;
}
}
}