import org.codehaus.enunciate.jaxrs.ResponseCode;
import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.opendaylight.neutron.spi.INeutronNetworkCRUD;
-import org.opendaylight.neutron.spi.INeutronPortAware;
import org.opendaylight.neutron.spi.INeutronPortCRUD;
-import org.opendaylight.neutron.spi.INeutronSubnetCRUD;
import org.opendaylight.neutron.spi.NeutronCRUDInterfaces;
import org.opendaylight.neutron.spi.NeutronPort;
@Path("/ports")
public class NeutronPortsNorthbound
- extends AbstractNeutronNorthboundIAware<NeutronPort, NeutronPortRequest, INeutronPortCRUD, INeutronPortAware> {
+ extends AbstractNeutronNorthbound<NeutronPort, NeutronPortRequest, INeutronPortCRUD> {
private static final String RESOURCE_NAME = "Port";
return new NeutronPortRequest(o);
}
- @Override
- protected Object[] getInstances() {
- return NeutronUtil.getInstances(INeutronPortAware.class, this);
- }
-
- @Override
- protected int canCreate(Object instance, NeutronPort singleton) {
- INeutronPortAware service = (INeutronPortAware) instance;
- return service.canCreatePort(singleton);
- }
-
- @Override
- protected void created(Object instance, NeutronPort singleton) {
- INeutronPortAware service = (INeutronPortAware) instance;
- service.neutronPortCreated(singleton);
- }
-
- @Override
- protected int canUpdate(Object instance, NeutronPort delta, NeutronPort original) {
- INeutronPortAware service = (INeutronPortAware) instance;
- return service.canUpdatePort(delta, original);
- }
-
- @Override
- protected void updated(Object instance, NeutronPort updated) {
- INeutronPortAware service = (INeutronPortAware) instance;
- service.neutronPortUpdated(updated);
- }
-
- @Override
- protected int canDelete(Object instance, NeutronPort singleton) {
- INeutronPortAware service = (INeutronPortAware) instance;
- return service.canDeletePort(singleton);
- }
-
- @Override
- protected void deleted(Object instance, NeutronPort singleton) {
- INeutronPortAware service = (INeutronPortAware) instance;
- service.neutronPortDeleted(singleton);
- }
-
@Context
UriInfo uriInfo;
@QueryParam("id") String queryID,
@QueryParam("network_id") String queryNetworkID,
@QueryParam("name") String queryName,
- @QueryParam("admin_state_up") String queryAdminStateUp,
+ @QueryParam("admin_state_up") Boolean queryAdminStateUp,
@QueryParam("status") String queryStatus,
@QueryParam("mac_address") String queryMACAddress,
@QueryParam("device_id") String queryDeviceID,
@QueryParam("device_owner") String queryDeviceOwner,
@QueryParam("tenant_id") String queryTenantID,
+ @QueryParam("port_security_enabled") Boolean queryPortSecurityEnabled,
// linkTitle
@QueryParam("limit") Integer limit,
@QueryParam("marker") String marker,
// sorting not supported
) {
INeutronPortCRUD portInterface = getNeutronInterfaces(false, false).getPortInterface();
- List<NeutronPort> allPorts = portInterface.getAllPorts();
+ List<NeutronPort> allPorts = portInterface.getAll();
List<NeutronPort> ans = new ArrayList<NeutronPort>();
Iterator<NeutronPort> i = allPorts.iterator();
while (i.hasNext()) {
(queryMACAddress == null || queryMACAddress.equals(oSS.getMacAddress())) &&
(queryDeviceID == null || queryDeviceID.equals(oSS.getDeviceID())) &&
(queryDeviceOwner == null || queryDeviceOwner.equals(oSS.getDeviceOwner())) &&
- (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
+ (queryTenantID == null || queryTenantID.equals(oSS.getTenantID())) &&
+ (queryPortSecurityEnabled == null || queryPortSecurityEnabled.equals(oSS.getPortSecurityEnabled()))) {
if (fields.size() > 0) {
ans.add(extractFields(oSS,fields));
} else {
//@TypeHint(OpenStackPorts.class)
@StatusCodes({
@ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response updatePort(
@PathParam("portUUID") String portUUID,
@DELETE
@StatusCodes({
@ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response deletePort(
@PathParam("portUUID") String portUUID) {