*/
@Path("/vpn/vpnservices")
-public class NeutronVPNServicesNorthbound {
+public class NeutronVPNServicesNorthbound extends AbstractNeutronNorthbound {
- private static final int HTTP_OK_BOTTOM = 200;
- private static final int HTTP_OK_TOP = 299;
- private static final String INTERFACE_NAME = "VPNService CRUD Interface";
- private static final String UUID_NO_EXIST = "VPNService UUID does not exist.";
- private static final String NO_PROVIDERS = "No providers registered. Please try again later";
- private static final String NO_PROVIDER_LIST = "Couldn't get providers list. Please try again later";
+ private static final String RESOURCE_NAME = "VPNService";
private NeutronVPNService extractFields(NeutronVPNService o, List<String> fields) {
return o.extractFields(fields);
private NeutronCRUDInterfaces getNeutronInterfaces() {
NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronVPNServiceCRUD(this);
if (answer.getVPNServiceInterface() == null) {
- throw new ServiceUnavailableException(INTERFACE_NAME
- + RestMessages.SERVICEUNAVAILABLE.toString());
+ throw new ServiceUnavailableException(serviceUnavailable(RESOURCE_NAME));
}
return answer;
}
@QueryParam("fields") List<String> fields) {
INeutronVPNServiceCRUD VPNServiceInterface = getNeutronInterfaces().getVPNServiceInterface();
if (!VPNServiceInterface.neutronVPNServiceExists(serviceID)) {
- throw new ResourceNotFoundException(UUID_NO_EXIST);
+ throw new ResourceNotFoundException(uuidNoExist(RESOURCE_NAME));
}
if (fields.size() > 0) {
NeutronVPNService ans = VPNServiceInterface.getVPNService(serviceID);