|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.admin.rest.ResourceUtil
public class ResourceUtil
Resource utilities class. Used by resource templates,
TemplateListOfResource and TemplateRestResource
| Method Summary | |
|---|---|
static void |
addMethodMetaData(ActionReport ar,
java.util.Map<java.lang.String,MethodMetaData> mmd)
|
static void |
addQueryString(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> qs,
java.util.Map<java.lang.String,java.lang.String> data)
This method takes any query string parameters and adds them to the specified map. |
static void |
addQueryString(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> qs,
java.util.Properties data)
|
static void |
adjustParameters(java.util.Map<java.lang.String,java.lang.String> data)
Adjust the input parameters. |
static AdminAccessController.Access |
authenticateViaAdminRealm(org.jvnet.hk2.component.Habitat habitat,
com.sun.grizzly.tcp.http11.GrizzlyRequest req)
Authenticate the given req against admin realm. |
static AdminAccessController.Access |
authenticateViaAdminRealm(org.jvnet.hk2.component.Habitat habitat,
com.sun.grizzly.tcp.http11.GrizzlyRequest req,
java.lang.String remoteHost)
Authenticate the given req as originated from given remoteHost against admin realm. |
static java.util.Map |
buildMethodMetadataMap(MethodMetaData mmd)
|
static boolean |
canShowDeprecatedItems(org.jvnet.hk2.component.Habitat habitat)
|
static boolean |
commandIsPresent(org.jvnet.hk2.component.Habitat habitat,
java.lang.String commandName)
|
static java.lang.String |
convertToXMLName(java.lang.String name)
|
protected static void |
copyParameterMetaDataAttribute(ParameterMetaData from,
ParameterMetaData to,
java.lang.String key)
|
static void |
defineDefaultParameters(java.util.Map<java.lang.String,java.lang.String> data)
Adjust the input parameters. |
static ActionReportResult |
getActionReportResult(ActionReport.ExitCode status,
java.lang.String message,
javax.ws.rs.core.HttpHeaders requestHeaders,
javax.ws.rs.core.UriInfo uriInfo)
|
static ActionReportResult |
getActionReportResult(ActionReport parentActionReport,
java.lang.String message,
javax.ws.rs.core.HttpHeaders requestHeaders,
javax.ws.rs.core.UriInfo uriInfo)
|
static java.lang.String |
getCommand(RestRedirect.OpType type,
org.jvnet.hk2.config.ConfigModel model)
Returns the name of the command associated with this resource,if any, for the given operation. |
static java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
getCommandLinks(java.lang.String[][] commandResourcesPaths)
|
static javax.ws.rs.core.Response |
getDeleteResponse(int status,
java.lang.String message,
javax.ws.rs.core.HttpHeaders requestHeaders,
javax.ws.rs.core.UriInfo uriInfo,
org.jvnet.hk2.component.Habitat habitat)
special case for the delete operation: we need to give back the URI of the parent since the resource we are on is deleted |
protected static void |
getInterfaces(java.lang.Class<?> clazz,
java.util.List<java.lang.Class<?>> interfaces)
|
static MethodMetaData |
getMethodMetaData(org.jvnet.hk2.config.ConfigModel configBeanModel)
Constructs and returns the resource method meta-data. |
static MethodMetaData |
getMethodMetaData(java.lang.String command,
org.jvnet.hk2.component.Habitat habitat,
java.util.logging.Logger logger)
Constructs and returns the resource method meta-data. |
static MethodMetaData |
getMethodMetaData(java.lang.String command,
java.util.HashMap<java.lang.String,java.lang.String> commandParamsToSkip,
org.jvnet.hk2.component.Habitat habitat,
java.util.logging.Logger logger)
Constructs and returns the resource method meta-data. |
static MethodMetaData |
getMethodMetaData2(org.jvnet.hk2.config.Dom parent,
org.jvnet.hk2.config.ConfigModel childModel,
int parameterType)
|
static java.util.Collection<CommandModel.ParamModel> |
getParamMetaData(java.lang.String commandName,
java.util.Collection<java.lang.String> commandParamsToSkip,
org.jvnet.hk2.component.Habitat habitat,
java.util.logging.Logger logger)
Constructs and returns the parameter meta-data. |
static java.util.Collection<CommandModel.ParamModel> |
getParamMetaData(java.lang.String commandName,
org.jvnet.hk2.component.Habitat habitat,
java.util.logging.Logger logger)
Constructs and returns the parameter meta-data. |
static java.util.List<org.jvnet.hk2.config.ConfigModel> |
getRealChildConfigModels(org.jvnet.hk2.config.ConfigModel childModel,
org.jvnet.hk2.config.DomDocument domDocument)
|
static java.util.Map<java.lang.String,java.lang.String> |
getResourceLinks(org.jvnet.hk2.config.Dom dom,
javax.ws.rs.core.UriInfo uriInfo,
boolean canShowDeprecated)
|
static java.util.Map<java.lang.String,java.lang.String> |
getResourceLinks(java.util.List<org.jvnet.hk2.config.Dom> proxyList,
javax.ws.rs.core.UriInfo uriInfo)
|
static javax.ws.rs.core.Response |
getResponse(int status,
java.lang.String message,
javax.ws.rs.core.HttpHeaders requestHeaders,
javax.ws.rs.core.UriInfo uriInfo)
Constructs and returns the appropriate response object based on the client. |
static RestConfig |
getRestConfig(org.jvnet.hk2.component.Habitat habitat)
|
static java.lang.String |
getResultType(javax.ws.rs.core.HttpHeaders requestHeaders)
|
static java.lang.String |
getUnqualifiedTypeName(java.lang.String qualifiedTypeName)
|
static boolean |
isDeprecated(org.jvnet.hk2.config.ConfigModel model)
|
static boolean |
isOnlyATag(org.jvnet.hk2.config.ConfigModel model)
|
static void |
purgeEmptyEntries(java.util.Map<java.lang.String,java.lang.String> data)
|
static void |
resolveParentParamValue(java.util.HashMap<java.lang.String,java.lang.String> commandParams,
javax.ws.rs.core.UriInfo uriInfo)
Resolve command parameter value of $parent for the parameter in the given map. |
static RestActionReporter |
runCommand(java.lang.String commandName,
java.util.Map<java.lang.String,java.lang.String> parameters,
org.jvnet.hk2.component.Habitat habitat,
java.lang.String resultType)
Executes the specified __asadmin command. |
static RestActionReporter |
runCommand(java.lang.String commandName,
ParameterMap parameters,
org.jvnet.hk2.component.Habitat habitat,
java.lang.String resultType)
|
static java.util.HashMap<java.lang.String,java.lang.String> |
translateCamelCasedNamesToXMLNames(java.util.Map<java.lang.String,java.lang.String> sourceData)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void adjustParameters(java.util.Map<java.lang.String,java.lang.String> data)
public static void defineDefaultParameters(java.util.Map<java.lang.String,java.lang.String> data)
public static java.lang.String getCommand(RestRedirect.OpType type,
org.jvnet.hk2.config.ConfigModel model)
type - the given resource operation
public static RestActionReporter runCommand(java.lang.String commandName,
java.util.Map<java.lang.String,java.lang.String> parameters,
org.jvnet.hk2.component.Habitat habitat,
java.lang.String resultType)
commandName - the command to executeparameters - the command parametershabitat - the habitat
public static RestActionReporter runCommand(java.lang.String commandName,
ParameterMap parameters,
org.jvnet.hk2.component.Habitat habitat,
java.lang.String resultType)
public static MethodMetaData getMethodMetaData(java.lang.String command,
org.jvnet.hk2.component.Habitat habitat,
java.util.logging.Logger logger)
command - the command associated with the resource methodhabitat - the habitatlogger - the logger to use
public static MethodMetaData getMethodMetaData(java.lang.String command,
java.util.HashMap<java.lang.String,java.lang.String> commandParamsToSkip,
org.jvnet.hk2.component.Habitat habitat,
java.util.logging.Logger logger)
command - the command assocaited with the resource methodcommandParamsToSkip - the command parameters for which not to
include the meta-data.habitat - the habitatlogger - the logger to use
public static void resolveParentParamValue(java.util.HashMap<java.lang.String,java.lang.String> commandParams,
javax.ws.rs.core.UriInfo uriInfo)
uriInfo - the uri context to extract parent name value.public static MethodMetaData getMethodMetaData(org.jvnet.hk2.config.ConfigModel configBeanModel)
configBeanModel - the config bean associated with the resource.
public static MethodMetaData getMethodMetaData2(org.jvnet.hk2.config.Dom parent,
org.jvnet.hk2.config.ConfigModel childModel,
int parameterType)
protected static void copyParameterMetaDataAttribute(ParameterMetaData from,
ParameterMetaData to,
java.lang.String key)
protected static void getInterfaces(java.lang.Class<?> clazz,
java.util.List<java.lang.Class<?>> interfaces)
public static boolean commandIsPresent(org.jvnet.hk2.component.Habitat habitat,
java.lang.String commandName)
public static java.util.Collection<CommandModel.ParamModel> getParamMetaData(java.lang.String commandName,
org.jvnet.hk2.component.Habitat habitat,
java.util.logging.Logger logger)
commandName - the command associated with the resource methodhabitat - the habitatlogger - the logger to use
public static java.util.Collection<CommandModel.ParamModel> getParamMetaData(java.lang.String commandName,
java.util.Collection<java.lang.String> commandParamsToSkip,
org.jvnet.hk2.component.Habitat habitat,
java.util.logging.Logger logger)
commandName - the command associated with the resource methodcommandParamsToSkip - the command parameters for which not to
include the meta-data.habitat - the habitatlogger - the logger to use
public static void purgeEmptyEntries(java.util.Map<java.lang.String,java.lang.String> data)
public static javax.ws.rs.core.Response getResponse(int status,
java.lang.String message,
javax.ws.rs.core.HttpHeaders requestHeaders,
javax.ws.rs.core.UriInfo uriInfo)
status - the http status code for the responsemessage - message for the responserequestHeaders - request headers of the request
public static ActionReportResult getActionReportResult(ActionReport parentActionReport,
java.lang.String message,
javax.ws.rs.core.HttpHeaders requestHeaders,
javax.ws.rs.core.UriInfo uriInfo)
public static ActionReportResult getActionReportResult(ActionReport.ExitCode status,
java.lang.String message,
javax.ws.rs.core.HttpHeaders requestHeaders,
javax.ws.rs.core.UriInfo uriInfo)
public static javax.ws.rs.core.Response getDeleteResponse(int status,
java.lang.String message,
javax.ws.rs.core.HttpHeaders requestHeaders,
javax.ws.rs.core.UriInfo uriInfo,
org.jvnet.hk2.component.Habitat habitat)
status - message - requestHeaders - uriInfo -
public static void addQueryString(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> qs,
java.util.Map<java.lang.String,java.lang.String> data)
This method takes any query string parameters and adds them to the specified map. This is used, for example, with the delete operation when cascading deletes are required:
DELETE http://localhost:4848/.../foo?cascade=true
The reason we need to use query parameters versus "body" variables is the limitation that HttpURLConnection has in this regard.
data -
public static void addQueryString(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> qs,
java.util.Properties data)
public static java.lang.String convertToXMLName(java.lang.String name)
public static java.util.HashMap<java.lang.String,java.lang.String> translateCamelCasedNamesToXMLNames(java.util.Map<java.lang.String,java.lang.String> sourceData)
sourceData where key of each entry from it is converted to xml namepublic static java.lang.String getResultType(javax.ws.rs.core.HttpHeaders requestHeaders)
public static java.util.Map buildMethodMetadataMap(MethodMetaData mmd)
public static boolean isDeprecated(org.jvnet.hk2.config.ConfigModel model)
public static java.util.Map<java.lang.String,java.lang.String> getResourceLinks(org.jvnet.hk2.config.Dom dom,
javax.ws.rs.core.UriInfo uriInfo,
boolean canShowDeprecated)
public static java.lang.String getUnqualifiedTypeName(java.lang.String qualifiedTypeName)
qualifiedTypeName -
public static boolean isOnlyATag(org.jvnet.hk2.config.ConfigModel model)
public static java.util.List<org.jvnet.hk2.config.ConfigModel> getRealChildConfigModels(org.jvnet.hk2.config.ConfigModel childModel,
org.jvnet.hk2.config.DomDocument domDocument)
public static java.util.Map<java.lang.String,java.lang.String> getResourceLinks(java.util.List<org.jvnet.hk2.config.Dom> proxyList,
javax.ws.rs.core.UriInfo uriInfo)
public static java.util.List<java.util.Map<java.lang.String,java.lang.String>> getCommandLinks(java.lang.String[][] commandResourcesPaths)
public static void addMethodMetaData(ActionReport ar,
java.util.Map<java.lang.String,MethodMetaData> mmd)
public static RestConfig getRestConfig(org.jvnet.hk2.component.Habitat habitat)
public static boolean canShowDeprecatedItems(org.jvnet.hk2.component.Habitat habitat)
public static AdminAccessController.Access authenticateViaAdminRealm(org.jvnet.hk2.component.Habitat habitat,
com.sun.grizzly.tcp.http11.GrizzlyRequest req)
throws javax.security.auth.login.LoginException,
java.io.IOException
javax.security.auth.login.LoginException
java.io.IOException
public static AdminAccessController.Access authenticateViaAdminRealm(org.jvnet.hk2.component.Habitat habitat,
com.sun.grizzly.tcp.http11.GrizzlyRequest req,
java.lang.String remoteHost)
throws java.io.IOException,
javax.security.auth.login.LoginException
java.io.IOException
javax.security.auth.login.LoginException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||