import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public abstract class AbstractNeutronNorthbound<T extends INeutronObject, NeutronRequest extends INeutronRequest<T>, I extends INeutronCRUD<T>> {
- private static final Logger LOGGER = LoggerFactory
- .getLogger(AbstractNeutronNorthbound.class);
+public abstract class AbstractNeutronNorthbound<T extends INeutronObject, NeutronRequest extends INeutronRequest<T>,
+ I extends INeutronCRUD<T>> {
+ private static final Logger LOGGER = LoggerFactory.getLogger(AbstractNeutronNorthbound.class);
protected static final int HTTP_OK_BOTTOM = 200;
protected static final int HTTP_OK_TOP = 299;
}
protected abstract String getResourceName();
+
protected abstract T extractFields(T o, List<String> fields);
+
protected abstract NeutronRequest newNeutronRequest(T o);
+
protected abstract I getNeutronCRUD();
protected Response show(String uuid,
- // return fields
- List<String> fields) {
+ // return fields
+ List<String> fields) {
I neutronCRUD = getNeutronCRUD();
T ans = neutronCRUD.get(uuid);
if (ans == null) {
}
if (fields.size() > 0) {
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- newNeutronRequest(extractFields(ans, fields))).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(newNeutronRequest(extractFields(ans, fields)))
+ .build();
} else {
return Response.status(HttpURLConnection.HTTP_OK).entity(newNeutronRequest(ans)).build();
}
try {
exist = neutronCRUD.remove(uuid);
} catch (Exception e) {
- LOGGER.debug("exception during remove {} {} {}",
- resourceName, uuid, e);
- throw new InternalServerErrorException("Could not delete " +
- resourceName);
+ LOGGER.debug("exception during remove {} {} {}", resourceName, uuid, e);
+ throw new InternalServerErrorException("Could not delete " + resourceName);
}
if (!exist) {
throw new ResourceNotFoundException(uuidNoExist());
public interface INeutronRequest<T extends INeutronObject> {
T getSingleton();
+
boolean isSingleton();
+
List<T> getBulk();
}
*
*/
public InternalServerErrorException(String string) {
- super(Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(
- string).type(MediaType.TEXT_PLAIN).build());
+ super(Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(string).type(MediaType.TEXT_PLAIN).build());
}
}
// See OpenStack Network API v2.0 Reference for description of
// annotated attributes
- @XmlElement(name="bgpvpn")
+ @XmlElement(name = "bgpvpn")
NeutronBgpvpn singletonBgpvpn;
- @XmlElement(name="bgpvpns")
+ @XmlElement(name = "bgpvpns")
List<NeutronBgpvpn> bulkRequest;
-
NeutronBgpvpnRequest() {
}
@Path("/bgpvpns")
public class NeutronBgpvpnsNorthbound
- extends AbstractNeutronNorthbound<NeutronBgpvpn, NeutronBgpvpnRequest, INeutronBgpvpnCRUD> {
+ extends AbstractNeutronNorthbound<NeutronBgpvpn, NeutronBgpvpnRequest, INeutronBgpvpnCRUD> {
@Context
UriInfo uriInfo;
@GET
@Produces({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackBgpvpns.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
- @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response listBgpvpns(
// return fields
@QueryParam("fields") List<String> fields,
@QueryParam("limit") Integer limit,
@QueryParam("marker") String marker,
@DefaultValue("false") @QueryParam("page_reverse") Boolean pageReverse
- // sorting not supported
- ) {
+ // sorting not supported
+ ) {
INeutronBgpvpnCRUD bgpvpnInterface = getNeutronCRUD();
List<NeutronBgpvpn> allBgpvpns = bgpvpnInterface.getAll();
- List<NeutronBgpvpn> ans = new ArrayList<NeutronBgpvpn>();
+ List<NeutronBgpvpn> ans = new ArrayList<>();
Iterator<NeutronBgpvpn> i = allBgpvpns.iterator();
while (i.hasNext()) {
NeutronBgpvpn oSN = i.next();
if (queryAutoAggregate != null) {
bAutoAggregate = Boolean.valueOf(queryAutoAggregate);
}
- if ((queryID == null || queryID.equals(oSN.getID())) &&
- (queryName == null || queryName.equals(oSN.getBgpvpnName())) &&
- (bAdminStateUp == null || bAdminStateUp.booleanValue() == oSN.isAdminStateUp()) &&
- (queryStatus == null || queryStatus.equals(oSN.getStatus())) &&
- (bAutoAggregate == null || bAutoAggregate.booleanValue() == oSN.isAutoAggregate()) &&
- (queryTenantID == null || queryTenantID.equals(oSN.getTenantID()))) {
+ if ((queryID == null || queryID.equals(oSN.getID()))
+ && (queryName == null || queryName.equals(oSN.getBgpvpnName()))
+ && (bAdminStateUp == null || bAdminStateUp.booleanValue() == oSN.isAdminStateUp())
+ && (queryStatus == null || queryStatus.equals(oSN.getStatus()))
+ && (bAutoAggregate == null || bAutoAggregate.booleanValue() == oSN.isAutoAggregate())
+ && (queryTenantID == null || queryTenantID.equals(oSN.getTenantID()))) {
if (fields.size() > 0) {
- ans.add(extractFields(oSN,fields));
+ ans.add(extractFields(oSN, fields));
} else {
ans.add(oSN);
}
if (limit != null && ans.size() > 1) {
// Return a paginated request
- NeutronBgpvpnRequest request = (NeutronBgpvpnRequest) PaginatedRequestFactory.createRequest(limit,
- marker, pageReverse, uriInfo, ans, NeutronBgpvpn.class);
+ NeutronBgpvpnRequest request = (NeutronBgpvpnRequest) PaginatedRequestFactory.createRequest(limit, marker,
+ pageReverse, uriInfo, ans, NeutronBgpvpn.class);
return Response.status(HttpURLConnection.HTTP_OK).entity(request).build();
}
- return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronBgpvpnRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronBgpvpnRequest(ans)).build();
}
@GET
@Produces({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackBgpvpns.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
- @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
- @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
- public Response showBgpvpn(
- @PathParam("bgpvpnUUID") String bgpvpnUUID,
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ public Response showBgpvpn(@PathParam("bgpvpnUUID") String bgpvpnUUID,
// return fields
- @QueryParam("fields") List<String> fields
- ) {
+ @QueryParam("fields") List<String> fields) {
return show(bgpvpnUUID, fields);
}
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
@TypeHint(NeutronBgpvpn.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createBgpvpns(final NeutronBgpvpnRequest input) {
return create(input);
}
/**
* Updates a Bgpvpn */
@Override
- protected void updateDelta(String uuid,
- NeutronBgpvpn delta, NeutronBgpvpn original) {
+ protected void updateDelta(String uuid, NeutronBgpvpn delta, NeutronBgpvpn original) {
//Fill in defaults if they're missing in update
delta.initDefaults();
delta.setID(uuid);
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackBgpvpns.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 updateBgpvpn(
- @PathParam("bgpvpnUUID") String bgpvpnUUID, final NeutronBgpvpnRequest input
- ) {
+ @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 updateBgpvpn(@PathParam("bgpvpnUUID") String bgpvpnUUID, final NeutronBgpvpnRequest input) {
return update(bgpvpnUUID, input);
}
@Path("{bgpvpnUUID}")
@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 deleteBgpvpn(
- @PathParam("bgpvpnUUID") String bgpvpnUUID) {
+ @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 deleteBgpvpn(@PathParam("bgpvpnUUID") String bgpvpnUUID) {
return delete(bgpvpnUUID);
}
}
*/
@Path("/fw/firewalls")
public class NeutronFirewallNorthbound
- extends AbstractNeutronNorthbound<NeutronFirewall, NeutronFirewallRequest, INeutronFirewallCRUD> {
+ extends AbstractNeutronNorthbound<NeutronFirewall, NeutronFirewallRequest, INeutronFirewallCRUD> {
private static final String RESOURCE_NAME = "Firewall";
* Returns a list of all Firewalls */
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@QueryParam("limit") String limit,
@QueryParam("marker") String marker,
@QueryParam("page_reverse") String pageReverse
- // sorting not supported
+ // sorting not supported
) {
INeutronFirewallCRUD firewallInterface = getNeutronCRUD();
- List<NeutronFirewall> ans = new ArrayList<NeutronFirewall>();
+ List<NeutronFirewall> ans = new ArrayList<>();
for (NeutronFirewall nsg : firewallInterface.getAll()) {
- if ((queryFirewallUUID == null ||
- queryFirewallUUID.equals(nsg.getID())) &&
- (queryFirewallTenantID == null ||
- queryFirewallTenantID.equals(nsg.getTenantID())) &&
- (queryFirewallName == null ||
- queryFirewallName.equals(nsg.getFirewallName())) &&
- (queryFirewallAdminStateIsUp == null ||
- queryFirewallAdminStateIsUp.equals(nsg.getFirewallAdminStateIsUp())) &&
- (queryFirewallIsShared == null ||
- queryFirewallIsShared.equals(nsg.getFirewallIsShared())) &&
- (queryFirewallPolicyID == null ||
- queryFirewallPolicyID.equals(nsg.getFirewallPolicyID()))) {
+ if ((queryFirewallUUID == null || queryFirewallUUID.equals(nsg.getID()))
+ && (queryFirewallTenantID == null || queryFirewallTenantID.equals(nsg.getTenantID()))
+ && (queryFirewallName == null || queryFirewallName.equals(nsg.getFirewallName()))
+ && (queryFirewallAdminStateIsUp == null
+ || queryFirewallAdminStateIsUp.equals(nsg.getFirewallAdminStateIsUp()))
+ && (queryFirewallIsShared == null || queryFirewallIsShared.equals(nsg.getFirewallIsShared()))
+ && (queryFirewallPolicyID == null || queryFirewallPolicyID.equals(nsg.getFirewallPolicyID()))) {
if (fields.size() > 0) {
- ans.add(extractFields(nsg,fields));
+ ans.add(extractFields(nsg, fields));
} else {
ans.add(nsg);
}
}
}
//TODO: apply pagination to results
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- new NeutronFirewallRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronFirewallRequest(ans)).build();
}
/**
@Path("{firewallUUID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response showFirewall(@PathParam("firewallUUID") String firewallUUID,
- // return fields
- @QueryParam("fields") List<String> fields) {
+ // return fields
+ @QueryParam("fields") List<String> fields) {
return show(firewallUUID, fields);
}
@POST
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createFirewalls(final NeutronFirewallRequest input) {
return create(input);
@PUT
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @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 updateFirewall(
- @PathParam("firewallUUID") String firewallUUID, final NeutronFirewallRequest input) {
+ public Response updateFirewall(@PathParam("firewallUUID") String firewallUUID, final NeutronFirewallRequest input) {
return update(firewallUUID, input);
}
@Path("{firewallUUID}")
@DELETE
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @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 deleteFirewall(
- @PathParam("firewallUUID") String firewallUUID) {
+ public Response deleteFirewall(@PathParam("firewallUUID") String firewallUUID) {
return delete(firewallUUID);
}
}
*
*/
@Path("/fw/firewall_policies")
-public class NeutronFirewallPolicyNorthbound
- extends AbstractNeutronNorthbound<NeutronFirewallPolicy, NeutronFirewallPolicyRequest, INeutronFirewallPolicyCRUD> {
+public class NeutronFirewallPolicyNorthbound extends
+ AbstractNeutronNorthbound<NeutronFirewallPolicy, NeutronFirewallPolicyRequest, INeutronFirewallPolicyCRUD> {
private static final String RESOURCE_NAME = "Firewall Policy";
* Returns a list of all Firewall Policies */
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@QueryParam("limit") String limit,
@QueryParam("marker") String marker,
@QueryParam("page_reverse") String pageReverse
- // sorting not supported
+ // sorting not supported
) {
INeutronFirewallPolicyCRUD firewallPolicyInterface = getNeutronCRUD();
- List<NeutronFirewallPolicy> ans = new ArrayList<NeutronFirewallPolicy>();
+ List<NeutronFirewallPolicy> ans = new ArrayList<>();
for (NeutronFirewallPolicy nsg : firewallPolicyInterface.getAll()) {
- if ((queryFirewallPolicyUUID == null ||
- queryFirewallPolicyUUID.equals(nsg.getID())) &&
- (queryFirewallPolicyTenantID == null ||
- queryFirewallPolicyTenantID.equals(nsg.getTenantID())) &&
- (queryFirewallPolicyName == null ||
- queryFirewallPolicyName.equals(nsg.getFirewallPolicyName())) &&
- (querySecurityPolicyIsShared == null ||
- querySecurityPolicyIsShared.equals(nsg.getFirewallPolicyIsShared())) &&
- (querySecurityPolicyIsAudited == null ||
- querySecurityPolicyIsAudited.equals(nsg.getFirewallPolicyIsAudited()))) {
+ if ((queryFirewallPolicyUUID == null || queryFirewallPolicyUUID.equals(nsg.getID()))
+ && (queryFirewallPolicyTenantID == null || queryFirewallPolicyTenantID.equals(nsg.getTenantID()))
+ && (queryFirewallPolicyName == null || queryFirewallPolicyName.equals(nsg.getFirewallPolicyName()))
+ && (querySecurityPolicyIsShared == null
+ || querySecurityPolicyIsShared.equals(nsg.getFirewallPolicyIsShared()))
+ && (querySecurityPolicyIsAudited == null
+ || querySecurityPolicyIsAudited.equals(nsg.getFirewallPolicyIsAudited()))) {
if (fields.size() > 0) {
- ans.add(extractFields(nsg,fields));
+ ans.add(extractFields(nsg, fields));
} else {
ans.add(nsg);
}
}
}
//TODO: apply pagination to results
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- new NeutronFirewallPolicyRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronFirewallPolicyRequest(ans)).build();
}
/**
@Path("{firewallPolicyUUID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response showFirewallPolicy(@PathParam("firewallPolicyUUID") String firewallPolicyUUID,
- // return fields
- @QueryParam("fields") List<String> fields) {
+ // return fields
+ @QueryParam("fields") List<String> fields) {
return show(firewallPolicyUUID, fields);
}
@POST
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createFirewallPolicies(final NeutronFirewallPolicyRequest input) {
return create(input);
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackSubnets.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @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 updateFirewallPolicy(
- @PathParam("firewallPolicyUUID") String firewallPolicyUUID, final NeutronFirewallPolicyRequest input) {
+ public Response updateFirewallPolicy(@PathParam("firewallPolicyUUID") String firewallPolicyUUID,
+ final NeutronFirewallPolicyRequest input) {
return update(firewallPolicyUUID, input);
}
@Path("{firewallPolicyUUID}")
@DELETE
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @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 deleteFirewallPolicy(
- @PathParam("firewallPolicyUUID") String firewallPolicyUUID) {
+ public Response deleteFirewallPolicy(@PathParam("firewallPolicyUUID") String firewallPolicyUUID) {
return delete(firewallPolicyUUID);
}
}
import javax.xml.bind.annotation.XmlRootElement;
import org.opendaylight.neutron.spi.NeutronFirewallPolicy;
-
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronFirewallPolicyRequest
- implements INeutronRequest<NeutronFirewallPolicy> {
+public class NeutronFirewallPolicyRequest implements INeutronRequest<NeutronFirewallPolicy> {
/**
* See OpenStack Network API v2.0 Reference for description of
* http://docs.openstack.org/api/openstack-network/2.0/content/
*
*/
- @XmlElement(name="firewall_policy")
+ @XmlElement(name = "firewall_policy")
NeutronFirewallPolicy singletonFirewallPolicy;
- @XmlElement(name="firewall_policies")
+ @XmlElement(name = "firewall_policies")
List<NeutronFirewallPolicy> bulkRequest;
NeutronFirewallPolicyRequest() {
import javax.xml.bind.annotation.XmlRootElement;
import org.opendaylight.neutron.spi.NeutronFirewall;
-
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronFirewallRequest
- implements INeutronRequest<NeutronFirewall> {
+public class NeutronFirewallRequest implements INeutronRequest<NeutronFirewall> {
/**
* See OpenStack Network API v2.0 Reference for description of
* http://docs.openstack.org/api/openstack-network/2.0/content/
*/
- @XmlElement(name="firewall")
+ @XmlElement(name = "firewall")
NeutronFirewall singletonFirewall;
- @XmlElement(name="firewalls")
+ @XmlElement(name = "firewalls")
List<NeutronFirewall> bulkRequest;
NeutronFirewallRequest() {
import javax.xml.bind.annotation.XmlRootElement;
import org.opendaylight.neutron.spi.NeutronFirewallRule;
-
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronFirewallRuleRequest
- implements INeutronRequest<NeutronFirewallRule> {
+public class NeutronFirewallRuleRequest implements INeutronRequest<NeutronFirewallRule> {
/**
* See OpenStack Network API v2.0 Reference for description of
* http://docs.openstack.org/api/openstack-network/2.0/content/
*
*/
- @XmlElement(name="firewall_rule")
+ @XmlElement(name = "firewall_rule")
NeutronFirewallRule singletonFirewallRule;
- @XmlElement(name="firewall_rules")
+ @XmlElement(name = "firewall_rules")
List<NeutronFirewallRule> bulkRequest;
NeutronFirewallRuleRequest() {
@Path("fw/firewall_rules")
public class NeutronFirewallRulesNorthbound
- extends AbstractNeutronNorthbound<NeutronFirewallRule, NeutronFirewallRuleRequest, INeutronFirewallRuleCRUD> {
+ extends AbstractNeutronNorthbound<NeutronFirewallRule, NeutronFirewallRuleRequest, INeutronFirewallRuleCRUD> {
private static final String RESOURCE_NAME = "Firewall Rule";
@Override
* Returns a list of all Firewall Rules
*/
@GET
- @Produces({MediaType.APPLICATION_JSON})
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @Produces({ MediaType.APPLICATION_JSON })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@QueryParam("limit") String limit,
@QueryParam("marker") String marker,
@QueryParam("page_reverse") String pageReverse
- // sorting not supported
+ // sorting not supported
) {
INeutronFirewallRuleCRUD firewallRuleInterface = getNeutronCRUD();
- List<NeutronFirewallRule> ans = new ArrayList<NeutronFirewallRule>();
+ List<NeutronFirewallRule> ans = new ArrayList<>();
for (NeutronFirewallRule nsr : firewallRuleInterface.getAll()) {
- if ((queryFirewallRuleUUID == null ||
- queryFirewallRuleUUID.equals(nsr.getID())) &&
- (queryFirewallRuleTenantID == null ||
- queryFirewallRuleTenantID.equals(nsr.getTenantID())) &&
- (queryFirewallRuleName == null ||
- queryFirewallRuleName.equals(nsr.getFirewallRuleName())) &&
- (queryFirewallRuleIsShared == null ||
- queryFirewallRuleIsShared.equals(nsr.getFirewallRuleIsShared())) &&
- (queryFirewallRulePolicyID == null ||
- queryFirewallRulePolicyID.equals(nsr.getFirewallRulePolicyID())) &&
- (queryFirewallRuleProtocol == null ||
- queryFirewallRuleProtocol.equals(nsr.getFirewallRuleProtocol())) &&
- (queryFirewallRuleIpVer == null ||
- queryFirewallRuleIpVer.equals(nsr.getFirewallRuleIpVer())) &&
- (queryFirewallRuleSrcIpAddr == null ||
- queryFirewallRuleSrcIpAddr.equals(nsr.getFirewallRuleSrcIpAddr())) &&
- (queryFirewallRuleDstIpAddr == null ||
- queryFirewallRuleDstIpAddr.equals(nsr.getFirewallRuleDstIpAddr())) &&
- (queryFirewallRuleSrcPortRangeMin == null ||
- queryFirewallRuleSrcPortRangeMin.equals(nsr.getFirewallRuleSrcPortRangeMin())) &&
- (queryFirewallRuleSrcPortRangeMax == null ||
- queryFirewallRuleSrcPortRangeMax.equals(nsr.getFirewallRuleSrcPortRangeMax())) &&
- (queryFirewallRuleDstPortRangeMin == null ||
- queryFirewallRuleDstPortRangeMin.equals(nsr.getFirewallRuleDstPortRangeMin())) &&
- (queryFirewallRuleDstPortRangeMax == null ||
- queryFirewallRuleDstPortRangeMax.equals(nsr.getFirewallRuleDstPortRangeMax())) &&
- (queryFirewallRulePosition == null ||
- queryFirewallRulePosition.equals(nsr.getFirewallRulePosition())) &&
- (queryFirewallRuleAction == null ||
- queryFirewallRuleAction.equals(nsr.getFirewallRuleAction())) &&
- (queryFirewallRuleIsEnabled == null ||
- queryFirewallRuleIsEnabled.equals(nsr.getFirewallRuleIsEnabled()))) {
+ if ((queryFirewallRuleUUID == null || queryFirewallRuleUUID.equals(nsr.getID()))
+ && (queryFirewallRuleTenantID == null || queryFirewallRuleTenantID.equals(nsr.getTenantID()))
+ && (queryFirewallRuleName == null || queryFirewallRuleName.equals(nsr.getFirewallRuleName()))
+ && (queryFirewallRuleIsShared == null
+ || queryFirewallRuleIsShared.equals(nsr.getFirewallRuleIsShared()))
+ && (queryFirewallRulePolicyID == null
+ || queryFirewallRulePolicyID.equals(nsr.getFirewallRulePolicyID()))
+ && (queryFirewallRuleProtocol == null
+ || queryFirewallRuleProtocol.equals(nsr.getFirewallRuleProtocol()))
+ && (queryFirewallRuleIpVer == null || queryFirewallRuleIpVer.equals(nsr.getFirewallRuleIpVer()))
+ && (queryFirewallRuleSrcIpAddr == null
+ || queryFirewallRuleSrcIpAddr.equals(nsr.getFirewallRuleSrcIpAddr()))
+ && (queryFirewallRuleDstIpAddr == null
+ || queryFirewallRuleDstIpAddr.equals(nsr.getFirewallRuleDstIpAddr()))
+ && (queryFirewallRuleSrcPortRangeMin == null
+ || queryFirewallRuleSrcPortRangeMin.equals(nsr.getFirewallRuleSrcPortRangeMin()))
+ && (queryFirewallRuleSrcPortRangeMax == null
+ || queryFirewallRuleSrcPortRangeMax.equals(nsr.getFirewallRuleSrcPortRangeMax()))
+ && (queryFirewallRuleDstPortRangeMin == null
+ || queryFirewallRuleDstPortRangeMin.equals(nsr.getFirewallRuleDstPortRangeMin()))
+ && (queryFirewallRuleDstPortRangeMax == null
+ || queryFirewallRuleDstPortRangeMax.equals(nsr.getFirewallRuleDstPortRangeMax()))
+ && (queryFirewallRulePosition == null
+ || queryFirewallRulePosition.equals(nsr.getFirewallRulePosition()))
+ && (queryFirewallRuleAction == null || queryFirewallRuleAction.equals(nsr.getFirewallRuleAction()))
+ && (queryFirewallRuleIsEnabled == null
+ || queryFirewallRuleIsEnabled.equals(nsr.getFirewallRuleIsEnabled()))) {
if (fields.size() > 0) {
ans.add(extractFields(nsr, fields));
} else {
}
}
//TODO: apply pagination to results
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- new NeutronFirewallRuleRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronFirewallRuleRequest(ans)).build();
}
/**
@Path("{firewallRuleUUID}")
@GET
- @Produces({MediaType.APPLICATION_JSON})
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @Produces({ MediaType.APPLICATION_JSON })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
*/
@POST
- @Produces({MediaType.APPLICATION_JSON})
- @Consumes({MediaType.APPLICATION_JSON})
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createFirewallRules(final NeutronFirewallRuleRequest input) {
return create(input);
*/
@Path("{firewallRuleUUID}")
@PUT
- @Produces({MediaType.APPLICATION_JSON})
- @Consumes({MediaType.APPLICATION_JSON})
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @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 updateFirewallRule(
- @PathParam("firewallRuleUUID") String firewallRuleUUID, final NeutronFirewallRuleRequest input) {
+ public Response updateFirewallRule(@PathParam("firewallRuleUUID") String firewallRuleUUID,
+ final NeutronFirewallRuleRequest input) {
return update(firewallRuleUUID, input);
}
@Path("{firewallRuleUUID}")
@DELETE
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @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 deleteFirewallRule(
- @PathParam("firewallRuleUUID") String firewallRuleUUID) {
+ public Response deleteFirewallRule(@PathParam("firewallRuleUUID") String firewallRuleUUID) {
return delete(firewallRuleUUID);
}
}
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronFloatingIPRequest
- implements INeutronRequest<NeutronFloatingIP> {
+public class NeutronFloatingIPRequest implements INeutronRequest<NeutronFloatingIP> {
// See OpenStack Network API v2.0 Reference for description of
// annotated attributes
- @XmlElement(name="floatingip")
+ @XmlElement(name = "floatingip")
NeutronFloatingIP singletonFloatingIP;
- @XmlElement(name="floatingips")
+ @XmlElement(name = "floatingips")
List<NeutronFloatingIP> bulkRequest;
NeutronFloatingIPRequest() {
@Path("/floatingips")
public class NeutronFloatingIPsNorthbound
- extends AbstractNeutronNorthbound<NeutronFloatingIP, NeutronFloatingIPRequest, INeutronFloatingIPCRUD> {
+ extends AbstractNeutronNorthbound<NeutronFloatingIP, NeutronFloatingIPRequest, INeutronFloatingIPCRUD> {
private static final String RESOURCE_NAME = "Floating IP";
@Override
if (flag) {
answer = answer.fetchINeutronNetworkCRUD(this).fetchINeutronSubnetCRUD(this).fetchINeutronPortCRUD(this);
if (answer.getNetworkInterface() == null) {
- throw new ServiceUnavailableException("Network CRUD Interface "
- + RestMessages.SERVICEUNAVAILABLE.toString());
+ throw new ServiceUnavailableException(
+ "Network CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString());
}
if (answer.getSubnetInterface() == null) {
- throw new ServiceUnavailableException("Subnet CRUD Interface "
- + RestMessages.SERVICEUNAVAILABLE.toString());
+ throw new ServiceUnavailableException(
+ "Subnet CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString());
}
if (answer.getPortInterface() == null) {
- throw new ServiceUnavailableException("Port CRUD Interface "
- + RestMessages.SERVICEUNAVAILABLE.toString());
+ throw new ServiceUnavailableException(
+ "Port CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString());
}
}
return answer;
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@QueryParam("limit") String limit,
@QueryParam("marker") String marker,
@QueryParam("page_reverse") String pageReverse
- // sorting not supported
- ) {
+ // sorting not supported
+ ) {
INeutronFloatingIPCRUD floatingIPInterface = getNeutronInterfaces(false).getFloatingIPInterface();
List<NeutronFloatingIP> allFloatingIPs = floatingIPInterface.getAll();
- List<NeutronFloatingIP> ans = new ArrayList<NeutronFloatingIP>();
+ List<NeutronFloatingIP> ans = new ArrayList<>();
Iterator<NeutronFloatingIP> i = allFloatingIPs.iterator();
while (i.hasNext()) {
NeutronFloatingIP oSS = i.next();
//match filters: TODO provider extension and router extension
- if ((queryID == null || queryID.equals(oSS.getID())) &&
- (queryFloatingNetworkId == null || queryFloatingNetworkId.equals(oSS.getFloatingNetworkUUID())) &&
- (queryPortId == null || queryPortId.equals(oSS.getPortUUID())) &&
- (queryFixedIPAddress == null || queryFixedIPAddress.equals(oSS.getFixedIPAddress())) &&
- (queryFloatingIPAddress == null || queryFloatingIPAddress.equals(oSS.getFloatingIPAddress())) &&
- (queryStatus == null || queryStatus.equals(oSS.getStatus())) &&
- (queryRouterID == null || queryRouterID.equals(oSS.getRouterUUID())) &&
- (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
+ if ((queryID == null || queryID.equals(oSS.getID()))
+ && (queryFloatingNetworkId == null || queryFloatingNetworkId.equals(oSS.getFloatingNetworkUUID()))
+ && (queryPortId == null || queryPortId.equals(oSS.getPortUUID()))
+ && (queryFixedIPAddress == null || queryFixedIPAddress.equals(oSS.getFixedIPAddress()))
+ && (queryFloatingIPAddress == null || queryFloatingIPAddress.equals(oSS.getFloatingIPAddress()))
+ && (queryStatus == null || queryStatus.equals(oSS.getStatus()))
+ && (queryRouterID == null || queryRouterID.equals(oSS.getRouterUUID()))
+ && (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
if (fields.size() > 0) {
- ans.add(extractFields(oSS,fields));
+ ans.add(extractFields(oSS, fields));
} else {
ans.add(oSS);
}
}
}
//TODO: apply pagination to results
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- new NeutronFloatingIPRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronFloatingIPRequest(ans)).build();
}
/**
@Path("{floatingipUUID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
- public Response showFloatingIP(
- @PathParam("floatingipUUID") String floatingipUUID,
+ public Response showFloatingIP(@PathParam("floatingipUUID") String floatingipUUID,
// return fields
- @QueryParam("fields") List<String> fields ) {
+ @QueryParam("fields") List<String> fields) {
return show(floatingipUUID, fields);
}
@POST
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createFloatingIPs(final NeutronFloatingIPRequest input) {
return create(input);
}
@PUT
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @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 updateFloatingIP(
- @PathParam("floatingipUUID") String floatingipUUID,
- NeutronFloatingIPRequest input
- ) {
+ public Response updateFloatingIP(@PathParam("floatingipUUID") String floatingipUUID,
+ NeutronFloatingIPRequest input) {
return update(floatingipUUID, input);
}
@Path("{floatingipUUID}")
@DELETE
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @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 deleteFloatingIP(
- @PathParam("floatingipUUID") String floatingipUUID) {
+ public Response deleteFloatingIP(@PathParam("floatingipUUID") String floatingipUUID) {
return delete(floatingipUUID);
}
}
* http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
*/
-@Path ("/l2gateway-connections")
-public class NeutronL2gatewayConnectionNorthbound
- extends AbstractNeutronNorthbound<NeutronL2gatewayConnection, NeutronL2gatewayConnectionRequest, INeutronL2gatewayConnectionCRUD> {
+@Path("/l2gateway-connections")
+public class NeutronL2gatewayConnectionNorthbound extends AbstractNeutronNorthbound<NeutronL2gatewayConnection,
+ NeutronL2gatewayConnectionRequest, INeutronL2gatewayConnectionCRUD> {
static final Logger logger = LoggerFactory.getLogger(NeutronL2gatewayConnectionNorthbound.class);
}
@Override
- protected NeutronL2gatewayConnection extractFields(NeutronL2gatewayConnection o,
- List<String> fields) {
+ protected NeutronL2gatewayConnection extractFields(NeutronL2gatewayConnection o, List<String> fields) {
return o.extractFields(fields);
}
* @return status
*/
@POST
- @Produces ({MediaType.APPLICATION_JSON})
- @Consumes ({MediaType.APPLICATION_JSON})
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_BAD_REQUEST, condition = "Bad Request"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
*/
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK,
- condition = "Operation successful"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED,
- condition = "Unauthorized"),
- @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED,
- condition = "Not Implemented"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE,
- condition = "No providers available") })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response listL2gatewayConnections(
- // return fields
- @QueryParam("fields") List<String> fields,
- @QueryParam("tenant_id") String queryTenantID,
- @QueryParam("connection_id") String queryConnectionID,
- @QueryParam("l2gateway_id") String queryL2gatewayID,
- @QueryParam("network_id") String queryNetworkID,
- @QueryParam("segment_id") String querySegmentID,
- @QueryParam("port_id") String queryPortID,
- @QueryParam ("limit") String limit,
- @QueryParam ("marker") String marker,
- @QueryParam ("page_reverse") String pageReverse
- // sorting not supported
+ // return fields
+ @QueryParam("fields") List<String> fields,
+ @QueryParam("tenant_id") String queryTenantID,
+ @QueryParam("connection_id") String queryConnectionID,
+ @QueryParam("l2gateway_id") String queryL2gatewayID,
+ @QueryParam("network_id") String queryNetworkID,
+ @QueryParam("segment_id") String querySegmentID,
+ @QueryParam("port_id") String queryPortID,
+ @QueryParam("limit") String limit,
+ @QueryParam("marker") String marker,
+ @QueryParam("page_reverse") String pageReverse
+ // sorting not supported
) {
INeutronL2gatewayConnectionCRUD l2gatewayConnectionInterface = getNeutronCRUD();
List<NeutronL2gatewayConnection> allL2gatewayConnections = l2gatewayConnectionInterface.getAll();
- List<NeutronL2gatewayConnection> ans = new ArrayList<NeutronL2gatewayConnection>();
- Iterator<NeutronL2gatewayConnection> i = allL2gatewayConnections
- .iterator();
+ List<NeutronL2gatewayConnection> ans = new ArrayList<>();
+ Iterator<NeutronL2gatewayConnection> i = allL2gatewayConnections.iterator();
while (i.hasNext()) {
NeutronL2gatewayConnection oSS = i.next();
- if ((queryTenantID == null || queryTenantID.equals(oSS
- .getTenantID()))
- && (queryConnectionID == null || queryConnectionID
- .equals(oSS.getID()))
- && (queryL2gatewayID == null || queryL2gatewayID.equals(oSS
- .getL2gatewayID()))
- && (queryNetworkID == null || queryNetworkID.equals(oSS
- .getNetworkID()))
- && (querySegmentID == null || querySegmentID.equals(oSS
- .getSegmentID()))
- && (queryPortID == null || queryPortID.equals(oSS
- .getPortID()))) {
+ if ((queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))
+ && (queryConnectionID == null || queryConnectionID.equals(oSS.getID()))
+ && (queryL2gatewayID == null || queryL2gatewayID.equals(oSS.getL2gatewayID()))
+ && (queryNetworkID == null || queryNetworkID.equals(oSS.getNetworkID()))
+ && (querySegmentID == null || querySegmentID.equals(oSS.getSegmentID()))
+ && (queryPortID == null || queryPortID.equals(oSS.getPortID()))) {
if (fields.size() > 0) {
ans.add(extractFields(oSS, fields));
} else {
}
}
// TODO: apply pagination to results
- return Response.status(HttpURLConnection.HTTP_OK)
- .entity(new NeutronL2gatewayConnectionRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronL2gatewayConnectionRequest(ans)).build();
}
/**
* @param fields attributes used for querying
* @return status
*/
- @Path ("{l2gatewayConnectionID}")
+ @Path("{l2gatewayConnectionID}")
@GET
- @Produces ({MediaType.APPLICATION_JSON})
- @StatusCodes ({
- @ResponseCode (code = HttpURLConnection.HTTP_OK,
- condition = "Operation successful"),
- @ResponseCode (code = HttpURLConnection.HTTP_UNAUTHORIZED,
- condition = "Unauthorized"),
- @ResponseCode (code = HttpURLConnection.HTTP_NOT_FOUND,
- condition = "Not Found"),
- @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED,
- condition = "Not Implemented"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE,
- condition = "No providers available") })
+ @Produces({ MediaType.APPLICATION_JSON })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response showL2gatewayID(@PathParam("l2gatewayConnectionID") String l2gatewayConnectionID,
- // return fields
- @QueryParam("fields") List<String> fields) {
+ // return fields
+ @QueryParam("fields") List<String> fields) {
return show(l2gatewayConnectionID, fields);
}
*/
@Path("{l2gatewayConnectionID}")
@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 deleteL2gatewayConnection(
- @PathParam("l2gatewayConnectionID") String l2gatewayConnectionID) {
+ @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 deleteL2gatewayConnection(@PathParam("l2gatewayConnectionID") String l2gatewayConnectionID) {
return delete(l2gatewayConnectionID);
}
* http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
*/
-@Path ("/l2-gateways")
+@Path("/l2-gateways")
public class NeutronL2gatewayNorthbound
- extends AbstractNeutronNorthbound<NeutronL2gateway, NeutronL2gatewayRequest, INeutronL2gatewayCRUD> {
+ extends AbstractNeutronNorthbound<NeutronL2gateway, NeutronL2gatewayRequest, INeutronL2gatewayCRUD> {
static final Logger logger = LoggerFactory.getLogger(NeutronL2gatewayNorthbound.class);
@Context
* @return success or error code
*/
@POST
- @Produces ({MediaType.APPLICATION_JSON})
- @Consumes ({MediaType.APPLICATION_JSON})
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_BAD_REQUEST, condition = "Bad Request"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
*/
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK,
- condition = "Operation successful"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED,
- condition = "Unauthorized"),
- @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED,
- condition = "Not Implemented"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE,
- condition = "No providers available") })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response listL2gateways(
- // return fields
- @QueryParam("fields") List<String> fields,
- // OpenStack L2gateway attributes
- @QueryParam("id") String queryID,
- @QueryParam("name") String queryName,
- @QueryParam("tenant_id") String queryTenantID,
- @QueryParam("devices") String queryNeutronL2gatewayDevice,
- // pagination
- @QueryParam("limit") String limit,
- @QueryParam("marker") String marker,
- @QueryParam("page_reverse") String pageReverse
- // sorting not supported
- ){
- INeutronL2gatewayCRUD l2gatewayInterface =
- getNeutronInterfaces().getL2gatewayInterface();
- List<NeutronL2gateway> allL2gateways =
- l2gatewayInterface.getAll();
- List<NeutronL2gateway> ans = new ArrayList<NeutronL2gateway>();
+ // return fields
+ @QueryParam("fields") List<String> fields,
+ // OpenStack L2gateway attributes
+ @QueryParam("id") String queryID,
+ @QueryParam("name") String queryName,
+ @QueryParam("tenant_id") String queryTenantID,
+ @QueryParam("devices") String queryNeutronL2gatewayDevice,
+ // pagination
+ @QueryParam("limit") String limit,
+ @QueryParam("marker") String marker,
+ @QueryParam("page_reverse") String pageReverse
+ // sorting not supported
+ ) {
+ INeutronL2gatewayCRUD l2gatewayInterface = getNeutronInterfaces().getL2gatewayInterface();
+ List<NeutronL2gateway> allL2gateways = l2gatewayInterface.getAll();
+ List<NeutronL2gateway> ans = new ArrayList<>();
Iterator<NeutronL2gateway> i = allL2gateways.iterator();
while (i.hasNext()) {
NeutronL2gateway l2gateway = i.next();
if ((queryID == null || queryID.equals(l2gateway.getID()))
&& (queryName == null || queryName.equals(l2gateway.getL2gatewayName()))
&& (queryTenantID == null || queryTenantID.equals(l2gateway.getTenantID()))
- && (queryNeutronL2gatewayDevice == null || queryNeutronL2gatewayDevice
- .equals(l2gateway.getNeutronL2gatewayDevices()))) {
+ && (queryNeutronL2gatewayDevice == null
+ || queryNeutronL2gatewayDevice.equals(l2gateway.getNeutronL2gatewayDevices()))) {
if (fields.size() > 0) {
- ans.add(extractFields(l2gateway,fields));
+ ans.add(extractFields(l2gateway, fields));
} else {
ans.add(l2gateway);
}
* @param fields l2gateway attributes
* @return l2gateway details or error.
*/
- @Path ("{l2gatewayID}")
+ @Path("{l2gatewayID}")
@GET
- @Produces ({MediaType.APPLICATION_JSON})
- @StatusCodes ({
- @ResponseCode (code = HttpURLConnection.HTTP_OK,
- condition = "Operation successful"),
- @ResponseCode (code = HttpURLConnection.HTTP_UNAUTHORIZED,
- condition = "Unauthorized"),
- @ResponseCode (code = HttpURLConnection.HTTP_NOT_FOUND,
- condition = "Not Found"),
- @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED,
- condition = "Not Implemented"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE,
- condition = "No providers available") })
- public Response showL2gateway(@PathParam ("l2gatewayID") String l2gatewayID,
- // return fields
- @QueryParam ("fields") List<String> fields) {
+ @Produces({ MediaType.APPLICATION_JSON })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ public Response showL2gateway(@PathParam("l2gatewayID") String l2gatewayID,
+ // return fields
+ @QueryParam("fields") List<String> fields) {
return show(l2gatewayID, fields);
}
@Path("{l2gatewayID}")
@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 deleteL2gateway(
- @PathParam("l2gatewayID") String l2gatewayID) {
+ @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 deleteL2gateway(@PathParam("l2gatewayID") String l2gatewayID) {
return delete(l2gatewayID);
}
@PUT
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @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 updateL2gateway(
- @PathParam("l2gatewayID") String l2gatewayID,
- NeutronL2gatewayRequest input) {
+ @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 updateL2gateway(@PathParam("l2gatewayID") String l2gatewayID, NeutronL2gatewayRequest input) {
return update(l2gatewayID, input);
}
*/
@Path("/lbaas/healthmonitors")
public class NeutronLoadBalancerHealthMonitorNorthbound
- extends AbstractNeutronNorthbound<NeutronLoadBalancerHealthMonitor, NeutronLoadBalancerHealthMonitorRequest, INeutronLoadBalancerHealthMonitorCRUD> {
+ extends AbstractNeutronNorthbound<NeutronLoadBalancerHealthMonitor, NeutronLoadBalancerHealthMonitorRequest,
+ INeutronLoadBalancerHealthMonitorCRUD> {
private static final String RESOURCE_NAME = "LoadBalancerHealthMonitor";
* Returns a list of all LoadBalancerHealthMonitor */
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@QueryParam("limit") String limit,
@QueryParam("marker") String marker,
@QueryParam("page_reverse") String pageReverse
- // sorting not supported
+ // sorting not supported
) {
INeutronLoadBalancerHealthMonitorCRUD loadBalancerHealthMonitorInterface = getNeutronCRUD();
- List<NeutronLoadBalancerHealthMonitor> allLoadBalancerHealthMonitors = loadBalancerHealthMonitorInterface.getAll();
- List<NeutronLoadBalancerHealthMonitor> ans = new ArrayList<NeutronLoadBalancerHealthMonitor>();
+ List<NeutronLoadBalancerHealthMonitor> allLoadBalancerHealthMonitors = loadBalancerHealthMonitorInterface
+ .getAll();
+ List<NeutronLoadBalancerHealthMonitor> ans = new ArrayList<>();
Iterator<NeutronLoadBalancerHealthMonitor> i = allLoadBalancerHealthMonitors.iterator();
while (i.hasNext()) {
NeutronLoadBalancerHealthMonitor nsg = i.next();
- if ((queryLoadBalancerHealthMonitorID == null ||
- queryLoadBalancerHealthMonitorID.equals(nsg.getID())) &&
- (queryLoadBalancerHealthMonitorTenantID == null ||
- queryLoadBalancerHealthMonitorTenantID.equals
- (nsg.getTenantID())) &&
- (queryLoadBalancerHealthMonitorType == null ||
- queryLoadBalancerHealthMonitorType.equals
- (nsg.getLoadBalancerHealthMonitorType())) &&
- (queryLoadBalancerHealthMonitorDelay == null ||
- queryLoadBalancerHealthMonitorDelay.equals
- (nsg.getLoadBalancerHealthMonitorDelay())) &&
- (queryLoadBalancerHealthMonitorTimeout == null ||
- queryLoadBalancerHealthMonitorTimeout.equals
- (nsg.getLoadBalancerHealthMonitorTimeout())) &&
- (queryLoadBalancerHealthMonitorMaxRetries == null ||
- queryLoadBalancerHealthMonitorMaxRetries.equals
- (nsg.getLoadBalancerHealthMonitorMaxRetries())) &&
- (queryLoadBalancerHealthMonitorHttpMethod == null ||
- queryLoadBalancerHealthMonitorHttpMethod.equals
- (nsg.getLoadBalancerHealthMonitorHttpMethod())) &&
- (queryLoadBalancerHealthMonitorUrlPath == null ||
- queryLoadBalancerHealthMonitorUrlPath.equals
- (nsg.getLoadBalancerHealthMonitorUrlPath())) &&
- (queryLoadBalancerHealthMonitorExpectedCodes == null ||
- queryLoadBalancerHealthMonitorExpectedCodes.equals
- (nsg.getLoadBalancerHealthMonitorExpectedCodes())) &&
- (queryLoadBalancerHealthMonitorIsAdminStateUp == null ||
- queryLoadBalancerHealthMonitorIsAdminStateUp.equals
- (nsg.getLoadBalancerHealthMonitorAdminStateIsUp()))) {
+ if ((queryLoadBalancerHealthMonitorID == null || queryLoadBalancerHealthMonitorID.equals(nsg.getID()))
+ && (queryLoadBalancerHealthMonitorTenantID == null
+ || queryLoadBalancerHealthMonitorTenantID.equals(nsg.getTenantID()))
+ && (queryLoadBalancerHealthMonitorType == null
+ || queryLoadBalancerHealthMonitorType.equals(nsg.getLoadBalancerHealthMonitorType()))
+ && (queryLoadBalancerHealthMonitorDelay == null
+ || queryLoadBalancerHealthMonitorDelay.equals(nsg.getLoadBalancerHealthMonitorDelay()))
+ && (queryLoadBalancerHealthMonitorTimeout == null
+ || queryLoadBalancerHealthMonitorTimeout.equals(nsg.getLoadBalancerHealthMonitorTimeout()))
+ && (queryLoadBalancerHealthMonitorMaxRetries == null || queryLoadBalancerHealthMonitorMaxRetries
+ .equals(nsg.getLoadBalancerHealthMonitorMaxRetries()))
+ && (queryLoadBalancerHealthMonitorHttpMethod == null || queryLoadBalancerHealthMonitorHttpMethod
+ .equals(nsg.getLoadBalancerHealthMonitorHttpMethod()))
+ && (queryLoadBalancerHealthMonitorUrlPath == null
+ || queryLoadBalancerHealthMonitorUrlPath.equals(nsg.getLoadBalancerHealthMonitorUrlPath()))
+ && (queryLoadBalancerHealthMonitorExpectedCodes == null
+ || queryLoadBalancerHealthMonitorExpectedCodes
+ .equals(nsg.getLoadBalancerHealthMonitorExpectedCodes()))
+ && (queryLoadBalancerHealthMonitorIsAdminStateUp == null
+ || queryLoadBalancerHealthMonitorIsAdminStateUp
+ .equals(nsg.getLoadBalancerHealthMonitorAdminStateIsUp()))) {
if (fields.size() > 0) {
- ans.add(extractFields(nsg,fields));
+ ans.add(extractFields(nsg, fields));
} else {
ans.add(nsg);
}
}
}
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- new NeutronLoadBalancerHealthMonitorRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronLoadBalancerHealthMonitorRequest(ans))
+ .build();
}
/**
@Path("{loadBalancerHealthMonitorID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
- public Response showLoadBalancerHealthMonitor(@PathParam("loadBalancerHealthMonitorID") String loadBalancerHealthMonitorID,
+ public Response showLoadBalancerHealthMonitor(
+ @PathParam("loadBalancerHealthMonitorID") String loadBalancerHealthMonitorID,
// return fields
@QueryParam("fields") List<String> fields) {
return show(loadBalancerHealthMonitorID, fields);
@POST
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createLoadBalancerHealthMonitors(final NeutronLoadBalancerHealthMonitorRequest input) {
return create(input);
@PUT
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @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 updateLoadBalancerHealthMonitor(
return update(loadBalancerHealthMonitorID, input);
}
-
/**
* Deletes a LoadBalancerHealthMonitor
* */
@Path("{loadBalancerHealthMonitorID}")
@DELETE
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @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 deleteLoadBalancerHealthMonitor(
import javax.xml.bind.annotation.XmlRootElement;
import org.opendaylight.neutron.spi.NeutronLoadBalancerHealthMonitor;
-
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronLoadBalancerHealthMonitorRequest
- implements INeutronRequest<NeutronLoadBalancerHealthMonitor> {
+public class NeutronLoadBalancerHealthMonitorRequest implements INeutronRequest<NeutronLoadBalancerHealthMonitor> {
/**
* See OpenStack Network API v2.0 Reference for description of
* http://docs.openstack.org/api/openstack-network/2.0/content/
*/
- @XmlElement(name="healthmonitor")
+ @XmlElement(name = "healthmonitor")
NeutronLoadBalancerHealthMonitor singletonLoadBalancerHealthMonitor;
- @XmlElement(name="healthmonitors")
+ @XmlElement(name = "healthmonitors")
List<NeutronLoadBalancerHealthMonitor> bulkRequest;
NeutronLoadBalancerHealthMonitorRequest() {
*
*/
@Path("/lbaas/listeners")
-public class NeutronLoadBalancerListenerNorthbound
- extends AbstractNeutronNorthbound<NeutronLoadBalancerListener, NeutronLoadBalancerListenerRequest, INeutronLoadBalancerListenerCRUD> {
+public class NeutronLoadBalancerListenerNorthbound extends AbstractNeutronNorthbound<NeutronLoadBalancerListener,
+ NeutronLoadBalancerListenerRequest, INeutronLoadBalancerListenerCRUD> {
private static final String RESOURCE_NAME = "LoadBalancerListener";
* Returns a list of all LoadBalancerListener */
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@QueryParam("limit") String limit,
@QueryParam("marker") String marker,
@QueryParam("page_reverse") String pageReverse
- // sorting not supported
+ // sorting not supported
) {
INeutronLoadBalancerListenerCRUD loadBalancerListenerInterface = getNeutronCRUD();
List<NeutronLoadBalancerListener> allLoadBalancerListeners = loadBalancerListenerInterface.getAll();
- List<NeutronLoadBalancerListener> ans = new ArrayList<NeutronLoadBalancerListener>();
+ List<NeutronLoadBalancerListener> ans = new ArrayList<>();
Iterator<NeutronLoadBalancerListener> i = allLoadBalancerListeners.iterator();
while (i.hasNext()) {
NeutronLoadBalancerListener nsg = i.next();
- if ((queryLoadBalancerListenerID == null ||
- queryLoadBalancerListenerID.equals(nsg.getID())) &&
- (queryLoadBalancerListenerDefaultPoolID == null ||
- queryLoadBalancerListenerDefaultPoolID.equals(nsg.getNeutronLoadBalancerListenerDefaultPoolID())) &&
- (queryLoadBalancerListenerTenantID == null ||
- queryLoadBalancerListenerTenantID.equals(nsg.getTenantID())) &&
- (queryLoadBalancerListenerName == null ||
- queryLoadBalancerListenerName.equals(nsg.getLoadBalancerListenerName())) &&
- (queryLoadBalancerListenerProtocol == null ||
- queryLoadBalancerListenerProtocol.equals(nsg.getNeutronLoadBalancerListenerProtocol())) &&
- (queryLoadBalancerListenerProtocolPort == null ||
- queryLoadBalancerListenerProtocolPort.equals(nsg.getNeutronLoadBalancerListenerProtocolPort())) &&
- (queryLoadBalancerListenerAdminIsUp == null ||
- queryLoadBalancerListenerAdminIsUp.equals(nsg.getLoadBalancerListenerAdminStateIsUp()))) {
+ if ((queryLoadBalancerListenerID == null || queryLoadBalancerListenerID.equals(nsg.getID()))
+ && (queryLoadBalancerListenerDefaultPoolID == null || queryLoadBalancerListenerDefaultPoolID
+ .equals(nsg.getNeutronLoadBalancerListenerDefaultPoolID()))
+ && (queryLoadBalancerListenerTenantID == null
+ || queryLoadBalancerListenerTenantID.equals(nsg.getTenantID()))
+ && (queryLoadBalancerListenerName == null
+ || queryLoadBalancerListenerName.equals(nsg.getLoadBalancerListenerName()))
+ && (queryLoadBalancerListenerProtocol == null
+ || queryLoadBalancerListenerProtocol.equals(nsg.getNeutronLoadBalancerListenerProtocol()))
+ && (queryLoadBalancerListenerProtocolPort == null || queryLoadBalancerListenerProtocolPort
+ .equals(nsg.getNeutronLoadBalancerListenerProtocolPort()))
+ && (queryLoadBalancerListenerAdminIsUp == null || queryLoadBalancerListenerAdminIsUp
+ .equals(nsg.getLoadBalancerListenerAdminStateIsUp()))) {
if (fields.size() > 0) {
- ans.add(extractFields(nsg,fields));
+ ans.add(extractFields(nsg, fields));
} else {
ans.add(nsg);
}
}
}
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- new NeutronLoadBalancerListenerRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronLoadBalancerListenerRequest(ans)).build();
}
/**
@Path("{loadBalancerListenerID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@POST
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createLoadBalancerListeners(final NeutronLoadBalancerListenerRequest input) {
return create(input);
@PUT
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @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 updateLoadBalancerListener(
- @PathParam("loadBalancerListenerID") String loadBalancerListenerID, final NeutronLoadBalancerListenerRequest input) {
+ public Response updateLoadBalancerListener(@PathParam("loadBalancerListenerID") String loadBalancerListenerID,
+ final NeutronLoadBalancerListenerRequest input) {
return update(loadBalancerListenerID, input);
}
@Path("{loadBalancerListenerID}")
@DELETE
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @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 deleteLoadBalancerListener(
- @PathParam("loadBalancerListenerID") String loadBalancerListenerID) {
+ public Response deleteLoadBalancerListener(@PathParam("loadBalancerListenerID") String loadBalancerListenerID) {
return delete(loadBalancerListenerID);
}
}
import javax.xml.bind.annotation.XmlRootElement;
import org.opendaylight.neutron.spi.NeutronLoadBalancerListener;
-
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronLoadBalancerListenerRequest
- implements INeutronRequest<NeutronLoadBalancerListener> {
+public class NeutronLoadBalancerListenerRequest implements INeutronRequest<NeutronLoadBalancerListener> {
/**
* See OpenStack Network API v2.0 Reference for description of
* http://docs.openstack.org/api/openstack-network/2.0/content/
*/
- @XmlElement(name="listener")
+ @XmlElement(name = "listener")
NeutronLoadBalancerListener singletonLoadBalancerListener;
- @XmlElement(name="listeners")
+ @XmlElement(name = "listeners")
List<NeutronLoadBalancerListener> bulkRequest;
NeutronLoadBalancerListenerRequest() {
*/
@Path("/lbaas/loadbalancers")
public class NeutronLoadBalancerNorthbound
- extends AbstractNeutronNorthbound<NeutronLoadBalancer, NeutronLoadBalancerRequest, INeutronLoadBalancerCRUD> {
+ extends AbstractNeutronNorthbound<NeutronLoadBalancer, NeutronLoadBalancerRequest, INeutronLoadBalancerCRUD> {
private static final String RESOURCE_NAME = "LoadBalancer";
* Returns a list of all LoadBalancer */
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@QueryParam("limit") String limit,
@QueryParam("marker") String marker,
@QueryParam("page_reverse") String pageReverse
- // sorting not supported
+ // sorting not supported
) {
INeutronLoadBalancerCRUD loadBalancerInterface = getNeutronCRUD();
List<NeutronLoadBalancer> allLoadBalancers = loadBalancerInterface.getAll();
- List<NeutronLoadBalancer> ans = new ArrayList<NeutronLoadBalancer>();
+ List<NeutronLoadBalancer> ans = new ArrayList<>();
Iterator<NeutronLoadBalancer> i = allLoadBalancers.iterator();
while (i.hasNext()) {
NeutronLoadBalancer nsg = i.next();
- if ((queryLoadBalancerID == null ||
- queryLoadBalancerID.equals(nsg.getID())) &&
- (queryLoadBalancerTenantID == null ||
- queryLoadBalancerTenantID.equals(nsg.getTenantID())) &&
- (queryLoadBalancerName == null ||
- queryLoadBalancerName.equals(nsg.getLoadBalancerName())) &&
- (queryLoadBalancerVipAddress == null ||
- queryLoadBalancerVipAddress.equals(nsg.getLoadBalancerVipAddress())) &&
- (queryLoadBalancerVipSubnet == null ||
- queryLoadBalancerVipSubnet.equals(nsg.getLoadBalancerVipSubnetID()))) {
+ if ((queryLoadBalancerID == null || queryLoadBalancerID.equals(nsg.getID()))
+ && (queryLoadBalancerTenantID == null || queryLoadBalancerTenantID.equals(nsg.getTenantID()))
+ && (queryLoadBalancerName == null || queryLoadBalancerName.equals(nsg.getLoadBalancerName()))
+ && (queryLoadBalancerVipAddress == null
+ || queryLoadBalancerVipAddress.equals(nsg.getLoadBalancerVipAddress()))
+ && (queryLoadBalancerVipSubnet == null
+ || queryLoadBalancerVipSubnet.equals(nsg.getLoadBalancerVipSubnetID()))) {
if (fields.size() > 0) {
- ans.add(extractFields(nsg,fields));
+ ans.add(extractFields(nsg, fields));
} else {
ans.add(nsg);
}
}
}
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- new NeutronLoadBalancerRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronLoadBalancerRequest(ans)).build();
}
/**
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createLoadBalancers(final NeutronLoadBalancerRequest input) {
return create(input);
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @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 updateLoadBalancer(
- @PathParam("loadBalancerID") String loadBalancerID, final NeutronLoadBalancerRequest input) {
+ public Response updateLoadBalancer(@PathParam("loadBalancerID") String loadBalancerID,
+ final NeutronLoadBalancerRequest input) {
return update(loadBalancerID, input);
}
@Path("{loadBalancerID}")
@DELETE
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @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 deleteLoadBalancer(
- @PathParam("loadBalancerID") String loadBalancerID) {
+ public Response deleteLoadBalancer(@PathParam("loadBalancerID") String loadBalancerID) {
return delete(loadBalancerID);
}
}
import javax.xml.bind.annotation.XmlElement;
import org.opendaylight.neutron.spi.NeutronLoadBalancerPoolMember;
-public class NeutronLoadBalancerPoolMemberRequest
- implements INeutronRequest<NeutronLoadBalancerPoolMember> {
+public class NeutronLoadBalancerPoolMemberRequest implements INeutronRequest<NeutronLoadBalancerPoolMember> {
/**
* See OpenStack Network API v2.0 Reference for description of
* http://docs.openstack.org/api/openstack-network/2.0/content/
*/
- @XmlElement(name="member")
+ @XmlElement(name = "member")
NeutronLoadBalancerPoolMember singletonLoadBalancerPoolMember;
- @XmlElement(name="members")
+ @XmlElement(name = "members")
List<NeutronLoadBalancerPoolMember> bulkRequest;
NeutronLoadBalancerPoolMemberRequest() {
*/
@Path("/lbaas/pools")
-public class NeutronLoadBalancerPoolNorthbound
- extends AbstractNeutronNorthbound<NeutronLoadBalancerPool, NeutronLoadBalancerPoolRequest, INeutronLoadBalancerPoolCRUD> {
+public class NeutronLoadBalancerPoolNorthbound extends AbstractNeutronNorthbound<NeutronLoadBalancerPool,
+ NeutronLoadBalancerPoolRequest, INeutronLoadBalancerPoolCRUD> {
private static final String RESOURCE_NAME = "LoadBalancerPool";
@Override
protected INeutronLoadBalancerPoolCRUD getNeutronCRUD() {
- NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().
- fetchINeutronLoadBalancerPoolCRUD(this);
+ NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronLoadBalancerPoolCRUD(this);
if (answer.getLoadBalancerPoolInterface() == null) {
throw new ServiceUnavailableException(serviceUnavailable());
}
* */
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@QueryParam("limit") String limit,
@QueryParam("marker") String marker,
@QueryParam("page_reverse") String pageReverse
- // sorting not supported
+ // sorting not supported
) {
INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = getNeutronCRUD();
List<NeutronLoadBalancerPool> allLoadBalancerPools = loadBalancerPoolInterface.getAll();
- List<NeutronLoadBalancerPool> ans = new ArrayList<NeutronLoadBalancerPool>();
+ List<NeutronLoadBalancerPool> ans = new ArrayList<>();
Iterator<NeutronLoadBalancerPool> i = allLoadBalancerPools.iterator();
while (i.hasNext()) {
NeutronLoadBalancerPool nsg = i.next();
- if ((queryLoadBalancerPoolID == null ||
- queryLoadBalancerPoolID.equals(nsg.getID())) &&
- (queryLoadBalancerPoolTenantID == null ||
- queryLoadBalancerPoolTenantID.equals(nsg.getTenantID())) &&
- (queryLoadBalancerPoolName == null ||
- queryLoadBalancerPoolName.equals(nsg.getLoadBalancerPoolName())) &&
- (queryLoadBalancerPoolLbAlgorithm == null ||
- queryLoadBalancerPoolLbAlgorithm.equals(nsg.getLoadBalancerPoolLbAlgorithm())) &&
- (queryLoadBalancerPoolHealthMonitorID == null ||
- queryLoadBalancerPoolHealthMonitorID.equals(nsg.getNeutronLoadBalancerPoolHealthMonitorID())) &&
- (queryLoadBalancerIsAdminStateUp == null ||
- queryLoadBalancerIsAdminStateUp.equals(nsg.getLoadBalancerPoolAdminIsStateIsUp())) &&
- (queryLoadBalancerPoolMembers.size() == 0 ||
- queryLoadBalancerPoolMembers.equals(nsg.getLoadBalancerPoolMembers()))) {
+ if ((queryLoadBalancerPoolID == null || queryLoadBalancerPoolID.equals(nsg.getID()))
+ && (queryLoadBalancerPoolTenantID == null
+ || queryLoadBalancerPoolTenantID.equals(nsg.getTenantID()))
+ && (queryLoadBalancerPoolName == null
+ || queryLoadBalancerPoolName.equals(nsg.getLoadBalancerPoolName()))
+ && (queryLoadBalancerPoolLbAlgorithm == null
+ || queryLoadBalancerPoolLbAlgorithm.equals(nsg.getLoadBalancerPoolLbAlgorithm()))
+ && (queryLoadBalancerPoolHealthMonitorID == null || queryLoadBalancerPoolHealthMonitorID
+ .equals(nsg.getNeutronLoadBalancerPoolHealthMonitorID()))
+ && (queryLoadBalancerIsAdminStateUp == null
+ || queryLoadBalancerIsAdminStateUp.equals(nsg.getLoadBalancerPoolAdminIsStateIsUp()))
+ && (queryLoadBalancerPoolMembers.size() == 0
+ || queryLoadBalancerPoolMembers.equals(nsg.getLoadBalancerPoolMembers()))) {
if (fields.size() > 0) {
- ans.add(extractFields(nsg,fields));
+ ans.add(extractFields(nsg, fields));
} else {
ans.add(nsg);
}
}
}
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- new NeutronLoadBalancerPoolRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronLoadBalancerPoolRequest(ans)).build();
}
/**
@Path("{loadBalancerPoolID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@POST
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createLoadBalancerPools(final NeutronLoadBalancerPoolRequest input) {
return create(input);
@PUT
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @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 updateLoadBalancerPool(
- @PathParam("loadBalancerPoolID") String loadBalancerPoolID, final NeutronLoadBalancerPoolRequest input) {
+ public Response updateLoadBalancerPool(@PathParam("loadBalancerPoolID") String loadBalancerPoolID,
+ final NeutronLoadBalancerPoolRequest input) {
return update(loadBalancerPoolID, input);
}
@Path("{loadBalancerPoolUUID}")
@DELETE
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @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 deleteLoadBalancerPool(
- @PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID) {
+ public Response deleteLoadBalancerPool(@PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID) {
return delete(loadBalancerPoolUUID);
}
*/
@Path("{loadBalancerPoolUUID}/members")
@GET
- @Produces({MediaType.APPLICATION_JSON})
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @Produces({ MediaType.APPLICATION_JSON })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response listMembers(
@QueryParam("limit") String limit,
@QueryParam("marker") String marker,
@QueryParam("page_reverse") String pageReverse
- // sorting not supported
+ // sorting not supported
) {
INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = getNeutronCRUD();
if (!loadBalancerPoolInterface.exists(loadBalancerPoolUUID)) {
throw new ResourceNotFoundException(uuidNoExist());
}
- List<NeutronLoadBalancerPoolMember> members =
- loadBalancerPoolInterface.get(loadBalancerPoolUUID).getLoadBalancerPoolMembers();
- List<NeutronLoadBalancerPoolMember> ans = new ArrayList<NeutronLoadBalancerPoolMember>();
+ List<NeutronLoadBalancerPoolMember> members = loadBalancerPoolInterface.get(loadBalancerPoolUUID)
+ .getLoadBalancerPoolMembers();
+ List<NeutronLoadBalancerPoolMember> ans = new ArrayList<>();
Iterator<NeutronLoadBalancerPoolMember> i = members.iterator();
while (i.hasNext()) {
NeutronLoadBalancerPoolMember nsg = i.next();
- if ((queryLoadBalancerPoolMemberID == null ||
- queryLoadBalancerPoolMemberID.equals(nsg.getID())) &&
- loadBalancerPoolUUID.equals(nsg.getPoolID()) &&
- (queryLoadBalancerPoolMemberTenantID == null ||
- queryLoadBalancerPoolMemberTenantID.equals(nsg.getTenantID())) &&
- (queryLoadBalancerPoolMemberAddress == null ||
- queryLoadBalancerPoolMemberAddress.equals(nsg.getPoolMemberAddress())) &&
- (queryLoadBalancerPoolMemberAdminStateUp == null ||
- queryLoadBalancerPoolMemberAdminStateUp.equals(nsg.getPoolMemberAdminStateIsUp())) &&
- (queryLoadBalancerPoolMemberWeight == null ||
- queryLoadBalancerPoolMemberWeight.equals(nsg.getPoolMemberWeight())) &&
- (queryLoadBalancerPoolMemberSubnetID == null ||
- queryLoadBalancerPoolMemberSubnetID.equals(nsg.getPoolMemberSubnetID()))) {
+ if ((queryLoadBalancerPoolMemberID == null || queryLoadBalancerPoolMemberID.equals(nsg.getID()))
+ && loadBalancerPoolUUID.equals(nsg.getPoolID())
+ && (queryLoadBalancerPoolMemberTenantID == null
+ || queryLoadBalancerPoolMemberTenantID.equals(nsg.getTenantID()))
+ && (queryLoadBalancerPoolMemberAddress == null
+ || queryLoadBalancerPoolMemberAddress.equals(nsg.getPoolMemberAddress()))
+ && (queryLoadBalancerPoolMemberAdminStateUp == null
+ || queryLoadBalancerPoolMemberAdminStateUp.equals(nsg.getPoolMemberAdminStateIsUp()))
+ && (queryLoadBalancerPoolMemberWeight == null
+ || queryLoadBalancerPoolMemberWeight.equals(nsg.getPoolMemberWeight()))
+ && (queryLoadBalancerPoolMemberSubnetID == null
+ || queryLoadBalancerPoolMemberSubnetID.equals(nsg.getPoolMemberSubnetID()))) {
if (fields.size() > 0) {
ans.add(extractFields(nsg, fields));
} else {
}
}
}
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- new NeutronLoadBalancerPoolMemberRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronLoadBalancerPoolMemberRequest(ans)).build();
}
/**
@GET
@Produces({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackLoadBalancerPoolMembers.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
- @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
- public Response showLoadBalancerPoolMember(
- @PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ public Response showLoadBalancerPoolMember(@PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
@PathParam("loadBalancerPoolMemberUUID") String loadBalancerPoolMemberUUID,
// return fields
- @QueryParam("fields") List<String> fields ) {
+ @QueryParam("fields") List<String> fields) {
INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = getNeutronCRUD();
if (!loadBalancerPoolInterface.exists(loadBalancerPoolUUID)) {
throw new ResourceNotFoundException(uuidNoExist());
}
- List<NeutronLoadBalancerPoolMember> members =
- loadBalancerPoolInterface.get(loadBalancerPoolUUID).getLoadBalancerPoolMembers();
- for (NeutronLoadBalancerPoolMember ans: members) {
+ List<NeutronLoadBalancerPoolMember> members = loadBalancerPoolInterface.get(loadBalancerPoolUUID)
+ .getLoadBalancerPoolMembers();
+ for (NeutronLoadBalancerPoolMember ans : members) {
if (!ans.getID().equals(loadBalancerPoolMemberUUID)) {
continue;
}
if (fields.size() > 0) {
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- new NeutronLoadBalancerPoolMemberRequest(extractFields(ans, fields))).build();
+ return Response.status(HttpURLConnection.HTTP_OK)
+ .entity(new NeutronLoadBalancerPoolMemberRequest(extractFields(ans, fields))).build();
} else {
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- new NeutronLoadBalancerPoolMemberRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronLoadBalancerPoolMemberRequest(ans))
+ .build();
}
}
throw new ResourceNotFoundException(uuidNoExist());
*/
@Path("{loadBalancerPoolUUID}/members")
@POST
- @Produces({MediaType.APPLICATION_JSON})
- @Consumes({MediaType.APPLICATION_JSON})
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
- public Response createLoadBalancerPoolMember(
- @PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
+ public Response createLoadBalancerPoolMember(@PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
final NeutronLoadBalancerPoolMemberRequest input) {
INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = getNeutronCRUD();
@PUT
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found") })
- public Response updateLoadBalancerPoolMember(
- @PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
+ public Response updateLoadBalancerPoolMember(@PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
@PathParam("loadBalancerPoolMemberUUID") String loadBalancerPoolMemberUUID,
final NeutronLoadBalancerPoolMemberRequest input) {
INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = getNeutronCRUD();
if (singletonPool == null) {
throw new ResourceNotFoundException("Pool doesn't Exist");
}
- NeutronLoadBalancerPoolMember original = singletonPool.getNeutronLoadBalancerPoolMember(loadBalancerPoolMemberUUID);
+ NeutronLoadBalancerPoolMember original = singletonPool
+ .getNeutronLoadBalancerPoolMember(loadBalancerPoolMemberUUID);
- loadBalancerPoolInterface.updateNeutronLoadBalancerPoolMember(loadBalancerPoolUUID, loadBalancerPoolMemberUUID, singleton);
+ loadBalancerPoolInterface.updateNeutronLoadBalancerPoolMember(loadBalancerPoolUUID, loadBalancerPoolMemberUUID,
+ singleton);
return Response.status(HttpURLConnection.HTTP_OK).entity(input).build();
}
@Path("{loadBalancerPoolUUID}/members/{loadBalancerPoolMemberUUID}")
@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 deleteLoadBalancerPoolMember(
- @PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
+ @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 deleteLoadBalancerPoolMember(@PathParam("loadBalancerPoolUUID") String loadBalancerPoolUUID,
@PathParam("loadBalancerPoolMemberUUID") String loadBalancerPoolMemberUUID) {
INeutronLoadBalancerPoolCRUD loadBalancerPoolInterface = getNeutronCRUD();
//Verify that the LB pool member exists
NeutronLoadBalancerPoolMember singleton = null;
- List<NeutronLoadBalancerPoolMember> members =
- loadBalancerPoolInterface.get(loadBalancerPoolUUID).getLoadBalancerPoolMembers();
- for (NeutronLoadBalancerPoolMember member: members) {
+ List<NeutronLoadBalancerPoolMember> members = loadBalancerPoolInterface.get(loadBalancerPoolUUID)
+ .getLoadBalancerPoolMembers();
+ for (NeutronLoadBalancerPoolMember member : members) {
if (member.getID().equals(loadBalancerPoolMemberUUID)) {
singleton = member;
break;
import javax.xml.bind.annotation.XmlRootElement;
import org.opendaylight.neutron.spi.NeutronLoadBalancerPool;
-
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronLoadBalancerPoolRequest
- implements INeutronRequest<NeutronLoadBalancerPool> {
+public class NeutronLoadBalancerPoolRequest implements INeutronRequest<NeutronLoadBalancerPool> {
/**
* See OpenStack Network API v2.0 Reference for description of
* http://docs.openstack.org/api/openstack-network/2.0/content/
*/
- @XmlElement(name="pool")
+ @XmlElement(name = "pool")
NeutronLoadBalancerPool singletonLoadBalancerPool;
- @XmlElement(name="pools")
+ @XmlElement(name = "pools")
List<NeutronLoadBalancerPool> bulkRequest;
NeutronLoadBalancerPoolRequest() {
import javax.xml.bind.annotation.XmlRootElement;
import org.opendaylight.neutron.spi.NeutronLoadBalancer;
-
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronLoadBalancerRequest
- implements INeutronRequest<NeutronLoadBalancer> {
+public class NeutronLoadBalancerRequest implements INeutronRequest<NeutronLoadBalancer> {
/**
* See OpenStack Network API v2.0 Reference for description of
* http://docs.openstack.org/api/openstack-network/2.0/content/
*/
- @XmlElement(name="loadbalancer")
+ @XmlElement(name = "loadbalancer")
NeutronLoadBalancer singletonLoadBalancer;
- @XmlElement(name="loadbalancers")
+ @XmlElement(name = "loadbalancers")
List<NeutronLoadBalancer> bulkRequest;
NeutronLoadBalancerRequest() {
import javax.xml.bind.annotation.XmlRootElement;
import org.opendaylight.neutron.spi.NeutronMeteringLabel;
-
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronMeteringLabelRequest
- implements INeutronRequest<NeutronMeteringLabel> {
+public class NeutronMeteringLabelRequest implements INeutronRequest<NeutronMeteringLabel> {
// See OpenStack Network API v2.0 Reference for description of
// annotated attributes
- @XmlElement(name="metering_label")
+ @XmlElement(name = "metering_label")
NeutronMeteringLabel singletonMeteringLabel;
- @XmlElement(name="metering_labels")
+ @XmlElement(name = "metering_labels")
List<NeutronMeteringLabel> bulkMeteringLabels;
NeutronMeteringLabelRequest() {
import javax.xml.bind.annotation.XmlRootElement;
import org.opendaylight.neutron.spi.NeutronMeteringLabelRule;
-
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronMeteringLabelRuleRequest
- implements INeutronRequest<NeutronMeteringLabelRule> {
+public class NeutronMeteringLabelRuleRequest implements INeutronRequest<NeutronMeteringLabelRule> {
// See OpenStack Network API v2.0 Reference for description of
// annotated attributes
- @XmlElement(name="metering_label_rule")
+ @XmlElement(name = "metering_label_rule")
NeutronMeteringLabelRule singletonMeteringLabelRule;
- @XmlElement(name="metering_label_rules")
+ @XmlElement(name = "metering_label_rules")
List<NeutronMeteringLabelRule> bulkMeteringLabelRules;
NeutronMeteringLabelRuleRequest() {
*/
@Path("/metering/metering-label-rules")
-public class NeutronMeteringLabelRulesNorthbound
- extends AbstractNeutronNorthbound<NeutronMeteringLabelRule, NeutronMeteringLabelRuleRequest, INeutronMeteringLabelRuleCRUD> {
+public class NeutronMeteringLabelRulesNorthbound extends AbstractNeutronNorthbound<NeutronMeteringLabelRule,
+ NeutronMeteringLabelRuleRequest, INeutronMeteringLabelRuleCRUD> {
private static final String RESOURCE_NAME = "Metering Label Rule";
@Override
@GET
@Produces({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackNetworks.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@QueryParam("direction") String queryDirection,
@QueryParam("remote_ip_prefix") String queryRemoteIPPrefix,
@QueryParam("metering_label_id") String queryLabelID
- // pagination and sorting are TODO
- ) {
+ // pagination and sorting are TODO
+ ) {
INeutronMeteringLabelRuleCRUD ruleInterface = getNeutronCRUD();
List<NeutronMeteringLabelRule> allNeutronMeteringLabelRule = ruleInterface.getAll();
- List<NeutronMeteringLabelRule> ans = new ArrayList<NeutronMeteringLabelRule>();
+ List<NeutronMeteringLabelRule> ans = new ArrayList<>();
Iterator<NeutronMeteringLabelRule> i = allNeutronMeteringLabelRule.iterator();
while (i.hasNext()) {
NeutronMeteringLabelRule oSS = i.next();
- if ((queryID == null || queryID.equals(oSS.getID())) &&
- (queryDirection == null || queryDirection.equals(oSS.getMeteringLabelRuleDirection())) &&
- (queryRemoteIPPrefix == null || queryRemoteIPPrefix.equals(oSS.getMeteringLabelRuleRemoteIPPrefix())) &&
- (queryLabelID == null || queryLabelID.equals(oSS.getMeteringLabelRuleLabelID()))) {
+ if ((queryID == null || queryID.equals(oSS.getID()))
+ && (queryDirection == null || queryDirection.equals(oSS.getMeteringLabelRuleDirection()))
+ && (queryRemoteIPPrefix == null
+ || queryRemoteIPPrefix.equals(oSS.getMeteringLabelRuleRemoteIPPrefix()))
+ && (queryLabelID == null || queryLabelID.equals(oSS.getMeteringLabelRuleLabelID()))) {
if (fields.size() > 0) {
- ans.add(extractFields(oSS,fields));
+ ans.add(extractFields(oSS, fields));
} else {
ans.add(oSS);
}
}
}
//TODO: apply pagination to results
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- new NeutronMeteringLabelRuleRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronMeteringLabelRuleRequest(ans)).build();
}
/**
@Path("{ruleUUID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
- public Response showMeteringLabelRule(
- @PathParam("ruleUUID") String ruleUUID,
+ public Response showMeteringLabelRule(@PathParam("ruleUUID") String ruleUUID,
// return fields
@QueryParam("fields") List<String> fields) {
return show(ruleUUID, fields);
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
//@TypeHint(NeutronNetwork.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createMeteringLabelRule(final NeutronMeteringLabelRuleRequest input) {
INeutronMeteringLabelRuleCRUD meteringLabelRuleInterface = getNeutronCRUD();
@Path("{ruleUUID}")
@DELETE
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @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 deleteMeteringLabelRule(
- @PathParam("ruleUUID") String ruleUUID) {
+ public Response deleteMeteringLabelRule(@PathParam("ruleUUID") String ruleUUID) {
return delete(ruleUUID);
}
}
*/
@Path("/metering/metering-labels")
-public class NeutronMeteringLabelsNorthbound
- extends AbstractNeutronNorthbound<NeutronMeteringLabel, NeutronMeteringLabelRequest, INeutronMeteringLabelCRUD> {
+public class NeutronMeteringLabelsNorthbound extends
+ AbstractNeutronNorthbound<NeutronMeteringLabel, NeutronMeteringLabelRequest, INeutronMeteringLabelCRUD> {
private static final String RESOURCE_NAME = "Metering Label";
@Override
@GET
@Produces({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackNetworks.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@QueryParam("id") String queryID,
@QueryParam("name") String queryName,
@QueryParam("tenant_id") String queryTenantID
- // pagination and sorting are TODO
- ) {
+ // pagination and sorting are TODO
+ ) {
INeutronMeteringLabelCRUD labelInterface = getNeutronCRUD();
List<NeutronMeteringLabel> allNeutronMeteringLabel = labelInterface.getAll();
- List<NeutronMeteringLabel> ans = new ArrayList<NeutronMeteringLabel>();
+ List<NeutronMeteringLabel> ans = new ArrayList<>();
Iterator<NeutronMeteringLabel> i = allNeutronMeteringLabel.iterator();
while (i.hasNext()) {
NeutronMeteringLabel oSS = i.next();
- if ((queryID == null || queryID.equals(oSS.getID())) &&
- (queryName == null || queryName.equals(oSS.getMeteringLabelName())) &&
- (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
+ if ((queryID == null || queryID.equals(oSS.getID()))
+ && (queryName == null || queryName.equals(oSS.getMeteringLabelName()))
+ && (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
if (fields.size() > 0) {
- ans.add(extractFields(oSS,fields));
+ ans.add(extractFields(oSS, fields));
} else {
ans.add(oSS);
}
}
}
//TODO: apply pagination to results
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- new NeutronMeteringLabelRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronMeteringLabelRequest(ans)).build();
}
/**
@Path("{labelUUID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
- public Response showMeteringLabel(
- @PathParam("labelUUID") String labelUUID,
+ public Response showMeteringLabel(@PathParam("labelUUID") String labelUUID,
// return fields
@QueryParam("fields") List<String> fields) {
return show(labelUUID, fields);
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
//@TypeHint(NeutronNetwork.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createMeteringLabel(final NeutronMeteringLabelRequest input) {
return create(input);
@Path("{labelUUID}")
@DELETE
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @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 deleteMeteringLabel(
- @PathParam("labelUUID") String labelUUID) {
+ public Response deleteMeteringLabel(@PathParam("labelUUID") String labelUUID) {
return delete(labelUUID);
}
}
// See OpenStack Network API v2.0 Reference for description of
// annotated attributes
- @XmlElement(name="network")
+ @XmlElement(name = "network")
NeutronNetwork singletonNetwork;
- @XmlElement(name="networks")
+ @XmlElement(name = "networks")
List<NeutronNetwork> bulkRequest;
- @XmlElement(name="networks_links")
+ @XmlElement(name = "networks_links")
List<NeutronPageLink> links;
NeutronNetworkRequest() {
@Path("/networks")
public class NeutronNetworksNorthbound
- extends AbstractNeutronNorthbound<NeutronNetwork, NeutronNetworkRequest, INeutronNetworkCRUD> {
+ extends AbstractNeutronNorthbound<NeutronNetwork, NeutronNetworkRequest, INeutronNetworkCRUD> {
@Context
UriInfo uriInfo;
@GET
@Produces({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackNetworks.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
- @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response listNetworks(
// return fields
@QueryParam("fields") List<String> fields,
@QueryParam("limit") Integer limit,
@QueryParam("marker") String marker,
@DefaultValue("false") @QueryParam("page_reverse") Boolean pageReverse
- // sorting not supported
- ) {
+ // sorting not supported
+ ) {
INeutronNetworkCRUD networkInterface = getNeutronCRUD();
List<NeutronNetwork> allNetworks = networkInterface.getAll();
- List<NeutronNetwork> ans = new ArrayList<NeutronNetwork>();
+ List<NeutronNetwork> ans = new ArrayList<>();
Iterator<NeutronNetwork> i = allNetworks.iterator();
while (i.hasNext()) {
NeutronNetwork oSN = i.next();
if (queryRouterExternal != null) {
bRouterExternal = Boolean.valueOf(queryRouterExternal);
}
- if ((queryID == null || queryID.equals(oSN.getID())) &&
- (queryName == null || queryName.equals(oSN.getNetworkName())) &&
- (bAdminStateUp == null || bAdminStateUp.booleanValue() == oSN.isAdminStateUp()) &&
- (queryStatus == null || queryStatus.equals(oSN.getStatus())) &&
- (bShared == null || bShared.booleanValue() == oSN.isShared()) &&
- (bRouterExternal == null || bRouterExternal.booleanValue() == oSN.isRouterExternal()) &&
- (queryTenantID == null || queryTenantID.equals(oSN.getTenantID())) &&
- (queryQosPolicyId == null || queryQosPolicyId.equals(oSN.getQosPolicyId()))) {
+ if ((queryID == null || queryID.equals(oSN.getID()))
+ && (queryName == null || queryName.equals(oSN.getNetworkName()))
+ && (bAdminStateUp == null || bAdminStateUp.booleanValue() == oSN.isAdminStateUp())
+ && (queryStatus == null || queryStatus.equals(oSN.getStatus()))
+ && (bShared == null || bShared.booleanValue() == oSN.isShared())
+ && (bRouterExternal == null || bRouterExternal.booleanValue() == oSN.isRouterExternal())
+ && (queryTenantID == null || queryTenantID.equals(oSN.getTenantID()))
+ && (queryQosPolicyId == null || queryQosPolicyId.equals(oSN.getQosPolicyId()))) {
if (fields.size() > 0) {
- ans.add(extractFields(oSN,fields));
+ ans.add(extractFields(oSN, fields));
} else {
ans.add(oSN);
}
if (limit != null && ans.size() > 1) {
// Return a paginated request
- NeutronNetworkRequest request = (NeutronNetworkRequest) PaginatedRequestFactory.createRequest(limit,
- marker, pageReverse, uriInfo, ans, NeutronNetwork.class);
+ NeutronNetworkRequest request = (NeutronNetworkRequest) PaginatedRequestFactory.createRequest(limit, marker,
+ pageReverse, uriInfo, ans, NeutronNetwork.class);
return Response.status(HttpURLConnection.HTTP_OK).entity(request).build();
}
- return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronNetworkRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronNetworkRequest(ans)).build();
}
@GET
@Produces({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackNetworks.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
- @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
- @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
- public Response showNetwork(
- @PathParam("netUUID") String netUUID,
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ public Response showNetwork(@PathParam("netUUID") String netUUID,
// return fields
- @QueryParam("fields") List<String> fields
- ) {
+ @QueryParam("fields") List<String> fields) {
return show(netUUID, fields);
}
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
@TypeHint(NeutronNetwork.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createNetworks(final NeutronNetworkRequest input) {
return create(input);
}
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackNetworks.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 updateNetwork(
- @PathParam("netUUID") String netUUID, final NeutronNetworkRequest input
- ) {
+ @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 updateNetwork(@PathParam("netUUID") String netUUID, final NeutronNetworkRequest input) {
return update(netUUID, input);
}
@Path("{netUUID}")
@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 deleteNetwork(
- @PathParam("netUUID") String netUUID) {
+ @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 deleteNetwork(@PathParam("netUUID") String netUUID) {
return delete(netUUID);
}
}
import javax.ws.rs.core.Application;
import org.eclipse.persistence.jaxb.rs.MOXyJsonProvider;
-
/**
* This class is an instance of javax.ws.rs.core.Application and is used to return the classes
* that will be instantiated for JAXRS processing. This is necessary
@Override
public Set<Class<?>> getClasses() {
Set<Class<?>> classes = new HashSet<Class<?>>();
-// northbound URIs
+ // northbound URIs
classes.add(NeutronNetworksNorthbound.class);
classes.add(NeutronSubnetsNorthbound.class);
classes.add(NeutronPortsNorthbound.class);
public class NeutronPageLink {
- @XmlElement(name="ref")
+ @XmlElement(name = "ref")
String ref;
- @XmlElement (name="href")
+ @XmlElement(name = "href")
String href;
public String getRef() {
// See OpenStack Network API v2.0 Reference for description of
// annotated attributes
- @XmlElement(name="port")
+ @XmlElement(name = "port")
NeutronPort singletonPort;
- @XmlElement(name="ports")
+ @XmlElement(name = "ports")
List<NeutronPort> bulkRequest;
- @XmlElement(name="ports_links")
+ @XmlElement(name = "ports_links")
List<NeutronPageLink> links;
NeutronPortRequest() {
@Path("/ports")
public class NeutronPortsNorthbound
- extends AbstractNeutronNorthbound<NeutronPort, NeutronPortRequest, INeutronPortCRUD> {
+ extends AbstractNeutronNorthbound<NeutronPort, NeutronPortRequest, INeutronPortCRUD> {
private static final String RESOURCE_NAME = "Port";
throw new ServiceUnavailableException(serviceUnavailable());
}
if (needNetworks) {
- answer = answer.fetchINeutronNetworkCRUD( this);
+ answer = answer.fetchINeutronNetworkCRUD(this);
if (answer.getNetworkInterface() == null) {
- throw new ServiceUnavailableException("Network CRUD Interface "
- + RestMessages.SERVICEUNAVAILABLE.toString());
+ throw new ServiceUnavailableException(
+ "Network CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString());
}
}
if (needSubnets) {
- answer = answer.fetchINeutronSubnetCRUD( this);
+ answer = answer.fetchINeutronSubnetCRUD(this);
if (answer.getSubnetInterface() == null) {
- throw new ServiceUnavailableException("Subnet CRUD Interface "
- + RestMessages.SERVICEUNAVAILABLE.toString());
+ throw new ServiceUnavailableException(
+ "Subnet CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString());
}
}
return answer;
@GET
@Produces({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackPorts.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
- @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response listPorts(
// return fields
@QueryParam("fields") List<String> fields,
@QueryParam("limit") Integer limit,
@QueryParam("marker") String marker,
@DefaultValue("false") @QueryParam("page_reverse") Boolean pageReverse
- // sorting not supported
- ) {
+ // sorting not supported
+ ) {
INeutronPortCRUD portInterface = getNeutronInterfaces(false, false).getPortInterface();
List<NeutronPort> allPorts = portInterface.getAll();
- List<NeutronPort> ans = new ArrayList<NeutronPort>();
+ List<NeutronPort> ans = new ArrayList<>();
Iterator<NeutronPort> i = allPorts.iterator();
while (i.hasNext()) {
NeutronPort oSS = i.next();
- if ((queryID == null || queryID.equals(oSS.getID())) &&
- (queryNetworkID == null || queryNetworkID.equals(oSS.getNetworkUUID())) &&
- (queryName == null || queryName.equals(oSS.getName())) &&
- (queryAdminStateUp == null || queryAdminStateUp.equals(oSS.getAdminStateUp())) &&
- (queryStatus == null || queryStatus.equals(oSS.getStatus())) &&
- (queryMACAddress == null || queryMACAddress.equals(oSS.getMacAddress())) &&
- (queryDeviceID == null || queryDeviceID.equals(oSS.getDeviceID())) &&
- (queryDeviceOwner == null || queryDeviceOwner.equals(oSS.getDeviceOwner())) &&
- (queryTenantID == null || queryTenantID.equals(oSS.getTenantID())) &&
- (queryPortSecurityEnabled == null || queryPortSecurityEnabled.equals(oSS.getPortSecurityEnabled())) &&
- (queryQosPolicyId == null || queryQosPolicyId.equals(oSS.getQosPolicyId()))) {
+ if ((queryID == null || queryID.equals(oSS.getID()))
+ && (queryNetworkID == null || queryNetworkID.equals(oSS.getNetworkUUID()))
+ && (queryName == null || queryName.equals(oSS.getName()))
+ && (queryAdminStateUp == null || queryAdminStateUp.equals(oSS.getAdminStateUp()))
+ && (queryStatus == null || queryStatus.equals(oSS.getStatus()))
+ && (queryMACAddress == null || queryMACAddress.equals(oSS.getMacAddress()))
+ && (queryDeviceID == null || queryDeviceID.equals(oSS.getDeviceID()))
+ && (queryDeviceOwner == null || queryDeviceOwner.equals(oSS.getDeviceOwner()))
+ && (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))
+ && (queryPortSecurityEnabled == null
+ || queryPortSecurityEnabled.equals(oSS.getPortSecurityEnabled()))
+ && (queryQosPolicyId == null || queryQosPolicyId.equals(oSS.getQosPolicyId()))) {
if (fields.size() > 0) {
- ans.add(extractFields(oSS,fields));
+ ans.add(extractFields(oSS, fields));
} else {
ans.add(oSS);
}
if (limit != null && ans.size() > 1) {
// Return a paginated request
- NeutronPortRequest request = (NeutronPortRequest) PaginatedRequestFactory.createRequest(limit,
- marker, pageReverse, uriInfo, ans, NeutronPort.class);
+ NeutronPortRequest request = (NeutronPortRequest) PaginatedRequestFactory.createRequest(limit, marker,
+ pageReverse, uriInfo, ans, NeutronPort.class);
return Response.status(HttpURLConnection.HTTP_OK).entity(request).build();
}
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- new NeutronPortRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronPortRequest(ans)).build();
}
/**
@GET
@Produces({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackPorts.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
- @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
- @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
- public Response showPort(
- @PathParam("portUUID") String portUUID,
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ public Response showPort(@PathParam("portUUID") String portUUID,
// return fields
- @QueryParam("fields") List<String> fields ) {
+ @QueryParam("fields") List<String> fields) {
return show(portUUID, fields);
}
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackPorts.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createPorts(final NeutronPortRequest input) {
getNeutronInterfaces(true, true); // Ensure that services for networks and subnets are loaded
return create(input);
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
//@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,
- NeutronPortRequest input
- ) {
+ @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, NeutronPortRequest input) {
// TODO: Support change of security groups
// update the port and return the modified object
return update(portUUID, input);
@Path("{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) {
+ @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) {
return delete(portUUID);
}
}
import org.opendaylight.neutron.spi.NeutronQosPolicy;
@Path("/qos/policies")
-public class NeutronQosPolicyNorthbound extends
- AbstractNeutronNorthbound<NeutronQosPolicy, NeutronQosPolicyRequest, INeutronQosPolicyCRUD> {
+public class NeutronQosPolicyNorthbound
+ extends AbstractNeutronNorthbound<NeutronQosPolicy, NeutronQosPolicyRequest, INeutronQosPolicyCRUD> {
private static final String RESOURCE_NAME = "Qos Policy";
*/
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
- @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response listGroups(
- // return fields
- @QueryParam("fields") List<String> fields,
- // OpenStack qos Policy attributes
- @QueryParam("id") String queryQosPolicyUUID,
- @QueryParam("tenant_id") String queryQosPolicyTenantID,
- @QueryParam("name") String queryQosPolicyName,
- @QueryParam("shared") Boolean queryQosPolicyIsShared,
- // pagination
- @QueryParam("limit") String limit,
- @QueryParam("marker") String marker,
- @QueryParam("page_reverse") String pageReverse) {
+ // return fields
+ @QueryParam("fields") List<String> fields,
+ // OpenStack qos Policy attributes
+ @QueryParam("id") String queryQosPolicyUUID,
+ @QueryParam("tenant_id") String queryQosPolicyTenantID,
+ @QueryParam("name") String queryQosPolicyName,
+ @QueryParam("shared") Boolean queryQosPolicyIsShared,
+ // pagination
+ @QueryParam("limit") String limit,
+ @QueryParam("marker") String marker,
+ @QueryParam("page_reverse") String pageReverse) {
INeutronQosPolicyCRUD qosPolicyInterface = getNeutronCRUD();
List<NeutronQosPolicy> ans = new ArrayList<>();
for (NeutronQosPolicy nsg : qosPolicyInterface.getAll()) {
- if ((queryQosPolicyUUID == null || queryQosPolicyUUID.equals(nsg.getID())) &&
- (queryQosPolicyTenantID == null || queryQosPolicyTenantID.equals(nsg.getTenantID())) &&
- (queryQosPolicyName == null || queryQosPolicyName.equals(nsg.getQosPolicyName())) &&
- (queryQosPolicyIsShared == null || queryQosPolicyIsShared.equals(nsg.getPolicyIsShared()))) {
+ if ((queryQosPolicyUUID == null || queryQosPolicyUUID.equals(nsg.getID()))
+ && (queryQosPolicyTenantID == null || queryQosPolicyTenantID.equals(nsg.getTenantID()))
+ && (queryQosPolicyName == null || queryQosPolicyName.equals(nsg.getQosPolicyName()))
+ && (queryQosPolicyIsShared == null || queryQosPolicyIsShared.equals(nsg.getPolicyIsShared()))) {
if (fields.size() > 0) {
ans.add(extractFields(nsg, fields));
} else {
}
}
}
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- new NeutronQosPolicyRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronQosPolicyRequest(ans)).build();
}
/**
@Path("{qosPolicyUUID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
- @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
- @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
- public Response showQosPolicy(
- @PathParam("qosPolicyUUID") String qosPolicyUUID,
- @QueryParam("fields") List<String> fields) {
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ public Response showQosPolicy(@PathParam("qosPolicyUUID") String qosPolicyUUID,
+ @QueryParam("fields") List<String> fields) {
return show(qosPolicyUUID, fields);
}
@POST
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
- @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createQosPolicies(final NeutronQosPolicyRequest input) {
return create(input);
}
@PUT
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @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 updateQosPolicy(
- @PathParam("qosPolicyUUID") String qosPolicyUUID,
- final NeutronQosPolicyRequest input) {
+ @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 updateQosPolicy(@PathParam("qosPolicyUUID") String qosPolicyUUID,
+ final NeutronQosPolicyRequest input) {
return update(qosPolicyUUID, input);
}
*/
@Path("{qosPolicyUUID}")
@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 deleteQosPolicy(
- @PathParam("qosPolicyUUID") String qosPolicyUUID) {
+ @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 deleteQosPolicy(@PathParam("qosPolicyUUID") String qosPolicyUUID) {
return delete(qosPolicyUUID);
}
}
import javax.xml.bind.annotation.XmlRootElement;
import org.opendaylight.neutron.spi.NeutronRouter;
-
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronRouterRequest
- implements INeutronRequest<NeutronRouter> {
+public class NeutronRouterRequest implements INeutronRequest<NeutronRouter> {
// See OpenStack Network API v2.0 Reference for description of
// annotated attributes
- @XmlElement(name="router")
+ @XmlElement(name = "router")
NeutronRouter singletonRouter;
- @XmlElement(name="routers")
+ @XmlElement(name = "routers")
List<NeutronRouter> bulkRequest;
NeutronRouterRequest() {
import org.opendaylight.neutron.spi.NeutronRouter;
import org.opendaylight.neutron.spi.NeutronRouter_Interface;
-
/**
* Neutron Northbound REST APIs.<br>
* This class provides REST APIs for managing neutron routers
@Path("/routers")
public class NeutronRoutersNorthbound
- extends AbstractNeutronNorthbound<NeutronRouter, NeutronRouterRequest, INeutronRouterCRUD> {
+ extends AbstractNeutronNorthbound<NeutronRouter, NeutronRouterRequest, INeutronRouterCRUD> {
static final String ROUTER_INTERFACE_STR = "network:router_interface";
static final String ROUTER_GATEWAY_STR = "network:router_gateway";
private static final String RESOURCE_NAME = "Router";
if (flag) {
answer = answer.fetchINeutronNetworkCRUD(this);
if (answer.getNetworkInterface() == null) {
- throw new ServiceUnavailableException("Network CRUD Interface "
- + RestMessages.SERVICEUNAVAILABLE.toString());
+ throw new ServiceUnavailableException(
+ "Network CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString());
}
}
return answer;
}
answer = answer.fetchINeutronPortCRUD(this).fetchINeutronSubnetCRUD(this);
if (answer.getPortInterface() == null) {
- throw new ServiceUnavailableException("Port CRUD Interface "
- + RestMessages.SERVICEUNAVAILABLE.toString());
+ throw new ServiceUnavailableException("Port CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString());
}
if (answer.getSubnetInterface() == null) {
- throw new ServiceUnavailableException("Subnet CRUD Interface "
- + RestMessages.SERVICEUNAVAILABLE.toString());
+ throw new ServiceUnavailableException(
+ "Subnet CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString());
}
return answer;
}
@GET
@Produces({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackRouters.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@QueryParam("limit") String limit,
@QueryParam("marker") String marker,
@QueryParam("page_reverse") String pageReverse
- // sorting not supported
- ) {
+ // sorting not supported
+ ) {
INeutronRouterCRUD routerInterface = getNeutronInterfaces(false).getRouterInterface();
if (routerInterface == null) {
throw new ServiceUnavailableException(serviceUnavailable());
}
List<NeutronRouter> allRouters = routerInterface.getAll();
- List<NeutronRouter> ans = new ArrayList<NeutronRouter>();
+ List<NeutronRouter> ans = new ArrayList<>();
Iterator<NeutronRouter> i = allRouters.iterator();
while (i.hasNext()) {
NeutronRouter oSS = i.next();
- if ((queryID == null || queryID.equals(oSS.getID())) &&
- (queryName == null || queryName.equals(oSS.getName())) &&
- (queryAdminStateUp == null || queryAdminStateUp.equals(oSS.getAdminStateUp())) &&
- (queryStatus == null || queryStatus.equals(oSS.getStatus())) &&
- (queryExternalGatewayInfo == null || queryExternalGatewayInfo.equals(oSS.getExternalGatewayInfo())) &&
- (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
+ if ((queryID == null || queryID.equals(oSS.getID()))
+ && (queryName == null || queryName.equals(oSS.getName()))
+ && (queryAdminStateUp == null || queryAdminStateUp.equals(oSS.getAdminStateUp()))
+ && (queryStatus == null || queryStatus.equals(oSS.getStatus()))
+ && (queryExternalGatewayInfo == null
+ || queryExternalGatewayInfo.equals(oSS.getExternalGatewayInfo()))
+ && (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
if (fields.size() > 0) {
- ans.add(extractFields(oSS,fields));
+ ans.add(extractFields(oSS, fields));
} else {
ans.add(oSS);
}
}
}
//TODO: apply pagination to results
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- new NeutronRouterRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronRouterRequest(ans)).build();
}
/**
@GET
@Produces({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackRouters.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
- public Response showRouter(
- @PathParam("routerUUID") String routerUUID,
+ public Response showRouter(@PathParam("routerUUID") String routerUUID,
// return fields
@QueryParam("fields") List<String> fields) {
return show(routerUUID, fields);
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackRouters.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createRouters(final NeutronRouterRequest input) {
getNeutronInterfaces(true); // ensure that network service is loaded
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackRouters.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @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 updateRouter(
- @PathParam("routerUUID") String routerUUID,
- NeutronRouterRequest input
- ) {
+ public Response updateRouter(@PathParam("routerUUID") String routerUUID, NeutronRouterRequest input) {
getNeutronInterfaces(true); // ensure that network service is loaded
return update(routerUUID, input);
}
@Path("{routerUUID}")
@DELETE
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @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 deleteRouter(
- @PathParam("routerUUID") String routerUUID) {
+ public Response deleteRouter(@PathParam("routerUUID") String routerUUID) {
return delete(routerUUID);
}
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackRouterInterfaces.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful") })
- public Response addRouterInterface(
- @PathParam("routerUUID") String routerUUID,
- NeutronRouter_Interface input
- ) {
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful") })
+ public Response addRouterInterface(@PathParam("routerUUID") String routerUUID, NeutronRouter_Interface input) {
// Do nothing. Keep this interface for compatibility
return Response.status(HttpURLConnection.HTTP_OK).entity(input).build();
}
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackRouterInterfaces.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful") })
- public Response removeRouterInterface(
- @PathParam("routerUUID") String routerUUID,
- NeutronRouter_Interface input
- ) {
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful") })
+ public Response removeRouterInterface(@PathParam("routerUUID") String routerUUID, NeutronRouter_Interface input) {
// Do nothing. Keep this interface for compatibility
return Response.status(HttpURLConnection.HTTP_OK).entity(input).build();
}
// See OpenStack Networking SFC (networking-sfc) API v1.0 Reference for description of
// annotated attributes
- @XmlElement(name="flowclassifier")
+ @XmlElement(name = "flowclassifier")
NeutronSFCFlowClassifier singletonSFCFlowClassifier;
- @XmlElement(name="flowclassifiers")
+ @XmlElement(name = "flowclassifiers")
List<NeutronSFCFlowClassifier> bulkRequest;
NeutronSFCFlowClassifierRequest() {
*/
@Path("/sfc/flowclassifiers")
-public class NeutronSFCFlowClassifiersNorthbound
- extends AbstractNeutronNorthbound<NeutronSFCFlowClassifier,
- NeutronSFCFlowClassifierRequest,INeutronSFCFlowClassifierCRUD>{
+public class NeutronSFCFlowClassifiersNorthbound extends AbstractNeutronNorthbound<NeutronSFCFlowClassifier,
+ NeutronSFCFlowClassifierRequest, INeutronSFCFlowClassifierCRUD> {
private static final String RESOURCE_NAME = "Sfc Flow Classifier";
@Override
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@QueryParam("source_ip_prefix") String querySourceIpPrefix,
@QueryParam("destination_ip_prefix") String queryDestinationIpPrefix,
@QueryParam("logical_source_port") String queryLogicalSourcePort,
- @QueryParam("logical_destination_port") String queryLogicalDestinationPort
- ) {
+ @QueryParam("logical_destination_port") String queryLogicalDestinationPort) {
INeutronSFCFlowClassifierCRUD sfcFlowClassifierInterface = getNeutronCRUD();
List<NeutronSFCFlowClassifier> allSFCFlowClassifier = sfcFlowClassifierInterface.getAll();
List<NeutronSFCFlowClassifier> ans = new ArrayList<>();
Iterator<NeutronSFCFlowClassifier> i = allSFCFlowClassifier.iterator();
while (i.hasNext()) {
NeutronSFCFlowClassifier oSFC = i.next();
- if ((queryID == null || queryID.equals(oSFC.getID())) &&
- (queryName == null || queryName.equals(oSFC.getName())) &&
- (queryEthertype == null || queryEthertype.equals(oSFC.getEthertype())) &&
- (queryProtocol == null || queryProtocol.equals(oSFC.getProtocol())) &&
- (querySourcePortRangeMin == null || querySourcePortRangeMin.equals(oSFC.getSourcePortRangeMin())) &&
- (querySourcePortRangeMax == null || querySourcePortRangeMax.equals(oSFC.getSourcePortRangeMax())) &&
- (queryDestinationPortRangeMin == null
- || queryDestinationPortRangeMin.equals(oSFC.getDestinationPortRangeMin())) &&
- (queryDestinationPortRangeMax == null
- || queryDestinationPortRangeMax.equals(oSFC.getDestinationPortRangeMax())) &&
- (querySourceIpPrefix == null || querySourceIpPrefix.equals(oSFC.getSourceIpPrefix())) &&
- (queryDestinationIpPrefix == null || queryDestinationIpPrefix.equals(oSFC.getDestinationIpPrefix())) &&
- (queryLogicalSourcePort == null || queryLogicalSourcePort.equals(oSFC.getLogicalSourcePortUUID())) &&
- (queryLogicalDestinationPort == null || queryLogicalDestinationPort.equals(oSFC.getLogicalDestinationPortUUID())) &&
- (queryTenantID == null || queryTenantID.equals(oSFC.getTenantID()))) {
+ if ((queryID == null || queryID.equals(oSFC.getID()))
+ && (queryName == null || queryName.equals(oSFC.getName()))
+ && (queryEthertype == null || queryEthertype.equals(oSFC.getEthertype()))
+ && (queryProtocol == null || queryProtocol.equals(oSFC.getProtocol()))
+ && (querySourcePortRangeMin == null || querySourcePortRangeMin.equals(oSFC.getSourcePortRangeMin()))
+ && (querySourcePortRangeMax == null || querySourcePortRangeMax.equals(oSFC.getSourcePortRangeMax()))
+ && (queryDestinationPortRangeMin == null
+ || queryDestinationPortRangeMin.equals(oSFC.getDestinationPortRangeMin()))
+ && (queryDestinationPortRangeMax == null
+ || queryDestinationPortRangeMax.equals(oSFC.getDestinationPortRangeMax()))
+ && (querySourceIpPrefix == null || querySourceIpPrefix.equals(oSFC.getSourceIpPrefix()))
+ && (queryDestinationIpPrefix == null
+ || queryDestinationIpPrefix.equals(oSFC.getDestinationIpPrefix()))
+ && (queryLogicalSourcePort == null
+ || queryLogicalSourcePort.equals(oSFC.getLogicalSourcePortUUID()))
+ && (queryLogicalDestinationPort == null
+ || queryLogicalDestinationPort.equals(oSFC.getLogicalDestinationPortUUID()))
+ && (queryTenantID == null || queryTenantID.equals(oSFC.getTenantID()))) {
if (fields.size() > 0) {
- ans.add(extractFields(oSFC,fields));
+ ans.add(extractFields(oSFC, fields));
} else {
ans.add(oSFC);
}
@Path("{flowClassifierUUID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
- public Response showSFCFlowClassifier(
- @PathParam("flowClassifierUUID") String sfcFlowClassifierUUID,
+ public Response showSFCFlowClassifier(@PathParam("flowClassifierUUID") String sfcFlowClassifierUUID,
// return fields
- @QueryParam("fields") List<String> fields
- ) {
+ @QueryParam("fields") List<String> fields) {
return show(sfcFlowClassifierUUID, fields);
}
@POST
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createSFCFlowClassifier(final NeutronSFCFlowClassifierRequest input) {
return create(input);
@PUT
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @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 updateSFCFlowClassifier(
- @PathParam("flowClassifierUUID") String sfcFlowClassifierUUID, final NeutronSFCFlowClassifierRequest input
- ) {
+ public Response updateSFCFlowClassifier(@PathParam("flowClassifierUUID") String sfcFlowClassifierUUID,
+ final NeutronSFCFlowClassifierRequest input) {
return update(sfcFlowClassifierUUID, input);
}
* Deletes the SFC Flow Classifier */
@Path("{flowClassifierUUID}")
@DELETE
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @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 deleteSFCFlowClassifier(
- @PathParam("flowClassifierUUID") String sfcFlowClassifierUUID) {
+ public Response deleteSFCFlowClassifier(@PathParam("flowClassifierUUID") String sfcFlowClassifierUUID) {
return delete(sfcFlowClassifierUUID);
}
}
// See OpenStack Networking SFC (networking-sfc) Port Chain API v1.0 Reference
// for description of annotated attributes
- @XmlElement(name="portchain")
+ @XmlElement(name = "portchain")
NeutronSFCPortChain singletonPortChain;
- @XmlElement(name="portchains")
+ @XmlElement(name = "portchains")
List<NeutronSFCPortChain> bulkRequest;
NeutronSFCPortChainRequest() {
@Path("/sfc/portchains")
public class NeutronSFCPortChainsNorthbound
- extends AbstractNeutronNorthbound<NeutronSFCPortChain,
- NeutronSFCPortChainRequest, INeutronSFCPortChainCRUD> {
+ extends AbstractNeutronNorthbound<NeutronSFCPortChain, NeutronSFCPortChainRequest, INeutronSFCPortChainCRUD> {
private static final String RESOURCE_NAME = "Sfc Port Chain";
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
Iterator<NeutronSFCPortChain> i = allSFCPortChain.iterator();
while (i.hasNext()) {
NeutronSFCPortChain oSFCPC = i.next();
- if ((queryID == null || queryID.equals(oSFCPC.getID())) &&
- (queryName == null || queryName.equals(oSFCPC.getName())) &&
- (queryTenantID == null || queryTenantID.equals(oSFCPC.getTenantID()))) {
+ if ((queryID == null || queryID.equals(oSFCPC.getID()))
+ && (queryName == null || queryName.equals(oSFCPC.getName()))
+ && (queryTenantID == null || queryTenantID.equals(oSFCPC.getTenantID()))) {
if (fields.size() > 0) {
- ans.add(extractFields(oSFCPC,fields));
+ ans.add(extractFields(oSFCPC, fields));
} else {
ans.add(oSFCPC);
}
@Path("{portChainUUID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
- public Response showSFCPortChain(
- @PathParam("portChainUUID") String sfcPortChainUUID,
+ public Response showSFCPortChain(@PathParam("portChainUUID") String sfcPortChainUUID,
// return fields
@QueryParam("fields") List<String> fields) {
return show(sfcPortChainUUID, fields);
@POST
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createSFCPortChain(final NeutronSFCPortChainRequest input) {
return create(input);
@PUT
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @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 updateSFCPortChain(
- @PathParam("portChainUUID") String sfcPortChainUUID, final NeutronSFCPortChainRequest input) {
+ public Response updateSFCPortChain(@PathParam("portChainUUID") String sfcPortChainUUID,
+ final NeutronSFCPortChainRequest input) {
return update(sfcPortChainUUID, input);
}
* Deletes the SFC Port Chain */
@Path("{portChainUUID}")
@DELETE
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @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 deleteSFCPortChain(
- @PathParam("portChainUUID") String sfcPortChainUUID) {
+ public Response deleteSFCPortChain(@PathParam("portChainUUID") String sfcPortChainUUID) {
return delete(sfcPortChainUUID);
}
}
// See OpenStack Networking SFC (networking-sfc) Port Pair Group API v1.0 Reference
// for description of annotated attributes
- @XmlElement(name="portpairgroup")
+ @XmlElement(name = "portpairgroup")
NeutronSFCPortPairGroup singletonPortPairGroup;
- @XmlElement(name="portpairgroups")
+ @XmlElement(name = "portpairgroups")
List<NeutronSFCPortPairGroup> bulkRequest;
NeutronSFCPortPairGroupRequest() {
*/
@Path("/sfc/portpairgroups")
-public class NeutronSFCPortPairGroupsNorthbound
- extends AbstractNeutronNorthbound<NeutronSFCPortPairGroup,
+public class NeutronSFCPortPairGroupsNorthbound extends AbstractNeutronNorthbound<NeutronSFCPortPairGroup,
NeutronSFCPortPairGroupRequest, INeutronSFCPortPairGroupCRUD> {
private static final String RESOURCE_NAME = "Sfc Port Pair Group";
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@QueryParam("id") String queryID,
@QueryParam("name") String queryName,
@QueryParam("tenant_id") String queryTenantID,
- @QueryParam("port_pairs") List<String> queryPortPairsUUID ) {
+ @QueryParam("port_pairs") List<String> queryPortPairsUUID) {
INeutronSFCPortPairGroupCRUD sfcPortPairGroupInterface = getNeutronCRUD();
List<NeutronSFCPortPairGroup> allSFCPortPairGroup = sfcPortPairGroupInterface.getAll();
List<NeutronSFCPortPairGroup> ans = new ArrayList<>();
Iterator<NeutronSFCPortPairGroup> i = allSFCPortPairGroup.iterator();
while (i.hasNext()) {
NeutronSFCPortPairGroup oSFCPPG = i.next();
- if ((queryID == null || queryID.equals(oSFCPPG.getID())) &&
- (queryName == null || queryName.equals(oSFCPPG.getName())) &&
- (queryTenantID == null || queryTenantID.equals(oSFCPPG.getTenantID()))) {
+ if ((queryID == null || queryID.equals(oSFCPPG.getID()))
+ && (queryName == null || queryName.equals(oSFCPPG.getName()))
+ && (queryTenantID == null || queryTenantID.equals(oSFCPPG.getTenantID()))) {
if (fields.size() > 0) {
- ans.add(extractFields(oSFCPPG,fields));
+ ans.add(extractFields(oSFCPPG, fields));
} else {
ans.add(oSFCPPG);
}
@Path("{portPairGroupUUID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
- public Response showSFCPortPairGroup(
- @PathParam("portPairGroupUUID") String sfcPortPairGroupUUID,
+ public Response showSFCPortPairGroup(@PathParam("portPairGroupUUID") String sfcPortPairGroupUUID,
// return fields
- @QueryParam("fields") List<String> fields ){
+ @QueryParam("fields") List<String> fields) {
return show(sfcPortPairGroupUUID, fields);
}
@POST
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createSFCPortPairGroup(final NeutronSFCPortPairGroupRequest input) {
return create(input);
@PUT
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @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 updateSFCPortPairGroup(
- @PathParam("portPairGroupUUID") String sfcPortPairGroupUUID, final NeutronSFCPortPairGroupRequest input ) {
+ public Response updateSFCPortPairGroup(@PathParam("portPairGroupUUID") String sfcPortPairGroupUUID,
+ final NeutronSFCPortPairGroupRequest input) {
return update(sfcPortPairGroupUUID, input);
}
@Path("{portPairGroupUUID}")
@DELETE
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @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 deleteSFCPortPairGroup(
- @PathParam("portPairGroupUUID") String sfcPortPairGroupUUID) {
+ public Response deleteSFCPortPairGroup(@PathParam("portPairGroupUUID") String sfcPortPairGroupUUID) {
return delete(sfcPortPairGroupUUID);
}
}
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronSFCPortPairRequest implements INeutronRequest<NeutronSFCPortPair> {
+public class NeutronSFCPortPairRequest implements INeutronRequest<NeutronSFCPortPair> {
// See OpenStack Networking SFC (networking-sfc) Port Pair API v1.0 Reference
// for description of annotated attributes
- @XmlElement(name="portpair")
+ @XmlElement(name = "portpair")
NeutronSFCPortPair singletonPortPair;
- @XmlElement(name="portpairs")
+ @XmlElement(name = "portpairs")
List<NeutronSFCPortPair> bulkRequest;
NeutronSFCPortPairRequest() {
@Path("/sfc/portpairs")
public class NeutronSFCPortPairsNorthbound
- extends AbstractNeutronNorthbound<NeutronSFCPortPair,
- NeutronSFCPortPairRequest, INeutronSFCPortPairCRUD> {
+ extends AbstractNeutronNorthbound<NeutronSFCPortPair, NeutronSFCPortPairRequest, INeutronSFCPortPairCRUD> {
private static final String RESOURCE_NAME = "Sfc Port Pair";
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@QueryParam("name") String queryName,
@QueryParam("tenant_id") String queryTenantID,
@QueryParam("ingress") String queryIngressPort,
- @QueryParam("egress") String queryEgressPort
- ) {
+ @QueryParam("egress") String queryEgressPort) {
INeutronSFCPortPairCRUD sfcPortPairInterface = getNeutronCRUD();
List<NeutronSFCPortPair> allSFCPortPair = sfcPortPairInterface.getAll();
List<NeutronSFCPortPair> ans = new ArrayList<>();
Iterator<NeutronSFCPortPair> i = allSFCPortPair.iterator();
while (i.hasNext()) {
NeutronSFCPortPair oSFCPP = i.next();
- if ((queryID == null || queryID.equals(oSFCPP.getID())) &&
- (queryName == null || queryName.equals(oSFCPP.getName())) &&
- (queryIngressPort == null || queryIngressPort.equals(oSFCPP.getIngressPortUUID())) &&
- (queryEgressPort == null || queryEgressPort.equals(oSFCPP.getEgressPortUUID())) &&
- (queryTenantID == null || queryTenantID.equals(oSFCPP.getTenantID()))) {
+ if ((queryID == null || queryID.equals(oSFCPP.getID()))
+ && (queryName == null || queryName.equals(oSFCPP.getName()))
+ && (queryIngressPort == null || queryIngressPort.equals(oSFCPP.getIngressPortUUID()))
+ && (queryEgressPort == null || queryEgressPort.equals(oSFCPP.getEgressPortUUID()))
+ && (queryTenantID == null || queryTenantID.equals(oSFCPP.getTenantID()))) {
if (fields.size() > 0) {
- ans.add(extractFields(oSFCPP,fields));
+ ans.add(extractFields(oSFCPP, fields));
} else {
ans.add(oSFCPP);
}
@Path("{portPairUUID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
- public Response showSFCPortPair(
- @PathParam("portPairUUID") String sfcPortPairUUID,
+ public Response showSFCPortPair(@PathParam("portPairUUID") String sfcPortPairUUID,
// return fields
- @QueryParam("fields") List<String> fields
- ) {
+ @QueryParam("fields") List<String> fields) {
return show(sfcPortPairUUID, fields);
}
@POST
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createSFCPortPair(final NeutronSFCPortPairRequest input) {
return create(input);
@PUT
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @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 updateSFCPortPair(
- @PathParam("portPairUUID") String sfcPortPairUUID, final NeutronSFCPortPairRequest input
- ) {
+ public Response updateSFCPortPair(@PathParam("portPairUUID") String sfcPortPairUUID,
+ final NeutronSFCPortPairRequest input) {
return update(sfcPortPairUUID, input);
}
@Path("{portPairUUID}")
@DELETE
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @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 deleteSFCPortPair(
- @PathParam("portPairUUID") String sfcPortPairUUID) {
+ public Response deleteSFCPortPair(@PathParam("portPairUUID") String sfcPortPairUUID) {
return delete(sfcPortPairUUID);
}
import javax.xml.bind.annotation.XmlRootElement;
import org.opendaylight.neutron.spi.NeutronSecurityGroup;
-
@XmlRootElement
-@XmlAccessorType (XmlAccessType.NONE)
+@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronSecurityGroupRequest
- implements INeutronRequest<NeutronSecurityGroup> {
+public class NeutronSecurityGroupRequest implements INeutronRequest<NeutronSecurityGroup> {
/**
* See OpenStack Network API v2.0 Reference for a
* description of annotated attributes and operations
*/
- @XmlElement (name = "security_group")
+ @XmlElement(name = "security_group")
NeutronSecurityGroup singletonSecurityGroup;
- @XmlElement (name = "security_groups")
+ @XmlElement(name = "security_groups")
List<NeutronSecurityGroup> bulkRequest;
NeutronSecurityGroupRequest() {
* More info :
* http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
*/
-@Path ("/security-groups")
-public class NeutronSecurityGroupsNorthbound
- extends AbstractNeutronNorthbound<NeutronSecurityGroup, NeutronSecurityGroupRequest, INeutronSecurityGroupCRUD> {
+@Path("/security-groups")
+public class NeutronSecurityGroupsNorthbound extends
+ AbstractNeutronNorthbound<NeutronSecurityGroup, NeutronSecurityGroupRequest, INeutronSecurityGroupCRUD> {
private static final String RESOURCE_NAME = "Security Group";
@Override
* Returns a list of all Security Groups
*/
@GET
- @Produces ({MediaType.APPLICATION_JSON})
- @StatusCodes ({
- @ResponseCode (code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
- @ResponseCode (code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+ @Produces({ MediaType.APPLICATION_JSON })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response listGroups(
// return fields
- @QueryParam ("fields") List<String> fields,
+ @QueryParam("fields") List<String> fields,
// OpenStack security group attributes
- @QueryParam ("id") String querySecurityGroupUUID,
- @QueryParam ("name") String querySecurityGroupName,
- @QueryParam ("tenant_id") String querySecurityTenantID,
- @QueryParam ("limit") String limit,
- @QueryParam ("marker") String marker,
- @QueryParam ("page_reverse") String pageReverse
- ) {
+ @QueryParam("id") String querySecurityGroupUUID,
+ @QueryParam("name") String querySecurityGroupName,
+ @QueryParam("tenant_id") String querySecurityTenantID,
+ @QueryParam("limit") String limit,
+ @QueryParam("marker") String marker,
+ @QueryParam("page_reverse") String pageReverse) {
INeutronSecurityGroupCRUD securityGroupInterface = getNeutronCRUD();
List<NeutronSecurityGroup> allSecurityGroups = securityGroupInterface.getAll();
- List<NeutronSecurityGroup> ans = new ArrayList<NeutronSecurityGroup>();
+ List<NeutronSecurityGroup> ans = new ArrayList<>();
Iterator<NeutronSecurityGroup> i = allSecurityGroups.iterator();
while (i.hasNext()) {
NeutronSecurityGroup nsg = i.next();
- if ((querySecurityGroupUUID == null ||
- querySecurityGroupUUID.equals(nsg.getID())) &&
- (querySecurityGroupName == null ||
- querySecurityGroupName.equals(nsg.getSecurityGroupName())) &&
- (querySecurityTenantID == null ||
- querySecurityTenantID.equals(nsg.getTenantID()))) {
+ if ((querySecurityGroupUUID == null || querySecurityGroupUUID.equals(nsg.getID()))
+ && (querySecurityGroupName == null || querySecurityGroupName.equals(nsg.getSecurityGroupName()))
+ && (querySecurityTenantID == null || querySecurityTenantID.equals(nsg.getTenantID()))) {
if (fields.size() > 0) {
ans.add(extractFields(nsg, fields));
} else {
}
}
}
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- new NeutronSecurityGroupRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronSecurityGroupRequest(ans)).build();
}
/**
* Returns a specific Security Group
*/
- @Path ("{securityGroupUUID}")
+ @Path("{securityGroupUUID}")
@GET
- @Produces ({MediaType.APPLICATION_JSON})
- @StatusCodes ({
- @ResponseCode (code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
- @ResponseCode (code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
- @ResponseCode (code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+ @Produces({ MediaType.APPLICATION_JSON })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
- public Response showSecurityGroup(@PathParam ("securityGroupUUID") String securityGroupUUID,
- // return fields
- @QueryParam ("fields") List<String> fields) {
+ public Response showSecurityGroup(@PathParam("securityGroupUUID") String securityGroupUUID,
+ // return fields
+ @QueryParam("fields") List<String> fields) {
return show(securityGroupUUID, fields);
}
*/
@POST
- @Produces ({MediaType.APPLICATION_JSON})
- @Consumes ({MediaType.APPLICATION_JSON})
- @StatusCodes ({
- @ResponseCode (code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createSecurityGroups(final NeutronSecurityGroupRequest input) {
return create(input);
* Updates a Security Group
*/
- @Path ("{securityGroupUUID}")
+ @Path("{securityGroupUUID}")
@PUT
- @Produces ({MediaType.APPLICATION_JSON})
- @Consumes ({MediaType.APPLICATION_JSON})
- @StatusCodes ({
- @ResponseCode (code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @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 updateSecurityGroup(
- @PathParam ("securityGroupUUID") String securityGroupUUID, final NeutronSecurityGroupRequest input) {
+ public Response updateSecurityGroup(@PathParam("securityGroupUUID") String securityGroupUUID,
+ final NeutronSecurityGroupRequest input) {
return update(securityGroupUUID, input);
}
* Deletes a Security Group
*/
- @Path ("{securityGroupUUID}")
+ @Path("{securityGroupUUID}")
@DELETE
- @StatusCodes ({
- @ResponseCode (code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @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 deleteSecurityGroup(
- @PathParam ("securityGroupUUID") String securityGroupUUID) {
+ public Response deleteSecurityGroup(@PathParam("securityGroupUUID") String securityGroupUUID) {
return delete(securityGroupUUID);
}
}
import javax.xml.bind.annotation.XmlRootElement;
import org.opendaylight.neutron.spi.NeutronSecurityRule;
-
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronSecurityRuleRequest
- implements INeutronRequest<NeutronSecurityRule> {
+public class NeutronSecurityRuleRequest implements INeutronRequest<NeutronSecurityRule> {
/**
* See OpenStack Network API v2.0 Reference for a
* description of annotated attributes and operations
*/
- @XmlElement(name="security_group_rule")
+ @XmlElement(name = "security_group_rule")
NeutronSecurityRule singletonSecurityRule;
- @XmlElement(name="security_group_rules")
+ @XmlElement(name = "security_group_rules")
List<NeutronSecurityRule> bulkRequest;
NeutronSecurityRuleRequest() {
* http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
*/
-@Path ("/security-group-rules")
+@Path("/security-group-rules")
public class NeutronSecurityRulesNorthbound
- extends AbstractNeutronNorthbound<NeutronSecurityRule, NeutronSecurityRuleRequest, INeutronSecurityRuleCRUD> {
+ extends AbstractNeutronNorthbound<NeutronSecurityRule, NeutronSecurityRuleRequest, INeutronSecurityRuleCRUD> {
private static final String RESOURCE_NAME = "Security Rule";
@Override
* Returns a list of all Security Rules
*/
@GET
- @Produces ({MediaType.APPLICATION_JSON})
- @StatusCodes ({
- @ResponseCode (code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
- @ResponseCode (code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+ @Produces({ MediaType.APPLICATION_JSON })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response listRules(
// return fields
- @QueryParam ("fields") List<String> fields,
+ @QueryParam("fields") List<String> fields,
// OpenStack security rule attributes
- @QueryParam ("id") String querySecurityRuleUUID,
- @QueryParam ("direction") String querySecurityRuleDirection,
- @QueryParam ("protocol") String querySecurityRuleProtocol,
- @QueryParam ("port_range_min") Integer querySecurityRulePortMin,
- @QueryParam ("port_range_max") Integer querySecurityRulePortMax,
- @QueryParam ("ethertype") String querySecurityRuleEthertype,
- @QueryParam ("remote_ip_prefix") String querySecurityRuleIpPrefix,
- @QueryParam ("remote_group_id") String querySecurityRemoteGroupID,
- @QueryParam ("security_group_id") String querySecurityRuleGroupID,
- @QueryParam ("tenant_id") String querySecurityRuleTenantID,
- @QueryParam ("limit") String limit,
- @QueryParam ("marker") String marker,
- @QueryParam ("page_reverse") String pageReverse
- ) {
+ @QueryParam("id") String querySecurityRuleUUID,
+ @QueryParam("direction") String querySecurityRuleDirection,
+ @QueryParam("protocol") String querySecurityRuleProtocol,
+ @QueryParam("port_range_min") Integer querySecurityRulePortMin,
+ @QueryParam("port_range_max") Integer querySecurityRulePortMax,
+ @QueryParam("ethertype") String querySecurityRuleEthertype,
+ @QueryParam("remote_ip_prefix") String querySecurityRuleIpPrefix,
+ @QueryParam("remote_group_id") String querySecurityRemoteGroupID,
+ @QueryParam("security_group_id") String querySecurityRuleGroupID,
+ @QueryParam("tenant_id") String querySecurityRuleTenantID,
+ @QueryParam("limit") String limit,
+ @QueryParam("marker") String marker,
+ @QueryParam("page_reverse") String pageReverse) {
INeutronSecurityRuleCRUD securityRuleInterface = getNeutronCRUD();
List<NeutronSecurityRule> allSecurityRules = securityRuleInterface.getAll();
- List<NeutronSecurityRule> ans = new ArrayList<NeutronSecurityRule>();
+ List<NeutronSecurityRule> ans = new ArrayList<>();
Iterator<NeutronSecurityRule> i = allSecurityRules.iterator();
while (i.hasNext()) {
NeutronSecurityRule nsr = i.next();
- if ((querySecurityRuleUUID == null ||
- querySecurityRuleUUID.equals(nsr.getID())) &&
- (querySecurityRuleDirection == null ||
- querySecurityRuleDirection.equals(nsr.getSecurityRuleDirection())) &&
- (querySecurityRuleProtocol == null ||
- querySecurityRuleProtocol.equals(nsr.getSecurityRuleProtocol())) &&
- (querySecurityRulePortMin == null ||
- querySecurityRulePortMin.equals(nsr.getSecurityRulePortMin())) &&
- (querySecurityRulePortMax == null ||
- querySecurityRulePortMax.equals(nsr.getSecurityRulePortMax())) &&
- (querySecurityRuleEthertype == null ||
- querySecurityRuleEthertype.equals(nsr.getSecurityRuleEthertype())) &&
- (querySecurityRuleIpPrefix == null ||
- querySecurityRuleIpPrefix.equals(nsr.getSecurityRuleRemoteIpPrefix())) &&
- (querySecurityRuleGroupID == null ||
- querySecurityRuleGroupID.equals(nsr.getSecurityRuleGroupID())) &&
- (querySecurityRemoteGroupID == null ||
- querySecurityRemoteGroupID.equals(nsr.getSecurityRemoteGroupID())) &&
- (querySecurityRuleTenantID == null ||
- querySecurityRuleTenantID.equals(nsr.getTenantID()))) {
+ if ((querySecurityRuleUUID == null || querySecurityRuleUUID.equals(nsr.getID()))
+ && (querySecurityRuleDirection == null
+ || querySecurityRuleDirection.equals(nsr.getSecurityRuleDirection()))
+ && (querySecurityRuleProtocol == null
+ || querySecurityRuleProtocol.equals(nsr.getSecurityRuleProtocol()))
+ && (querySecurityRulePortMin == null
+ || querySecurityRulePortMin.equals(nsr.getSecurityRulePortMin()))
+ && (querySecurityRulePortMax == null
+ || querySecurityRulePortMax.equals(nsr.getSecurityRulePortMax()))
+ && (querySecurityRuleEthertype == null
+ || querySecurityRuleEthertype.equals(nsr.getSecurityRuleEthertype()))
+ && (querySecurityRuleIpPrefix == null
+ || querySecurityRuleIpPrefix.equals(nsr.getSecurityRuleRemoteIpPrefix()))
+ && (querySecurityRuleGroupID == null
+ || querySecurityRuleGroupID.equals(nsr.getSecurityRuleGroupID()))
+ && (querySecurityRemoteGroupID == null
+ || querySecurityRemoteGroupID.equals(nsr.getSecurityRemoteGroupID()))
+ && (querySecurityRuleTenantID == null || querySecurityRuleTenantID.equals(nsr.getTenantID()))) {
if (fields.size() > 0) {
ans.add(extractFields(nsr, fields));
} else {
}
}
}
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- new NeutronSecurityRuleRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronSecurityRuleRequest(ans)).build();
}
/**
* Returns a specific Security Rule
*/
- @Path ("{securityRuleUUID}")
+ @Path("{securityRuleUUID}")
@GET
- @Produces ({MediaType.APPLICATION_JSON})
- @StatusCodes ({
- @ResponseCode (code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
- @ResponseCode (code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
- @ResponseCode (code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
+ @Produces({ MediaType.APPLICATION_JSON })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
+ @ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
- public Response showSecurityRule(@PathParam ("securityRuleUUID") String securityRuleUUID,
- // return fields
- @QueryParam ("fields") List<String> fields) {
+ public Response showSecurityRule(@PathParam("securityRuleUUID") String securityRuleUUID,
+ // return fields
+ @QueryParam("fields") List<String> fields) {
return show(securityRuleUUID, fields);
}
*/
@POST
- @Produces ({MediaType.APPLICATION_JSON})
- @Consumes ({MediaType.APPLICATION_JSON})
- @StatusCodes ({
- @ResponseCode (code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createSecurityRules(final NeutronSecurityRuleRequest input) {
return create(input);
* Updates a Security Rule
*/
- @Path ("{securityRuleUUID}")
+ @Path("{securityRuleUUID}")
@PUT
- @Produces ({MediaType.APPLICATION_JSON})
- @Consumes ({MediaType.APPLICATION_JSON})
- @StatusCodes ({
- @ResponseCode (code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @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 updateSecurityRule(
- @PathParam ("securityRuleUUID") String securityRuleUUID, final NeutronSecurityRuleRequest input) {
+ public Response updateSecurityRule(@PathParam("securityRuleUUID") String securityRuleUUID,
+ final NeutronSecurityRuleRequest input) {
return update(securityRuleUUID, input);
}
* Deletes a Security Rule
*/
- @Path ("{securityRuleUUID}")
+ @Path("{securityRuleUUID}")
@DELETE
- @StatusCodes ({
- @ResponseCode (code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @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 deleteSecurityRule(
- @PathParam ("securityRuleUUID") String securityRuleUUID) {
+ public Response deleteSecurityRule(@PathParam("securityRuleUUID") String securityRuleUUID) {
return delete(securityRuleUUID);
}
}
// See OpenStack Network API v2.0 Reference for description of
// annotated attributes
- @XmlElement(name="subnet")
+ @XmlElement(name = "subnet")
NeutronSubnet singletonSubnet;
- @XmlElement(name="subnets")
+ @XmlElement(name = "subnets")
List<NeutronSubnet> bulkRequest;
- @XmlElement(name="subnets_links")
+ @XmlElement(name = "subnets_links")
List<NeutronPageLink> links;
NeutronSubnetRequest() {
@Path("/subnets")
public class NeutronSubnetsNorthbound
- extends AbstractNeutronNorthbound<NeutronSubnet, NeutronSubnetRequest, INeutronSubnetCRUD> {
+ extends AbstractNeutronNorthbound<NeutronSubnet, NeutronSubnetRequest, INeutronSubnetCRUD> {
private static final String RESOURCE_NAME = "Subnet";
@Override
if (needNetwork) {
answer = answer.fetchINeutronNetworkCRUD(this);
if (answer.getNetworkInterface() == null) {
- throw new ServiceUnavailableException("Network CRUD Interface "
- + RestMessages.SERVICEUNAVAILABLE.toString());
+ throw new ServiceUnavailableException(
+ "Network CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString());
}
}
return answer;
@GET
@Produces({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackSubnets.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@QueryParam("limit") Integer limit,
@QueryParam("marker") String marker,
@DefaultValue("false") @QueryParam("page_reverse") Boolean pageReverse
- // sorting not supported
- ) {
+ // sorting not supported
+ ) {
INeutronSubnetCRUD subnetInterface = getNeutronInterfaces(false).getSubnetInterface();
List<NeutronSubnet> allNetworks = subnetInterface.getAll();
- List<NeutronSubnet> ans = new ArrayList<NeutronSubnet>();
+ List<NeutronSubnet> ans = new ArrayList<>();
Iterator<NeutronSubnet> i = allNetworks.iterator();
while (i.hasNext()) {
NeutronSubnet oSS = i.next();
- if ((queryID == null || queryID.equals(oSS.getID())) &&
- (queryNetworkID == null || queryNetworkID.equals(oSS.getNetworkUUID())) &&
- (queryName == null || queryName.equals(oSS.getName())) &&
- (queryIPVersion == null || queryIPVersion.equals(oSS.getIpVersion())) &&
- (queryCIDR == null || queryCIDR.equals(oSS.getCidr())) &&
- (queryGatewayIP == null || queryGatewayIP.equals(oSS.getGatewayIP())) &&
- (queryEnableDHCP == null || queryEnableDHCP.equals(oSS.getEnableDHCP())) &&
- (queryTenantID == null || queryTenantID.equals(oSS.getTenantID())) &&
- (queryIpV6AddressMode == null || queryIpV6AddressMode.equals(oSS.getIpV6AddressMode())) &&
- (queryIpV6RaMode == null || queryIpV6RaMode.equals(oSS.getIpV6RaMode()))){
+ if ((queryID == null || queryID.equals(oSS.getID()))
+ && (queryNetworkID == null || queryNetworkID.equals(oSS.getNetworkUUID()))
+ && (queryName == null || queryName.equals(oSS.getName()))
+ && (queryIPVersion == null || queryIPVersion.equals(oSS.getIpVersion()))
+ && (queryCIDR == null || queryCIDR.equals(oSS.getCidr()))
+ && (queryGatewayIP == null || queryGatewayIP.equals(oSS.getGatewayIP()))
+ && (queryEnableDHCP == null || queryEnableDHCP.equals(oSS.getEnableDHCP()))
+ && (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))
+ && (queryIpV6AddressMode == null || queryIpV6AddressMode.equals(oSS.getIpV6AddressMode()))
+ && (queryIpV6RaMode == null || queryIpV6RaMode.equals(oSS.getIpV6RaMode()))) {
if (fields.size() > 0) {
- ans.add(extractFields(oSS,fields));
+ ans.add(extractFields(oSS, fields));
} else {
ans.add(oSS);
}
if (limit != null && ans.size() > 1) {
// Return a paginated request
- NeutronSubnetRequest request = (NeutronSubnetRequest) PaginatedRequestFactory.createRequest(limit,
- marker, pageReverse, uriInfo, ans, NeutronSubnet.class);
+ NeutronSubnetRequest request = (NeutronSubnetRequest) PaginatedRequestFactory.createRequest(limit, marker,
+ pageReverse, uriInfo, ans, NeutronSubnet.class);
return Response.status(HttpURLConnection.HTTP_OK).entity(request).build();
}
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- new NeutronSubnetRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronSubnetRequest(ans)).build();
}
/**
@GET
@Produces({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackSubnets.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
- public Response showSubnet(
- @PathParam("subnetUUID") String subnetUUID,
+ public Response showSubnet(@PathParam("subnetUUID") String subnetUUID,
// return fields
@QueryParam("fields") List<String> fields) {
return show(subnetUUID, fields);
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackSubnets.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createSubnets(final NeutronSubnetRequest input) {
getNeutronInterfaces(true); // Ensure that network service is loaded
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
//@TypeHint(OpenStackSubnets.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @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 updateSubnet(
- @PathParam("subnetUUID") String subnetUUID, final NeutronSubnetRequest input
- ) {
+ public Response updateSubnet(@PathParam("subnetUUID") String subnetUUID, final NeutronSubnetRequest input) {
return update(subnetUUID, input);
}
@Path("{subnetUUID}")
@DELETE
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @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 deleteSubnet(
- @PathParam("subnetUUID") String subnetUUID) {
+ public Response deleteSubnet(@PathParam("subnetUUID") String subnetUUID) {
return delete(subnetUUID);
}
}
@Path("/vpn/ikepolicies")
public class NeutronVPNIKEPoliciesNorthbound
- extends AbstractNeutronNorthbound<NeutronVPNIKEPolicy, NeutronVPNIKEPolicyRequest, INeutronVPNIKEPolicyCRUD> {
+ extends AbstractNeutronNorthbound<NeutronVPNIKEPolicy, NeutronVPNIKEPolicyRequest, INeutronVPNIKEPolicyCRUD> {
private static final String RESOURCE_NAME = "VPNIKEPolicy";
@Override
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@QueryParam("phase1_negotiation_mode") String queryPhase1NegotiationMode,
@QueryParam("pfs") String queryPFS,
@QueryParam("ike_version") String queryIKEVersion
- // pagination and sorting are TODO
- ) {
+ // pagination and sorting are TODO
+ ) {
INeutronVPNIKEPolicyCRUD labelInterface = getNeutronCRUD();
List<NeutronVPNIKEPolicy> allNeutronVPNIKEPolicy = labelInterface.getAll();
- List<NeutronVPNIKEPolicy> ans = new ArrayList<NeutronVPNIKEPolicy>();
+ List<NeutronVPNIKEPolicy> ans = new ArrayList<>();
Iterator<NeutronVPNIKEPolicy> i = allNeutronVPNIKEPolicy.iterator();
while (i.hasNext()) {
NeutronVPNIKEPolicy oSS = i.next();
- if ((queryID == null || queryID.equals(oSS.getID())) &&
- (queryName == null || queryName.equals(oSS.getName())) &&
- (queryAuthAlgorithm == null || queryAuthAlgorithm.equals(oSS.getAuthAlgorithm())) &&
- (queryEncryptionAlgorithm == null || queryEncryptionAlgorithm.equals(oSS.getEncryptionAlgorithm())) &&
- (queryPhase1NegotiationMode == null || queryPhase1NegotiationMode.equals(oSS.getPhase1NegotiationMode())) &&
- (queryPFS == null || queryPFS.equals(oSS.getPerfectForwardSecrecy())) &&
- (queryIKEVersion == null || queryIKEVersion.equals(oSS.getIkeVersion())) &&
- (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
+ if ((queryID == null || queryID.equals(oSS.getID()))
+ && (queryName == null || queryName.equals(oSS.getName()))
+ && (queryAuthAlgorithm == null || queryAuthAlgorithm.equals(oSS.getAuthAlgorithm()))
+ && (queryEncryptionAlgorithm == null
+ || queryEncryptionAlgorithm.equals(oSS.getEncryptionAlgorithm()))
+ && (queryPhase1NegotiationMode == null
+ || queryPhase1NegotiationMode.equals(oSS.getPhase1NegotiationMode()))
+ && (queryPFS == null || queryPFS.equals(oSS.getPerfectForwardSecrecy()))
+ && (queryIKEVersion == null || queryIKEVersion.equals(oSS.getIkeVersion()))
+ && (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
if (fields.size() > 0) {
- ans.add(extractFields(oSS,fields));
+ ans.add(extractFields(oSS, fields));
} else {
ans.add(oSS);
}
}
}
//TODO: apply pagination to results
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- new NeutronVPNIKEPolicyRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronVPNIKEPolicyRequest(ans)).build();
}
/**
@Path("{policyID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
- public Response showVPNIKEPolicy(
- @PathParam("policyID") String policyUUID,
+ public Response showVPNIKEPolicy(@PathParam("policyID") String policyUUID,
// return fields
- @QueryParam("fields") List<String> fields
- ) {
+ @QueryParam("fields") List<String> fields) {
return show(policyUUID, fields);
}
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
@TypeHint(NeutronVPNIKEPolicy.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createVPNIKEPolicy(final NeutronVPNIKEPolicyRequest input) {
return create(input);
@PUT
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @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 updateVPNIKEPolicy(
- @PathParam("policyID") String policyUUID, final NeutronVPNIKEPolicyRequest input
- ) {
+ public Response updateVPNIKEPolicy(@PathParam("policyID") String policyUUID,
+ final NeutronVPNIKEPolicyRequest input) {
return update(policyUUID, input);
}
@Path("{policyID}")
@DELETE
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @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 deleteVPNIKEPolicy(
- @PathParam("policyID") String policyUUID) {
+ public Response deleteVPNIKEPolicy(@PathParam("policyID") String policyUUID) {
return delete(policyUUID);
}
}
@XmlAccessorType(XmlAccessType.NONE)
public class NeutronVPNIKEPolicyRequest implements INeutronRequest<NeutronVPNIKEPolicy> {
- @XmlElement(name="ikepolicy")
+ @XmlElement(name = "ikepolicy")
NeutronVPNIKEPolicy singletonIKEPolicy;
- @XmlElement(name="ikepolicies")
+ @XmlElement(name = "ikepolicies")
List<NeutronVPNIKEPolicy> bulkIKEPolicies;
NeutronVPNIKEPolicyRequest() {
*/
@Path("/vpn/ipsecpolicies")
-public class NeutronVPNIPSECPoliciesNorthbound
- extends AbstractNeutronNorthbound<NeutronVPNIPSECPolicy, NeutronVPNIPSECPolicyRequest, INeutronVPNIPSECPolicyCRUD> {
+public class NeutronVPNIPSECPoliciesNorthbound extends
+ AbstractNeutronNorthbound<NeutronVPNIPSECPolicy, NeutronVPNIPSECPolicyRequest, INeutronVPNIPSECPolicyCRUD> {
private static final String RESOURCE_NAME = "VPNIPSECPolicy";
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
@QueryParam("auth_algorithm") String queryAuthAlgorithm,
@QueryParam("encryption_algorithm") String queryEncryptionAlgorithm,
@QueryParam("pfs") String queryPFS
- // pagination and sorting are TODO
- ) {
+ // pagination and sorting are TODO
+ ) {
INeutronVPNIPSECPolicyCRUD policyInterface = getNeutronCRUD();
List<NeutronVPNIPSECPolicy> allNeutronVPNIPSECPolicies = policyInterface.getAll();
- List<NeutronVPNIPSECPolicy> ans = new ArrayList<NeutronVPNIPSECPolicy>();
+ List<NeutronVPNIPSECPolicy> ans = new ArrayList<>();
Iterator<NeutronVPNIPSECPolicy> i = allNeutronVPNIPSECPolicies.iterator();
while (i.hasNext()) {
NeutronVPNIPSECPolicy oSS = i.next();
- if ((queryID == null || queryID.equals(oSS.getID())) &&
- (queryName == null || queryName.equals(oSS.getName())) &&
- (queryAuthAlgorithm == null || queryAuthAlgorithm.equals(oSS.getAuthAlgorithm())) &&
- (queryEncryptionAlgorithm == null || queryEncryptionAlgorithm.equals(oSS.getEncryptionAlgorithm())) &&
- (queryPFS == null || queryPFS.equals(oSS.getPerfectForwardSecrecy())) &&
- (queryTransformProtocol == null || queryTransformProtocol.equals(oSS.getTransformProtocol())) &&
- (queryEncapsulationMode == null || queryEncapsulationMode.equals(oSS.getEncapsulationMode())) &&
- (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
+ if ((queryID == null || queryID.equals(oSS.getID()))
+ && (queryName == null || queryName.equals(oSS.getName()))
+ && (queryAuthAlgorithm == null || queryAuthAlgorithm.equals(oSS.getAuthAlgorithm()))
+ && (queryEncryptionAlgorithm == null
+ || queryEncryptionAlgorithm.equals(oSS.getEncryptionAlgorithm()))
+ && (queryPFS == null || queryPFS.equals(oSS.getPerfectForwardSecrecy()))
+ && (queryTransformProtocol == null || queryTransformProtocol.equals(oSS.getTransformProtocol()))
+ && (queryEncapsulationMode == null || queryEncapsulationMode.equals(oSS.getEncapsulationMode()))
+ && (queryTenantID == null || queryTenantID.equals(oSS.getTenantID()))) {
if (fields.size() > 0) {
- ans.add(extractFields(oSS,fields));
+ ans.add(extractFields(oSS, fields));
} else {
ans.add(oSS);
}
}
}
//TODO: apply pagination to results
- return Response.status(HttpURLConnection.HTTP_OK).entity(
- new NeutronVPNIPSECPolicyRequest(ans)).build();
+ return Response.status(HttpURLConnection.HTTP_OK).entity(new NeutronVPNIPSECPolicyRequest(ans)).build();
}
/**
@Path("{policyID}")
@GET
@Produces({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAUTHORIZED, condition = "Unauthorized"),
@ResponseCode(code = HttpURLConnection.HTTP_FORBIDDEN, condition = "Forbidden"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_FOUND, condition = "Not Found"),
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
- public Response showVPNIPSECPolicy(
- @PathParam("policyID") String policyUUID,
+ public Response showVPNIPSECPolicy(@PathParam("policyID") String policyUUID,
// return fields
- @QueryParam("fields") List<String> fields
- ) {
+ @QueryParam("fields") List<String> fields) {
return show(policyUUID, fields);
}
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
@TypeHint(NeutronVPNIPSECPolicy.class)
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
+ @StatusCodes({ @ResponseCode(code = HttpURLConnection.HTTP_CREATED, condition = "Created"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createVPNIPSECPolicy(final NeutronVPNIPSECPolicyRequest input) {
return create(input);
@PUT
@Produces({ MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_JSON })
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_OK, condition = "Operation successful"),
+ @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 updateVPNIPSECPolicy(
- @PathParam("policyID") String policyUUID, final NeutronVPNIPSECPolicyRequest input
- ) {
+ public Response updateVPNIPSECPolicy(@PathParam("policyID") String policyUUID,
+ final NeutronVPNIPSECPolicyRequest input) {
return update(policyUUID, input);
}
@Path("{policyID}")
@DELETE
- @StatusCodes({
- @ResponseCode(code = HttpURLConnection.HTTP_NO_CONTENT, condition = "No Content"),
+ @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 deleteVPNIPSECPolicy(
- @PathParam("policyID") String policyUUID) {
+ public Response deleteVPNIPSECPolicy(@PathParam("policyID") String policyUUID) {
return delete(policyUUID);
}
}
@XmlAccessorType(XmlAccessType.NONE)
public class NeutronVPNIPSECPolicyRequest implements INeutronRequest<NeutronVPNIPSECPolicy> {
- @XmlElement(name="ipsecpolicy")
+ @XmlElement(name = "ipsecpolicy")
NeutronVPNIPSECPolicy singletonVPNIPSECPolicy;
- @XmlElement(name="ipsecpolicies")
+ @XmlElement(name = "ipsecpolicies")
List<NeutronVPNIPSECPolicy> bulkVPNIPSECPolicies;
NeutronVPNIPSECPolicyRequest() {
NeutronVPNIPSECPolicyRequest(NeutronVPNIPSECPolicy policy) {
singletonVPNIPSECPolicy = policy;
- bulkVPNIPSECPolicies = null;
+ bulkVPNIPSECPolicies = null;
}
NeutronVPNIPSECPolicyRequest(List<NeutronVPNIPSECPolicy> policies) {
@XmlAccessorType(XmlAccessType.NONE)
public class NeutronVPNIPSECSiteConnectionRequest implements INeutronRequest<NeutronVPNIPSECSiteConnection> {
- @XmlElement(name="ipsec_site_connection")
+ @XmlElement(name = "ipsec_site_connection")
NeutronVPNIPSECSiteConnection singletonVPNIPSECSiteConnection;
- @XmlElement(name="ipsec_site_connections")
+ @XmlElement(name = "ipsec_site_connections")
List<NeutronVPNIPSECSiteConnection> bulkVPNIPSECSiteConnections;
NeutronVPNIPSECSiteConnectionRequest() {
NeutronVPNIPSECSiteConnectionRequest(NeutronVPNIPSECSiteConnection connection) {
singletonVPNIPSECSiteConnection = connection;
- bulkVPNIPSECSiteConnections = null;
+ bulkVPNIPSECSiteConnections = null;
}
NeutronVPNIPSECSiteConnectionRequest(List<NeutronVPNIPSECSiteConnection> connections) {
*/
@Path("/vpn/ipsecsiteconnections")
-public class NeutronVPNIPSECSiteConnectionsNorthbound
- extends AbstractNeutronNorthbound<NeutronVPNIPSECSiteConnection, NeutronVPNIPSECSiteConnectionRequest, INeutronVPNIPSECSiteConnectionsCRUD> {
+public class NeutronVPNIPSECSiteConnectionsNorthbound extends AbstractNeutronNorthbound<NeutronVPNIPSECSiteConnection,
+ NeutronVPNIPSECSiteConnectionRequest, INeutronVPNIPSECSiteConnectionsCRUD> {
private static final String RESOURCE_NAME = "VPNIPSECSiteConnections";
// return fields
@QueryParam("fields") List<String> fields,
// filter fields
- @QueryParam("id") String queryID, @QueryParam("tenant_id") String queryTenantID,
+ @QueryParam("id") String queryID,
+ @QueryParam("tenant_id") String queryTenantID,
@QueryParam("name") String queryName,
- @QueryParam("peer_address") String queryPeerAddress, @QueryParam("peer_id") String queryPeerID,
- @QueryParam("route_mode") String queryRouteMode, @QueryParam("mtu") Integer queryMtu,
- @QueryParam("auth_mode") String queryAuthMode, @QueryParam("psk") String queryPsk,
- @QueryParam("initiator") String queryInitiator, @QueryParam("admin_state_up") Boolean queryAdminStateUp,
- @QueryParam("status") String queryStatus, @QueryParam("ikepolicy_id") String queryIkePolicyID,
+ @QueryParam("peer_address") String queryPeerAddress,
+ @QueryParam("peer_id") String queryPeerID,
+ @QueryParam("route_mode") String queryRouteMode,
+ @QueryParam("mtu") Integer queryMtu,
+ @QueryParam("auth_mode") String queryAuthMode,
+ @QueryParam("psk") String queryPsk,
+ @QueryParam("initiator") String queryInitiator,
+ @QueryParam("admin_state_up") Boolean queryAdminStateUp,
+ @QueryParam("status") String queryStatus,
+ @QueryParam("ikepolicy_id") String queryIkePolicyID,
@QueryParam("ipsecpolicy_id") String queryIpSecPolicyID,
@QueryParam("vpnservice_id") String queryVpnServiceID
// pagination and sorting are TODO
) {
INeutronVPNIPSECSiteConnectionsCRUD labelInterface = getNeutronCRUD();
List<NeutronVPNIPSECSiteConnection> allNeutronVPNIPSECSiteConnection = labelInterface.getAll();
- List<NeutronVPNIPSECSiteConnection> ans = new ArrayList<NeutronVPNIPSECSiteConnection>();
+ List<NeutronVPNIPSECSiteConnection> ans = new ArrayList<>();
Iterator<NeutronVPNIPSECSiteConnection> i = allNeutronVPNIPSECSiteConnection.iterator();
while (i.hasNext()) {
NeutronVPNIPSECSiteConnection oSS = i.next();
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response showVPNIPSECSiteConnection(@PathParam("connectionID") String connectionID,
- // return fields
+ // return fields
@QueryParam("fields") List<String> fields) {
return show(connectionID, fields);
}
@XmlAccessorType(XmlAccessType.NONE)
public class NeutronVPNServiceRequest implements INeutronRequest<NeutronVPNService> {
- @XmlElement(name="vpnservice")
+ @XmlElement(name = "vpnservice")
NeutronVPNService singletonVPNService;
- @XmlElement(name="vpnservices")
+ @XmlElement(name = "vpnservices")
List<NeutronVPNService> bulkVPNServices;
NeutronVPNServiceRequest() {
@Path("/vpn/vpnservices")
public class NeutronVPNServicesNorthbound
- extends AbstractNeutronNorthbound<NeutronVPNService, NeutronVPNServiceRequest, INeutronVPNServiceCRUD> {
+ extends AbstractNeutronNorthbound<NeutronVPNService, NeutronVPNServiceRequest, INeutronVPNServiceCRUD> {
private static final String RESOURCE_NAME = "VPNService";
) {
INeutronVPNServiceCRUD VPNServiceInterface = getNeutronCRUD();
List<NeutronVPNService> allVPNService = VPNServiceInterface.getAll();
- List<NeutronVPNService> ans = new ArrayList<NeutronVPNService>();
+ List<NeutronVPNService> ans = new ArrayList<>();
Iterator<NeutronVPNService> i = allVPNService.iterator();
while (i.hasNext()) {
NeutronVPNService oSS = i.next();
@ResponseCode(code = HttpURLConnection.HTTP_NOT_IMPLEMENTED, condition = "Not Implemented"),
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response showVPNService(@PathParam("serviceID") String serviceID,
- // return fields
+ // return fields
@QueryParam("fields") List<String> fields) {
return show(serviceID, fields);
}
*/
@SuppressWarnings("unchecked")
public static <T extends INeutronObject> INeutronRequest<T> createRequest(Integer limit, String marker,
- Boolean pageReverse,
- UriInfo uriInfo,
- List<T> collection,
- Class<T> clazz) {
+ Boolean pageReverse, UriInfo uriInfo, List<T> collection, Class<T> clazz) {
PaginationResults<T> results = paginate(limit, marker, pageReverse, uriInfo, collection);
- if (clazz.equals(NeutronNetwork.class)){
- return (INeutronRequest<T>) new NeutronNetworkRequest((List<NeutronNetwork>) results.collection, results.links);
+ if (clazz.equals(NeutronNetwork.class)) {
+ return (INeutronRequest<T>) new NeutronNetworkRequest((List<NeutronNetwork>) results.collection,
+ results.links);
}
- if (clazz.equals(NeutronSubnet.class)){
- return (INeutronRequest<T>) new NeutronSubnetRequest((List<NeutronSubnet>) results.collection, results.links);
+ if (clazz.equals(NeutronSubnet.class)) {
+ return (INeutronRequest<T>) new NeutronSubnetRequest((List<NeutronSubnet>) results.collection,
+ results.links);
}
- if (clazz.equals(NeutronPort.class)){
+ if (clazz.equals(NeutronPort.class)) {
return (INeutronRequest<T>) new NeutronPortRequest((List<NeutronPort>) results.collection, results.links);
}
return null;
}
- private static <T extends INeutronObject> PaginationResults<T> paginate(Integer limit, String marker, Boolean pageReverse, UriInfo uriInfo, List<T> collection) {
+ private static <T extends INeutronObject> PaginationResults<T> paginate(Integer limit, String marker,
+ Boolean pageReverse, UriInfo uriInfo, List<T> collection) {
List<NeutronPageLink> links = new ArrayList<>();
final int startPos;
String startMarker;
if (!pageReverse) {
startPos = offset + 1;
- }
- else {
+ } else {
startPos = offset - limit;
}
- }
- else {
+ } else {
startPos = 0;
}
- if (startPos == 0){
+ if (startPos == 0) {
firstPage = true;
}
startMarker = lCollection.get(0).getID();
endMarker = lCollection.get(lCollection.size() - 1).getID();
lastPage = true;
- }
- else if (startPos < 0) {
+ } else if (startPos < 0) {
if (startPos + limit > 0) {
lCollection = lCollection.subList(0, startPos + limit);
startMarker = lCollection.get(0).getID();
endMarker = lCollection.get(lCollection.size() - 1).getID();
firstPage = true;
+ } else {
+ throw new BadRequestException(
+ "Requested page is out of bounds. Please check the supplied limit and marker");
}
- else {
- throw new BadRequestException("Requested page is out of bounds. Please check the supplied limit and marker");
- }
- }
- else {
+ } else {
lCollection = lCollection.subList(startPos, startPos + limit);
startMarker = lCollection.get(0).getID();
- endMarker = lCollection.get(limit-1).getID();
+ endMarker = lCollection.get(limit - 1).getID();
}
if (!lastPage) {
if (!firstPage) {
NeutronPageLink previous = new NeutronPageLink();
previous.setRef("previous");
- previous.setHref(uriInfo.getAbsolutePath().toString() + "?limit=" + limit.toString() + "&marker=" + startMarker + "&page_reverse=True");
+ previous.setHref(uriInfo.getAbsolutePath().toString() + "?limit=" + limit.toString() + "&marker="
+ + startMarker + "&page_reverse=True");
links.add(previous);
}
private static final long serialVersionUID = 1L;
public ResourceConflictException(String string) {
- super(Response.status(Response.Status.CONFLICT).entity(string).type(
- MediaType.TEXT_PLAIN).build());
+ super(Response.status(Response.Status.CONFLICT).entity(string).type(MediaType.TEXT_PLAIN).build());
}
}
private static final long serialVersionUID = 1L;
public ResourceNotFoundException(String string) {
- super(Response.status(Response.Status.NOT_FOUND).entity(string).type(
- MediaType.TEXT_PLAIN).build());
+ super(Response.status(Response.Status.NOT_FOUND).entity(string).type(MediaType.TEXT_PLAIN).build());
}
}
package org.opendaylight.neutron.northbound.api;
public enum RestMessages {
- SUCCESS("Success"), NOCONTAINER("Container does not exist"), NOSUBNET("Subnet does not exist"), NOSTATICROUTE(
- "Static Route does not exist"), NOHOST("Host does not exist"), NOFLOW("Flow does not exist"), NONODE(
- "Node does not exist"), NOPOLICY("Policy does not exist"), NORESOURCE("Resource does not exist"), RESOURCECONFLICT(
- "Operation failed due to Resource Conflict"), NODEFAULT("Container default is not a custom container"), DEFAULTDISABLED(
- "Container(s) are configured. Container default is not operational"), NOTALLOWEDONDEFAULT(
- "Container default is a static resource, no modification allowed on it"), UNKNOWNACTION("Unknown action"), INVALIDJSON(
- "JSON message is invalid"), INVALIDADDRESS("Invalid InetAddress"), AVAILABLESOON(
- "Resource is not implemented yet"), INTERNALERROR("Internal Error"), SERVICEUNAVAILABLE(
- "Service is not available. Could be down for maintanence"), INVALIDDATA(
- "Data is invalid or conflicts with URI");
+ SUCCESS("Success"), NOCONTAINER("Container does not exist"), NOSUBNET("Subnet does not exist"),
+ NOSTATICROUTE("Static Route does not exist"), NOHOST("Host does not exist"), NOFLOW("Flow does not exist"),
+ NONODE("Node does not exist"), NOPOLICY("Policy does not exist"), NORESOURCE("Resource does not exist"),
+ RESOURCECONFLICT("Operation failed due to Resource Conflict"),
+ NODEFAULT("Container default is not a custom container"),
+ DEFAULTDISABLED("Container(s) are configured. Container default is not operational"),
+ NOTALLOWEDONDEFAULT("Container default is a static resource, no modification allowed on it"),
+ UNKNOWNACTION("Unknown action"), INVALIDJSON("JSON message is invalid"), INVALIDADDRESS("Invalid InetAddress"),
+ AVAILABLESOON("Resource is not implemented yet"), INTERNALERROR("Internal Error"),
+ SERVICEUNAVAILABLE("Service is not available. Could be down for maintanence"),
+ INVALIDDATA("Data is invalid or conflicts with URI");
private String message;
*
*/
public ServiceUnavailableException(String string) {
- super(Response.status(Response.Status.SERVICE_UNAVAILABLE).entity(
- string).type(MediaType.TEXT_PLAIN).build());
+ super(Response.status(Response.Status.SERVICE_UNAVAILABLE).entity(string).type(MediaType.TEXT_PLAIN).build());
}
}
*
*/
public UnimplementedException(String string) {
- super(Response.status(HttpURLConnection.HTTP_NOT_IMPLEMENTED).entity(
- string).type(MediaType.TEXT_PLAIN).build());
+ super(Response.status(HttpURLConnection.HTTP_NOT_IMPLEMENTED).entity(string).type(MediaType.TEXT_PLAIN)
+ .build());
}
}