Servlet.java revision 6c48312a132cb29f83b7b1b6bc87db4d7901f88e
0N/A * The contents of this file are subject to the terms of the Common Development and 0N/A * Distribution License (the License). You may not use this file except in compliance with the 0N/A * specific language governing permission and limitations under the License. 0N/A * When distributing Covered Software, include this CDDL Header Notice in each file and include 0N/A * Header, with the fields enclosed by brackets [] replaced by your own identifying 0N/A * information: "Portions Copyrighted [year] [name of copyright owner]". 0N/A * Copyright © 2011 ForgeRock AS. All rights reserved. 0N/A// JSON Resource Restlet * Servlet to handle the REST interface. name =
"org.forgerock.openidm.restlet",
name =
"reference_Servlet_Restlet",
/** TODO: Description. */ /** TODO: Description. */ /** TODO: Description. */ /** TODO: Description. */ * Provides automatic binding of {@link Restlet} objects that include the * {@code openidm.restlet.path} property. if (
path !=
null &&
path instanceof String) {
// service is specified as internally routable if (
path !=
null &&
path instanceof String) {
// service is specified as internally routable * Provides automatic binding of {@code JsonResource} objects that include the * {@code openidm.restlet.path} property. name =
"reference_Servlet_JsonResource",
bind =
"bindJsonResource",
unbind =
"unbindJsonResource",
// Register script extensions configured name =
"reference_Servlet_ServletFilterRegistrator",
bind =
"bindRegistrator",
//All WebApplication elements must be registered with the same BundleContext // There must be at least the authInvoked param set to indicate that // the security filter has protected the call // If not passed in the principal, user name must be supplied in params // Invoke augment script if defined // Check security context fully populated logger.
warn(
"Rejecting invocation as required context to allow invocation not populated");
throw new RuntimeException(
"Rejecting invocation as required context to allow invocation not populated");
// Pass request and current security context to augmeet * Gets a single entry from attributes at the given key * For String, Number, Boolean value these are returned as is * For List or Set, the first entry is returned * For other types, null is returned * @param attributes the list of attributes * @param key the attribute key * @return the single entry, wrapped in JsonValue convenience wrapper logger.
warn(
"Expecting only one paramter in {} List parameter, passed {}",
return value.
get(
0);
// Returns null if list was empty // JsonValue doesn't contain convenience functions for Set yet logger.
warn(
"Expecting only one paramter in {} Set parameter, passed {}",
* Gets a List from attributes at the given key * For a value of type List, it is returned as is * For a value of type Set, it is converted and returned as List * @param attributes the list of attributes * @param key the attribute key * @return the List entry, wrapped in JsonValue convenience wrapper // JsonValue doesn't contain convenience functions for Set yet