Package org.opennms.web.rest.v2
Class AlarmRestService
- java.lang.Object
-
- org.opennms.web.rest.v2.AbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,Integer,Integer>
-
- org.opennms.web.rest.v2.AlarmRestService
-
@Component @Transactional public class AlarmRestService extends AbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,Integer,Integer>
Basic Web Service using REST forOnmsAlarmentity.- Author:
- Alejandro Galue
-
-
Field Summary
-
Fields inherited from class org.opennms.web.rest.v2.AbstractDaoRestServiceWithDTO
DEFAULT_LIMIT
-
-
Constructor Summary
Constructors Constructor Description AlarmRestService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.ResponsecloseTicket(javax.ws.rs.core.SecurityContext securityContext, Integer alarmId)protected JaxbListWrapper<AlarmDTO>createListWrapper(Collection<AlarmDTO> list)javax.ws.rs.core.ResponsecreateTicket(javax.ws.rs.core.SecurityContext securityContext, Integer alarmId)protected OnmsAlarmdoGet(javax.ws.rs.core.UriInfo uriInfo, Integer id)protected javax.ws.rs.core.ResponsedoUpdateProperties(javax.ws.rs.core.SecurityContext securityContext, javax.ws.rs.core.UriInfo uriInfo, OnmsAlarm alarm, MultivaluedMapImpl params)protected Map<String,CriteriaBehavior<?>>getCriteriaBehaviors()Map CXF query bean properties to Criteria property names, conversions, and actions.protected CriteriaBuildergetCriteriaBuilder(javax.ws.rs.core.UriInfo uriInfo)protected AlarmDaogetDao()protected Class<OnmsAlarm>getDaoClass()protected Class<org.apache.cxf.jaxrs.ext.search.SearchBean>getQueryBeanClass()protected Set<SearchProperty>getQueryProperties()Get a list of query properties that this endpoint supports for FIQL expressions andorderByexpressions.OnmsAlarmmapDTOToEntity(AlarmDTO dto)Map the given instance of the DTO to the corresponding entity.AlarmDTOmapEntityToDTO(OnmsAlarm alarm)Map the given instance of the entity to the corresponding DTO.javax.ws.rs.core.ResponseremoveJournal(javax.ws.rs.core.SecurityContext securityContext, Integer alarmId)javax.ws.rs.core.ResponseremoveMemo(javax.ws.rs.core.SecurityContext securityContext, Integer alarmId)javax.ws.rs.core.ResponseupdateJournal(javax.ws.rs.core.SecurityContext securityContext, Integer alarmId, MultivaluedMapImpl params)javax.ws.rs.core.ResponseupdateMemo(javax.ws.rs.core.SecurityContext securityContext, Integer alarmId, MultivaluedMapImpl params)javax.ws.rs.core.ResponseupdateTicket(javax.ws.rs.core.SecurityContext securityContext, Integer alarmId)-
Methods inherited from class org.opennms.web.rest.v2.AbstractDaoRestServiceWithDTO
applyLimitOffsetOrderBy, create, createSpecific, delete, deleteMany, doCreate, doDelete, doUpdate, get, get, getCount, getCriteria, getException, getProperties, getPropertyValues, getSearchBeanPropertyMap, sendEvent, update, updateMany, updateProperties, writeLock, writeUnlock
-
-
-
-
Method Detail
-
getDao
protected AlarmDao getDao()
-
getDaoClass
protected Class<OnmsAlarm> getDaoClass()
- Specified by:
getDaoClassin classAbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,Integer,Integer>
-
getQueryBeanClass
protected Class<org.apache.cxf.jaxrs.ext.search.SearchBean> getQueryBeanClass()
- Specified by:
getQueryBeanClassin classAbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,Integer,Integer>
-
getCriteriaBuilder
protected CriteriaBuilder getCriteriaBuilder(javax.ws.rs.core.UriInfo uriInfo)
- Specified by:
getCriteriaBuilderin classAbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,Integer,Integer>
-
createListWrapper
protected JaxbListWrapper<AlarmDTO> createListWrapper(Collection<AlarmDTO> list)
- Specified by:
createListWrapperin classAbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,Integer,Integer>
-
getQueryProperties
protected Set<SearchProperty> getQueryProperties()
Description copied from class:AbstractDaoRestServiceWithDTOGet a list of query properties that this endpoint supports for FIQL expressions and
orderByexpressions.- Overrides:
getQueryPropertiesin classAbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,Integer,Integer>- Returns:
-
getCriteriaBehaviors
protected Map<String,CriteriaBehavior<?>> getCriteriaBehaviors()
Description copied from class:AbstractDaoRestServiceWithDTOMap CXF query bean properties to Criteria property names, conversions, and actions. In the absence of a mapping, the query bean property will be specified directly as a Criteria property with the same name.
- Key: CXF query property name
- Value:
CriteriaBehaviorto execute when this search term is specified
- Overrides:
getCriteriaBehaviorsin classAbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,Integer,Integer>- Returns:
-
doUpdateProperties
protected javax.ws.rs.core.Response doUpdateProperties(javax.ws.rs.core.SecurityContext securityContext, javax.ws.rs.core.UriInfo uriInfo, OnmsAlarm alarm, MultivaluedMapImpl params)- Overrides:
doUpdatePropertiesin classAbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,Integer,Integer>
-
updateMemo
public javax.ws.rs.core.Response updateMemo(@Context javax.ws.rs.core.SecurityContext securityContext, Integer alarmId, MultivaluedMapImpl params)
-
updateJournal
public javax.ws.rs.core.Response updateJournal(@Context javax.ws.rs.core.SecurityContext securityContext, Integer alarmId, MultivaluedMapImpl params)
-
removeMemo
public javax.ws.rs.core.Response removeMemo(@Context javax.ws.rs.core.SecurityContext securityContext, Integer alarmId)
-
removeJournal
public javax.ws.rs.core.Response removeJournal(@Context javax.ws.rs.core.SecurityContext securityContext, Integer alarmId)
-
createTicket
public javax.ws.rs.core.Response createTicket(@Context javax.ws.rs.core.SecurityContext securityContext, Integer alarmId) throws Exception- Throws:
Exception
-
updateTicket
public javax.ws.rs.core.Response updateTicket(@Context javax.ws.rs.core.SecurityContext securityContext, Integer alarmId) throws Exception- Throws:
Exception
-
closeTicket
public javax.ws.rs.core.Response closeTicket(@Context javax.ws.rs.core.SecurityContext securityContext, Integer alarmId) throws Exception- Throws:
Exception
-
mapEntityToDTO
public AlarmDTO mapEntityToDTO(OnmsAlarm alarm)
Description copied from class:AbstractDaoRestServiceWithDTOMap the given instance of the entity to the corresponding DTO.- Specified by:
mapEntityToDTOin classAbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,Integer,Integer>
-
mapDTOToEntity
public OnmsAlarm mapDTOToEntity(AlarmDTO dto)
Description copied from class:AbstractDaoRestServiceWithDTOMap the given instance of the DTO to the corresponding entity.- Specified by:
mapDTOToEntityin classAbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,Integer,Integer>
-
-