public class HttpSBControllerImpl extends Object implements HttpSBController
| Constructor and Description |
|---|
HttpSBControllerImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addDevice(RestSBDevice device)
Adds a device to the device map.
|
boolean |
delete(org.onosproject.net.DeviceId device,
String request,
InputStream payload,
String mediaType)
Does a HTTP DELETE request with specified parameters to the device.
|
InputStream |
get(org.onosproject.net.DeviceId device,
String request,
String mediaType)
Does a HTTP GET request with specified parameters to the device.
|
Map<org.onosproject.net.DeviceId,javax.ws.rs.client.Client> |
getClientMap() |
RestSBDevice |
getDevice(org.onosproject.net.DeviceId deviceInfo)
Returns a device by node identifier.
|
RestSBDevice |
getDevice(org.onlab.packet.IpAddress ip,
int port)
Returns a device by Ip and Port.
|
Map<org.onosproject.net.DeviceId,RestSBDevice> |
getDeviceMap() |
Map<org.onosproject.net.DeviceId,RestSBDevice> |
getDevices()
Returns all the devices known to this controller.
|
protected javax.ws.rs.client.WebTarget |
getWebTarget(org.onosproject.net.DeviceId device,
String request) |
boolean |
patch(org.onosproject.net.DeviceId device,
String request,
InputStream payload,
String mediaType)
Does a HTTP PATCH request with specified parameters to the device.
|
boolean |
post(org.onosproject.net.DeviceId device,
String request,
InputStream payload,
String mediaType)
Does a HTTP POST request with specified parameters to the device.
|
<T> T |
post(org.onosproject.net.DeviceId device,
String request,
InputStream payload,
String mediaType,
Class<T> responseClass)
Does a HTTP POST request with specified parameters to the device.
|
boolean |
put(org.onosproject.net.DeviceId device,
String request,
InputStream payload,
String mediaType)
Does a HTTP PUT request with specified parameters to the device.
|
void |
removeDevice(org.onosproject.net.DeviceId deviceId)
Removes the device from the devices map.
|
public Map<org.onosproject.net.DeviceId,RestSBDevice> getDeviceMap()
public Map<org.onosproject.net.DeviceId,javax.ws.rs.client.Client> getClientMap()
public Map<org.onosproject.net.DeviceId,RestSBDevice> getDevices()
HttpSBControllergetDevices in interface HttpSBControllerpublic RestSBDevice getDevice(org.onosproject.net.DeviceId deviceInfo)
HttpSBControllergetDevice in interface HttpSBControllerdeviceInfo - node identifierpublic RestSBDevice getDevice(org.onlab.packet.IpAddress ip, int port)
HttpSBControllergetDevice in interface HttpSBControllerip - device ipport - device portpublic void addDevice(RestSBDevice device)
HttpSBControlleraddDevice in interface HttpSBControllerdevice - to be addedpublic void removeDevice(org.onosproject.net.DeviceId deviceId)
HttpSBControllerremoveDevice in interface HttpSBControllerdeviceId - to be removedpublic boolean post(org.onosproject.net.DeviceId device,
String request,
InputStream payload,
String mediaType)
HttpSBControllerpost in interface HttpSBControllerdevice - device to make the request torequest - url of the requestpayload - payload of the request as an InputStreammediaType - type of content in the payload i.e. application/jsonpublic <T> T post(org.onosproject.net.DeviceId device,
String request,
InputStream payload,
String mediaType,
Class<T> responseClass)
HttpSBControllerpost in interface HttpSBControllerT - post return typedevice - device to make the request torequest - url of the requestpayload - payload of the request as an InputStreammediaType - type of content in the payload i.e. application/jsonresponseClass - the type of response object we are interested in,
such as String, InputStream.public boolean put(org.onosproject.net.DeviceId device,
String request,
InputStream payload,
String mediaType)
HttpSBControllerput in interface HttpSBControllerdevice - device to make the request torequest - resource path of the requestpayload - payload of the request as an InputStreammediaType - type of content in the payload i.e. application/jsonpublic InputStream get(org.onosproject.net.DeviceId device, String request, String mediaType)
HttpSBControllerget in interface HttpSBControllerdevice - device to make the request torequest - url of the requestmediaType - format to retrieve the content inpublic boolean patch(org.onosproject.net.DeviceId device,
String request,
InputStream payload,
String mediaType)
HttpSBControllerpatch in interface HttpSBControllerdevice - device to make the request torequest - url of the requestpayload - payload of the request as an InputStreammediaType - format to retrieve the content inpublic boolean delete(org.onosproject.net.DeviceId device,
String request,
InputStream payload,
String mediaType)
HttpSBControllerdelete in interface HttpSBControllerdevice - device to make the request torequest - url of the requestpayload - payload of the request as an InputStreammediaType - type of content in the payload i.e. application/jsonprotected javax.ws.rs.client.WebTarget getWebTarget(org.onosproject.net.DeviceId device,
String request)