Package fish.payara.admin.rest.resources
Class AbstractAttributeBagResource
- java.lang.Object
-
- org.glassfish.admin.rest.resources.AbstractResource
-
- fish.payara.admin.rest.resources.AbstractAttributeBagResource
-
- Direct Known Subclasses:
MonitoredAttributeBagResource
,MonitoredMetricAttributeBagResource
public abstract class AbstractAttributeBagResource extends AbstractResource
Resource for managing monitored attributes. Supports GET, POST, PUT and DELETE commands.
-
-
Field Summary
Fields Modifier and Type Field Description protected List<Dom>
entity
A list of attributes in the service.static LocalStringManagerImpl
LOCAL_STRINGS
protected Dom
parent
The service containing the attributes.protected String
tagName
The getPropertiesName of the element the attributes are stored under.-
Fields inherited from class org.glassfish.admin.rest.resources.AbstractResource
locatorBridge, logger, requestHeaders, securityContext, serviceLocator, subjectRef, uriInfo
-
-
Constructor Summary
Constructors Constructor Description AbstractAttributeBagResource()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
attributesAreEqual(Map<String,String> attribute1, Map<String,String> attribute2)
ActionReportResult
delete()
Deletes all attributes.abstract void
excuteSetCommand(List<Map<String,String>> attributesToAdd, List<Map<String,String>> attributesToDelete)
ActionReportResult
get()
Gets the attributes.abstract List<Map<String,String>>
getAllAttributes()
Gets all of the attributes in the entity.abstract String
getDescriptionName()
abstract String
getnodeElementName()
abstract String
getPropertiesName()
ActionReportResult
post(List<Map<String,String>> attributes)
Creates new attributes.ActionReportResult
put(List<Map<String,String>> attributes)
Creates new attributes.void
setAttributes(List<Map<String,String>> attributes)
Sets the attribute list to the specified list.void
setParentAndTagName(Dom parent, String tagName)
Sets the parent and the tag getPropertiesName of the resource.-
Methods inherited from class org.glassfish.admin.rest.resources.AbstractResource
getAuthenticatedUser, getSubject
-
-
-
-
Field Detail
-
LOCAL_STRINGS
public static final LocalStringManagerImpl LOCAL_STRINGS
-
parent
protected Dom parent
The service containing the attributes.
-
tagName
protected String tagName
The getPropertiesName of the element the attributes are stored under.
-
-
Method Detail
-
getDescriptionName
public abstract String getDescriptionName()
-
getPropertiesName
public abstract String getPropertiesName()
-
getnodeElementName
public abstract String getnodeElementName()
-
getAllAttributes
public abstract List<Map<String,String>> getAllAttributes()
Gets all of the attributes in the entity.- Returns:
- a list of the attributes
-
get
@GET @Produces({"text/html","application/json","application/xml"}) public ActionReportResult get()
Gets the attributes.- Returns:
- a list of the attributes after the transaction.
-
put
@PUT @Consumes({"application/json","application/xml","application/x-www-form-urlencoded"}) @Produces({"text/html","application/json","application/xml"}) public ActionReportResult put(List<Map<String,String>> attributes)
Creates new attributes. This method deletes all of the existing attributes.- Parameters:
attributes
- the list of attributes to be created.- Returns:
- a list of the attributes after the transaction.
-
post
@POST @Consumes({"application/json","application/xml","application/x-www-form-urlencoded"}) @Produces({"text/html","application/json","application/xml"}) public ActionReportResult post(List<Map<String,String>> attributes)
Creates new attributes. Existing attributes will be ignored, and others will be created.- Parameters:
attributes
- the list of attributes to be created.- Returns:
- a list of the attributes after the transaction.
-
delete
@DELETE @Produces({"text/html","application/json","application/xml"}) public ActionReportResult delete()
Deletes all attributes.- Returns:
- a list of the attributes after the transaction.
-
setAttributes
public void setAttributes(List<Map<String,String>> attributes) throws TransactionFailure
Sets the attribute list to the specified list.- Parameters:
attributes
- the intended list of attributes.- Throws:
TransactionFailure
- if an error occurs in removing or adding attributes.
-
excuteSetCommand
public abstract void excuteSetCommand(List<Map<String,String>> attributesToAdd, List<Map<String,String>> attributesToDelete) throws TransactionFailure
- Throws:
TransactionFailure
-
attributesAreEqual
public abstract boolean attributesAreEqual(Map<String,String> attribute1, Map<String,String> attribute2)
-
-