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,java.lang.Integer,java.lang.Integer>
-
- org.opennms.web.rest.v2.AlarmRestService
-
@Component @Transactional public class AlarmRestService extends AbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,java.lang.Integer,java.lang.Integer>
Basic Web Service using REST forOnmsAlarm
entity.- 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.Response
closeTicket(javax.ws.rs.core.SecurityContext securityContext, java.lang.Integer alarmId)
protected JaxbListWrapper<AlarmDTO>
createListWrapper(java.util.Collection<AlarmDTO> list)
javax.ws.rs.core.Response
createTicket(javax.ws.rs.core.SecurityContext securityContext, java.lang.Integer alarmId)
protected OnmsAlarm
doGet(javax.ws.rs.core.UriInfo uriInfo, java.lang.Integer id)
protected javax.ws.rs.core.Response
doUpdateProperties(javax.ws.rs.core.SecurityContext securityContext, javax.ws.rs.core.UriInfo uriInfo, OnmsAlarm alarm, MultivaluedMapImpl params)
protected java.util.Map<java.lang.String,CriteriaBehavior<?>>
getCriteriaBehaviors()
Map CXF query bean properties to Criteria property names, conversions, and actions.protected CriteriaBuilder
getCriteriaBuilder(javax.ws.rs.core.UriInfo uriInfo)
protected AlarmDao
getDao()
protected java.lang.Class<OnmsAlarm>
getDaoClass()
protected java.lang.Class<org.apache.cxf.jaxrs.ext.search.SearchBean>
getQueryBeanClass()
protected java.util.Set<SearchProperty>
getQueryProperties()
Get a list of query properties that this endpoint supports for FIQL expressions andorderBy
expressions.OnmsAlarm
mapDTOToEntity(AlarmDTO dto)
Map the given instance of the DTO to the corresponding entity.AlarmDTO
mapEntityToDTO(OnmsAlarm alarm)
Map the given instance of the entity to the corresponding DTO.javax.ws.rs.core.Response
removeJournal(javax.ws.rs.core.SecurityContext securityContext, java.lang.Integer alarmId)
javax.ws.rs.core.Response
removeMemo(javax.ws.rs.core.SecurityContext securityContext, java.lang.Integer alarmId)
javax.ws.rs.core.Response
updateJournal(javax.ws.rs.core.SecurityContext securityContext, java.lang.Integer alarmId, MultivaluedMapImpl params)
javax.ws.rs.core.Response
updateMemo(javax.ws.rs.core.SecurityContext securityContext, java.lang.Integer alarmId, MultivaluedMapImpl params)
javax.ws.rs.core.Response
updateTicket(javax.ws.rs.core.SecurityContext securityContext, java.lang.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()
- Specified by:
getDao
in classAbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,java.lang.Integer,java.lang.Integer>
-
getDaoClass
protected java.lang.Class<OnmsAlarm> getDaoClass()
- Specified by:
getDaoClass
in classAbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,java.lang.Integer,java.lang.Integer>
-
getQueryBeanClass
protected java.lang.Class<org.apache.cxf.jaxrs.ext.search.SearchBean> getQueryBeanClass()
- Specified by:
getQueryBeanClass
in classAbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,java.lang.Integer,java.lang.Integer>
-
getCriteriaBuilder
protected CriteriaBuilder getCriteriaBuilder(javax.ws.rs.core.UriInfo uriInfo)
- Specified by:
getCriteriaBuilder
in classAbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,java.lang.Integer,java.lang.Integer>
-
createListWrapper
protected JaxbListWrapper<AlarmDTO> createListWrapper(java.util.Collection<AlarmDTO> list)
- Specified by:
createListWrapper
in classAbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,java.lang.Integer,java.lang.Integer>
-
getQueryProperties
protected java.util.Set<SearchProperty> getQueryProperties()
Description copied from class:AbstractDaoRestServiceWithDTO
Get a list of query properties that this endpoint supports for FIQL expressions and
orderBy
expressions.- Overrides:
getQueryProperties
in classAbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,java.lang.Integer,java.lang.Integer>
- Returns:
-
getCriteriaBehaviors
protected java.util.Map<java.lang.String,CriteriaBehavior<?>> getCriteriaBehaviors()
Description copied from class:AbstractDaoRestServiceWithDTO
Map 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:
CriteriaBehavior
to execute when this search term is specified
- Overrides:
getCriteriaBehaviors
in classAbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,java.lang.Integer,java.lang.Integer>
- Returns:
-
doGet
protected OnmsAlarm doGet(javax.ws.rs.core.UriInfo uriInfo, java.lang.Integer id)
- Specified by:
doGet
in classAbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,java.lang.Integer,java.lang.Integer>
-
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:
doUpdateProperties
in classAbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,java.lang.Integer,java.lang.Integer>
-
updateMemo
public javax.ws.rs.core.Response updateMemo(@Context javax.ws.rs.core.SecurityContext securityContext, java.lang.Integer alarmId, MultivaluedMapImpl params)
-
updateJournal
public javax.ws.rs.core.Response updateJournal(@Context javax.ws.rs.core.SecurityContext securityContext, java.lang.Integer alarmId, MultivaluedMapImpl params)
-
removeMemo
public javax.ws.rs.core.Response removeMemo(@Context javax.ws.rs.core.SecurityContext securityContext, java.lang.Integer alarmId)
-
removeJournal
public javax.ws.rs.core.Response removeJournal(@Context javax.ws.rs.core.SecurityContext securityContext, java.lang.Integer alarmId)
-
createTicket
public javax.ws.rs.core.Response createTicket(@Context javax.ws.rs.core.SecurityContext securityContext, java.lang.Integer alarmId) throws java.lang.Exception
- Throws:
java.lang.Exception
-
updateTicket
public javax.ws.rs.core.Response updateTicket(@Context javax.ws.rs.core.SecurityContext securityContext, java.lang.Integer alarmId) throws java.lang.Exception
- Throws:
java.lang.Exception
-
closeTicket
public javax.ws.rs.core.Response closeTicket(@Context javax.ws.rs.core.SecurityContext securityContext, java.lang.Integer alarmId) throws java.lang.Exception
- Throws:
java.lang.Exception
-
mapEntityToDTO
public AlarmDTO mapEntityToDTO(OnmsAlarm alarm)
Description copied from class:AbstractDaoRestServiceWithDTO
Map the given instance of the entity to the corresponding DTO.- Specified by:
mapEntityToDTO
in classAbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,java.lang.Integer,java.lang.Integer>
-
mapDTOToEntity
public OnmsAlarm mapDTOToEntity(AlarmDTO dto)
Description copied from class:AbstractDaoRestServiceWithDTO
Map the given instance of the DTO to the corresponding entity.- Specified by:
mapDTOToEntity
in classAbstractDaoRestServiceWithDTO<OnmsAlarm,AlarmDTO,org.apache.cxf.jaxrs.ext.search.SearchBean,java.lang.Integer,java.lang.Integer>
-
-