Package org.opennms.web.rest.v2
Class NodeRestService
- java.lang.Object
-
- org.opennms.web.rest.v2.AbstractDaoRestServiceWithDTO<T,T,Q,K,I>
-
- org.opennms.web.rest.v2.AbstractDaoRestService<OnmsNode,org.apache.cxf.jaxrs.ext.search.SearchBean,Integer,String>
-
- org.opennms.web.rest.v2.NodeRestService
-
@Component @Path("nodes") @Transactional public class NodeRestService extends AbstractDaoRestService<OnmsNode,org.apache.cxf.jaxrs.ext.search.SearchBean,Integer,String>
Basic Web Service using REST forOnmsNode
entity- Author:
- Seth Leger, Alejandro Galue
-
-
Field Summary
-
Fields inherited from class org.opennms.web.rest.v2.AbstractDaoRestServiceWithDTO
DEFAULT_LIMIT
-
-
Constructor Summary
Constructors Constructor Description NodeRestService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected JaxbListWrapper<OnmsNode>
createListWrapper(Collection<OnmsNode> list)
javax.ws.rs.core.Response
doCreate(javax.ws.rs.core.SecurityContext securityContext, javax.ws.rs.core.UriInfo uriInfo, OnmsNode object)
protected void
doDelete(javax.ws.rs.core.SecurityContext securityContext, javax.ws.rs.core.UriInfo uriInfo, OnmsNode node)
protected OnmsNode
doGet(javax.ws.rs.core.UriInfo uriInfo, String id)
protected javax.ws.rs.core.Response
doUpdateProperties(javax.ws.rs.core.SecurityContext securityContext, javax.ws.rs.core.UriInfo uriInfo, OnmsNode targetObject, MultivaluedMapImpl params)
NodeCategoriesRestService
getCategoriesResource(javax.ws.rs.container.ResourceContext context)
protected Map<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 NodeDao
getDao()
protected Class<OnmsNode>
getDaoClass()
NodeHardwareInventoryRestService
getHardwareInventoryResource(javax.ws.rs.container.ResourceContext context)
NodeIpInterfacesRestService
getIpInterfaceResource(javax.ws.rs.container.ResourceContext context)
OnmsMetaDataList
getMetaData(String nodeCriteria)
OnmsMetaDataList
getMetaData(String nodeCriteria, String context)
OnmsMetaDataList
getMetaData(String nodeCriteria, String context, String key)
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 andorderBy
expressions.NodeSnmpInterfacesRestService
getSnmpInterfaceResource(javax.ws.rs.container.ResourceContext context)
javax.ws.rs.core.Response
rescanNode(String nodeCriteria)
rescanNode-
Methods inherited from class org.opennms.web.rest.v2.AbstractDaoRestService
mapDTOToEntity, mapEntityToDTO
-
Methods inherited from class org.opennms.web.rest.v2.AbstractDaoRestServiceWithDTO
applyLimitOffsetOrderBy, create, createSpecific, delete, deleteMany, doUpdate, get, get, getCount, getCriteria, getException, getProperties, getPropertyValues, getSearchBeanPropertyMap, sendEvent, update, updateMany, updateProperties, writeLock, writeUnlock
-
-
-
-
Method Detail
-
getDao
protected NodeDao getDao()
-
getDaoClass
protected Class<OnmsNode> getDaoClass()
- Specified by:
getDaoClass
in classAbstractDaoRestServiceWithDTO<OnmsNode,OnmsNode,org.apache.cxf.jaxrs.ext.search.SearchBean,Integer,String>
-
getQueryBeanClass
protected Class<org.apache.cxf.jaxrs.ext.search.SearchBean> getQueryBeanClass()
- Specified by:
getQueryBeanClass
in classAbstractDaoRestServiceWithDTO<OnmsNode,OnmsNode,org.apache.cxf.jaxrs.ext.search.SearchBean,Integer,String>
-
getCriteriaBuilder
protected CriteriaBuilder getCriteriaBuilder(javax.ws.rs.core.UriInfo uriInfo)
- Specified by:
getCriteriaBuilder
in classAbstractDaoRestServiceWithDTO<OnmsNode,OnmsNode,org.apache.cxf.jaxrs.ext.search.SearchBean,Integer,String>
-
getQueryProperties
protected 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<OnmsNode,OnmsNode,org.apache.cxf.jaxrs.ext.search.SearchBean,Integer,String>
- Returns:
-
getCriteriaBehaviors
protected Map<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<OnmsNode,OnmsNode,org.apache.cxf.jaxrs.ext.search.SearchBean,Integer,String>
- Returns:
-
createListWrapper
protected JaxbListWrapper<OnmsNode> createListWrapper(Collection<OnmsNode> list)
- Specified by:
createListWrapper
in classAbstractDaoRestServiceWithDTO<OnmsNode,OnmsNode,org.apache.cxf.jaxrs.ext.search.SearchBean,Integer,String>
-
doCreate
public javax.ws.rs.core.Response doCreate(javax.ws.rs.core.SecurityContext securityContext, javax.ws.rs.core.UriInfo uriInfo, OnmsNode object)
-
doUpdateProperties
protected javax.ws.rs.core.Response doUpdateProperties(javax.ws.rs.core.SecurityContext securityContext, javax.ws.rs.core.UriInfo uriInfo, OnmsNode targetObject, MultivaluedMapImpl params)
- Overrides:
doUpdateProperties
in classAbstractDaoRestServiceWithDTO<OnmsNode,OnmsNode,org.apache.cxf.jaxrs.ext.search.SearchBean,Integer,String>
-
doDelete
protected void doDelete(javax.ws.rs.core.SecurityContext securityContext, javax.ws.rs.core.UriInfo uriInfo, OnmsNode node)
-
getIpInterfaceResource
@Path("{nodeCriteria}/ipinterfaces") public NodeIpInterfacesRestService getIpInterfaceResource(@Context javax.ws.rs.container.ResourceContext context)
-
getSnmpInterfaceResource
@Path("{nodeCriteria}/snmpinterfaces") public NodeSnmpInterfacesRestService getSnmpInterfaceResource(@Context javax.ws.rs.container.ResourceContext context)
-
getHardwareInventoryResource
@Path("{nodeCriteria}/hardwareInventory") public NodeHardwareInventoryRestService getHardwareInventoryResource(@Context javax.ws.rs.container.ResourceContext context)
-
getCategoriesResource
@Path("{nodeCriteria}/categories") public NodeCategoriesRestService getCategoriesResource(@Context javax.ws.rs.container.ResourceContext context)
-
rescanNode
@PUT @Consumes("application/x-www-form-urlencoded") @Path("{nodeCriteria}/rescan") public javax.ws.rs.core.Response rescanNode(@PathParam("nodeCriteria") String nodeCriteria)
rescanNode
- Parameters:
nodeCriteria
- aString
object.- Returns:
- a
Response
object.
-
getMetaData
@GET @Path("{nodeCriteria}/metadata") @Produces({"application/json","application/xml","application/atom+xml"}) public OnmsMetaDataList getMetaData(@PathParam("nodeCriteria") String nodeCriteria)
-
getMetaData
@GET @Path("{nodeCriteria}/metadata/{context}") @Produces({"application/json","application/xml","application/atom+xml"}) public OnmsMetaDataList getMetaData(@PathParam("nodeCriteria") String nodeCriteria, @PathParam("context") String context)
-
getMetaData
@GET @Path("{nodeCriteria}/metadata/{context}/{key}") @Produces({"application/json","application/xml","application/atom+xml"}) public OnmsMetaDataList getMetaData(@PathParam("nodeCriteria") String nodeCriteria, @PathParam("context") String context, @PathParam("key") String key)
-
-