Class TemplateRestResource
- java.lang.Object
-
- org.glassfish.admin.rest.resources.AbstractResource
-
- org.glassfish.admin.rest.resources.TemplateRestResource
-
- All Implemented Interfaces:
OptionsCapable
- Direct Known Subclasses:
GlassFishDomainResource
,PropertiesBagResource.PropertyResource
@Produces({"text/html","application/json","application/xml","application/x-www-form-urlencoded"}) @Consumes({"application/json","application/xml","application/x-www-form-urlencoded"}) public class TemplateRestResource extends AbstractResource implements OptionsCapable
- Author:
- Ludovic Champenois [email protected], Rajeshwar Patil
-
-
Field Summary
Fields Modifier and Type Field Description protected String
childID
protected ConfigModel
childModel
protected Dom
entity
static LocalStringManagerImpl
localStrings
protected Dom
parent
protected String
tagName
-
Fields inherited from class org.glassfish.admin.rest.resources.AbstractResource
locatorBridge, logger, requestHeaders, securityContext, serviceLocator, subjectRef, uriInfo
-
-
Constructor Summary
Constructors Constructor Description TemplateRestResource()
Creates a new instance of xxxResource
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ActionReportResult
buildActionReportResult(boolean showEntityValues)
static HashMap<String,String>
createDataBasedOnForm(org.glassfish.jersey.media.multipart.FormDataMultiPart formData)
allows for remote files to be put in a tmp area and we pass the local location of this file to the corresponding command instead of the content of the file * Yu need to add enctype="multipart/form-data" in the form for ex:jakarta.ws.rs.core.Response
createOrUpdateEntity(HashMap<String,String> data)
jakarta.ws.rs.core.Response
createOrUpdateEntityLegacyFormat(HashMap<String,String> data)
jakarta.ws.rs.core.Response
delete(Map<String,String> data)
protected RestActionReporter
doCreateOrUpdate(Map<String,String> data)
This method performs the creation or updating of an entity, regardless of the request's mime type.protected ActionReport.ExitCode
doDelete(Map<String,String> data)
protected String[][]
getCommandResourcesPaths()
protected String
getDeleteCommand()
Dom
getEntity()
Map<String,String>
getEntity(int expandLevel)
ActionReportResult
getEntityLegacyFormat(int expandLevel)
jakarta.ws.rs.core.UriInfo
getUriInfo()
protected jakarta.ws.rs.core.Response
handleError(jakarta.ws.rs.core.Response.Status error, String message)
RestResourceMetadata
options()
ActionReportResult
optionsLegacyFormat()
Object
post(org.glassfish.jersey.media.multipart.FormDataMultiPart formData)
Object
postLegacyFormat(org.glassfish.jersey.media.multipart.FormDataMultiPart formData)
allows for remote files to be put in a tmp area and we pass the local location of this file to the corresponding command instead of the content of the file * Yu need to add enctype="multipart/form-data" in the form for ex:<form action="http://localhost:4848/management/domain/applications/application" method="post" enctype="multipart/form-data">
then any param of type="file" will be uploaded, stored locally and the param will use the local location on the server side (ie.protected void
removeAttributesToBeSkipped(Map<String,String> data)
void
setBeanByKey(List<Dom> parentList, String id, String tag)
void
setEntity(Dom p)
void
setParentAndTagName(Dom parent, String tagName)
void
setUriInfo(jakarta.ws.rs.core.UriInfo uriInfo)
protected void
throwError(jakarta.ws.rs.core.Response.Status error, String message)
-
Methods inherited from class org.glassfish.admin.rest.resources.AbstractResource
getAuthenticatedUser, getSubject
-
-
-
-
Field Detail
-
entity
protected Dom entity
-
parent
protected Dom parent
-
tagName
protected String tagName
-
childModel
protected ConfigModel childModel
-
childID
protected String childID
-
localStrings
public static final LocalStringManagerImpl localStrings
-
-
Method Detail
-
getEntityLegacyFormat
@GET public ActionReportResult getEntityLegacyFormat(@QueryParam("expandLevel") @DefaultValue("1") int expandLevel)
-
getEntity
@GET @Produces("application/vnd.oracle.glassfish+json") public Map<String,String> getEntity(@QueryParam("expandLevel") @DefaultValue("1") int expandLevel)
-
createOrUpdateEntityLegacyFormat
@POST public jakarta.ws.rs.core.Response createOrUpdateEntityLegacyFormat(HashMap<String,String> data)
-
createOrUpdateEntity
@POST @Produces("application/vnd.oracle.glassfish+json") public jakarta.ws.rs.core.Response createOrUpdateEntity(HashMap<String,String> data)
-
postLegacyFormat
@POST @Consumes("multipart/form-data") public Object postLegacyFormat(org.glassfish.jersey.media.multipart.FormDataMultiPart formData)
allows for remote files to be put in a tmp area and we pass the local location of this file to the corresponding command instead of the content of the file * Yu need to add enctype="multipart/form-data" in the form for ex:<form action="http://localhost:4848/management/domain/applications/application" method="post" enctype="multipart/form-data">
then any param of type="file" will be uploaded, stored locally and the param will use the local location on the server side (ie. just the path)
-
post
@POST @Consumes("multipart/form-data") @Produces("application/vnd.oracle.glassfish+json") public Object post(org.glassfish.jersey.media.multipart.FormDataMultiPart formData)
-
optionsLegacyFormat
@OPTIONS @Produces("application/json") public ActionReportResult optionsLegacyFormat()
-
options
@OPTIONS @Produces("application/vnd.oracle.glassfish+json") public RestResourceMetadata options()
-
doCreateOrUpdate
protected RestActionReporter doCreateOrUpdate(Map<String,String> data)
This method performs the creation or updating of an entity, regardless of the request's mime type. If an error occurs, aWebApplicationException
is thrown, so if the method returns, the create/update was successful.- Parameters:
data
-- Returns:
-
doDelete
protected ActionReport.ExitCode doDelete(Map<String,String> data)
-
getUriInfo
public jakarta.ws.rs.core.UriInfo getUriInfo()
- Specified by:
getUriInfo
in interfaceOptionsCapable
-
setUriInfo
public void setUriInfo(jakarta.ws.rs.core.UriInfo uriInfo)
- Specified by:
setUriInfo
in interfaceOptionsCapable
-
setEntity
public void setEntity(Dom p)
-
getEntity
public Dom getEntity()
-
createDataBasedOnForm
public static HashMap<String,String> createDataBasedOnForm(org.glassfish.jersey.media.multipart.FormDataMultiPart formData)
allows for remote files to be put in a tmp area and we pass the local location of this file to the corresponding command instead of the content of the file * Yu need to add enctype="multipart/form-data" in the form for ex:
-
buildActionReportResult
protected ActionReportResult buildActionReportResult(boolean showEntityValues)
-
getCommandResourcesPaths
protected String[][] getCommandResourcesPaths()
-
getDeleteCommand
protected String getDeleteCommand()
-
throwError
protected void throwError(jakarta.ws.rs.core.Response.Status error, String message) throws jakarta.ws.rs.WebApplicationException
- Throws:
jakarta.ws.rs.WebApplicationException
-
handleError
protected jakarta.ws.rs.core.Response handleError(jakarta.ws.rs.core.Response.Status error, String message) throws jakarta.ws.rs.WebApplicationException
- Throws:
jakarta.ws.rs.WebApplicationException
-
-