コード例 #1
0
 @GET
 @Path("v1.0/standard_tat/project/{project_id}")
 @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
 @ApiOperation(
     value = "Get Standard TAT by Project ID",
     notes =
         "Calculate the Standard Turnaround Time of a particular project. Returns null if TAT cannot be calulated",
     response = Date.class)
 @ApiResponses(
     value = {
       @ApiResponse(code = 401, message = "Unauthorized Access", response = ErrorMessages.class)
     })
 public Response getProjectStandardTatByProjectId(
     @HeaderParam(Constants.HEADER_SECURITY_TOKEN) String securityToken,
     @PathParam("project_id") String projectId) {
   try {
     final VirtelaUser user = this.securityService.getSessionUser(securityToken);
     logger.info(user + "Requested to get the Standard TAT");
     return Response.status(Status.OK)
         .entity(this.ncopQueryService.getProjectStandardTatByProjectId(projectId))
         .build();
   } catch (ServiceException e) {
     return Response.status(e.getHttpErrorCode()).entity(e.getErrorMessages()).build();
   }
 }
コード例 #2
0
 @GET
 @Path("v1.0/quote_items/find/{project_id}")
 @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
 @ApiOperation(
     value = "Gets all Access Quote Items by Project ID",
     notes = "Gets the list of quote items by a given Project id",
     response = AccessQuoteItem.class,
     responseContainer = "List")
 @ApiResponses(
     value = {
       @ApiResponse(code = 401, message = "Unauthorized Access", response = ErrorMessages.class)
     })
 public Response getQuoteItems(
     @HeaderParam(Constants.HEADER_SECURITY_TOKEN) String securityToken,
     @PathParam("project_id") Long projectID) {
   List<AccessQuoteItem> quoteItems;
   try {
     final VirtelaUser user = this.securityService.getSessionUser(securityToken);
     logger.info(user + "Requested to get the All Quote Items by Project ID");
     quoteItems = this.ncopQueryService.getQuoteItemsByProjectId(projectID);
     return Response.status(Status.OK).entity(quoteItems).build();
   } catch (ServiceException e) {
     return Response.status(e.getHttpErrorCode()).entity(e.getErrorMessages()).build();
   }
 }
コード例 #3
0
 /**
  * Returns resource PricingLookupCode based on the given @param
  *
  * <p>Identify Pricing Lookup Code using the Acccess Vendor Product ID, Resource
  *
  * <p>Old URL: /pricing_lookup_code
  *
  * <p>Response: 200 - Record is found 406 - avp_id is not valid
  *
  * @param avpId
  * @return
  */
 @GET
 @Path("v1.0/pricing_lookup_code/find_by/avp_id/{avp_id}")
 @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
 public Response getPricingLookupCode(@PathParam("avp_id") long avpId) {
   PricingLookupCode pricingLookupCode;
   try {
     pricingLookupCode = this.ncopQueryService.getPricingLookupCodeByAvpId(avpId);
     return Response.status(Status.OK).entity(pricingLookupCode).build();
   } catch (ServiceException e) {
     return Response.status(e.getHttpErrorCode()).entity(e.getErrorMessages()).build();
   }
 }
コード例 #4
0
 /**
  * Returns resource CircuitResponse based on NTT Circuit ID (CPE ID)
  *
  * <p>CPE_ID - required
  *
  * <p>Old URL: /identify_circuit_hardware
  *
  * <p>Response: 200 - Circuit Response Generated 406 - Problem occurred while generating circuit
  * response
  *
  * @return
  */
 @GET
 @Path("v1.0/circuit_response/find_by/ntt_cpe_id/")
 @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
 public Response getCircuitByCpeId(@QueryParam("cpe_id") String cpeID) {
   try {
     final CircuitResponse circuitResponse =
         this.ncopQueryService.getCircuitHardwareResponse(cpeID);
     return Response.status(Status.OK).entity(circuitResponse).build();
   } catch (ServiceException e) {
     return Response.status(e.getHttpErrorCode()).entity(e.getErrorMessages()).build();
   }
 }
コード例 #5
0
 /**
  * To be filled in
  *
  * <p>Old URL: /vendros_in_country
  *
  * @return
  */
 @POST
 @Path("v2.0/vendor_detail/find/available_vendor")
 @Consumes(MediaType.APPLICATION_JSON)
 @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
 public Response getAvailableVendor(AvmProviderInfoParam avmProviderInfoParam) {
   try {
     final List<VendorDetail> vendorDetailList =
         this.ncopQueryService.getVendorsViaAvpc(avmProviderInfoParam);
     return Response.status(Status.OK).entity(vendorDetailList).build();
   } catch (ServiceException e) {
     return Response.status(e.getHttpErrorCode()).entity(e.getErrorMessages()).build();
   }
 }
コード例 #6
0
 /**
  * To be filled in
  *
  * <p>Old URL: /v1.0/x_connect_cost/identify
  *
  * @return
  */
 @POST
 @Path("v1.0/x_connect_cost/identify")
 @Consumes(MediaType.APPLICATION_JSON)
 @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
 public Response identifyXconnectCost(XConnectParam param) {
   try {
     final XConnectCost xConnectCost = this.ncopQueryService.identifyXConnectCost(param);
     return Response.status(Status.OK).entity(xConnectCost).build();
   } catch (ServiceException e) {
     // e.printStackTrace();
     return Response.status(e.getHttpErrorCode()).entity(e.getErrorMessages()).build();
   }
 }
コード例 #7
0
 @POST
 @Path("v1.0/cost_summary")
 @Consumes({MediaType.APPLICATION_JSON})
 @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
 public Response getCostSummary(ItemCost itemCost) {
   try {
     final CostSummary costSumamry = this.ncopQueryService.getCostSummary(itemCost);
     return Response.status(Status.OK).entity(costSumamry).build();
   } catch (ServiceException e) {
     // e.printStackTrace();
     return Response.status(e.getHttpErrorCode()).entity(e.getErrorMessages()).build();
   }
 }
コード例 #8
0
 @POST
 @Path("v1.0/avp/find/list")
 @Consumes(MediaType.APPLICATION_JSON)
 @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
 public Response getVendorProducts(VendorProductParam vendorProductParam) {
   try {
     final List<AccessVendorProduct> avpcList =
         this.ncopQueryService.getVendorAvpcList(vendorProductParam);
     return Response.status(Status.OK).entity(avpcList).build();
   } catch (ServiceException e) {
     return Response.status(e.getHttpErrorCode()).entity(e.getErrorMessages()).build();
   }
 }
コード例 #9
0
 @POST
 @Path("v1.0/lowest_cost/identify")
 @Consumes({MediaType.APPLICATION_JSON})
 @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
 public Response identifyLowestCostMapping(LowestCostParam param) {
   try {
     final LowestCostMapping lowestCostMapping =
         this.ncopQueryService.identifyLowestCostMapping(param);
     return Response.status(Status.OK).entity(lowestCostMapping).build();
   } catch (ServiceException e) {
     e.printStackTrace();
     return Response.status(e.getHttpErrorCode()).entity(e.getErrorMessages()).build();
   }
 }
コード例 #10
0
 /**
  * Returns resource CircuitResponse based on NTT Circuit ID (W_Number and/Or AL ID)
  *
  * <p>W_Number - required - may return multiple result
  *
  * <p>AL_ID - is optional - Will query data if W# is not given
  *
  * <p>Old URL: /identify_circuit
  *
  * <p>Response: 200 - Circuit Response Generated 406 - Problem occured while generating circuit
  * response
  *
  * @return
  */
 @GET
 @Path("v1.0/circuit_response/find_by/ntt_circuit_id")
 @Consumes(MediaType.APPLICATION_JSON)
 @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
 public Response getCircuitByNttCircuitId(
     @QueryParam("w_number") String wNumber, @QueryParam("al_id") String alID) {
   try {
     final CircuitResponse circuitResponse =
         this.ncopQueryService.getCircuitResponse(wNumber, alID);
     return Response.status(Status.OK).entity(circuitResponse).build();
   } catch (ServiceException e) {
     return Response.status(e.getHttpErrorCode()).entity(e.getErrorMessages()).build();
   }
 }
コード例 #11
0
 /**
  * To be filled in
  *
  * <p>Old URL: /v1.0/x_connect_type/identify
  *
  * @return
  */
 @GET
 @Path("v1.0/x_connect_type/identify")
 @Consumes(MediaType.APPLICATION_JSON)
 @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
 public Response identifyXconnectType(
     @QueryParam("access_type") String accessType,
     @QueryParam("circuit_speed") Long circuitSpeed) {
   try {
     final XConnectType type =
         this.ncopQueryService.identifyXConnectType(accessType, circuitSpeed);
     return Response.status(Status.OK).entity(type).build();
   } catch (ServiceException e) {
     // e.printStackTrace();
     return Response.status(e.getHttpErrorCode()).entity(e.getErrorMessages()).build();
   }
 }
コード例 #12
0
 @POST
 @Path("v1.0/costs/license_fee/param")
 @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
 @ApiOperation(value = "Gets license fee cost", notes = "Gets the license fee cost.")
 @ApiResponses(
     value = {
       @ApiResponse(code = 401, message = "Unauthorized Access", response = ErrorMessages.class),
       @ApiResponse(code = 404, message = "No Record Found", response = ErrorMessages.class)
     })
 public Response getLicenseFeeCost(
     @HeaderParam(Constants.HEADER_SECURITY_TOKEN) String securityToken,
     LicenseFeeParam licenseFeeParam) {
   try {
     final VirtelaUser user = this.securityService.getSessionUser(securityToken);
     logger.info(user + "Requested to get the licensed fee cost.");
     final Long cost = this.ncopQueryService.getLicenseFeeCost(licenseFeeParam);
     return Response.status(Status.OK).entity(cost).build();
   } catch (ServiceException e) {
     return Response.status(e.getHttpErrorCode()).entity(e.getErrorMessages()).build();
   }
 }
コード例 #13
0
 @POST
 @Path("v1.0/pricing")
 @ApiOperation(
     value = "Get NCOP Price",
     notes = "Use NCOP pricing tool to get price",
     response = AccessQuoteBasket.class,
     responseContainer = "List")
 @Consumes({MediaType.APPLICATION_JSON})
 @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
 public Response getNcopPricingResult(
     @ApiParam(required = true, value = "Addess and Service parameter") PricingParam priceParam) {
   try {
     priceParam.generateRequestId();
     logger.info("Recieved Pricing Request: " + priceParam);
     final List<AccessQuoteBasket> costItems =
         this.ncopQueryService.getNcopPricingResult(priceParam);
     return Response.status(Status.OK).entity(costItems).build();
   } catch (ServiceException e) {
     return Response.status(e.getHttpErrorCode()).entity(e.getErrorMessages()).build();
   }
 }
コード例 #14
0
 @POST
 @ApiOperation(
     value = "Validate Address",
     notes =
         "Validate an Address using the sected source and will return a list of address suggestions.",
     response = Location.class,
     responseContainer = "List")
 @Path("v1.0/validate_address")
 @Consumes({MediaType.APPLICATION_JSON})
 @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
 @ApiResponses(
     value = {
       @ApiResponse(
           code = 406,
           message = AppMessage.ERROR_INVALID_PARAMETER,
           response = ErrorMessages.class),
       @ApiResponse(
           code = 401,
           message = AppMessage.ERROR_UNAUTHORIZED_ACCESS,
           response = ErrorMessages.class),
       @ApiResponse(
           code = 404,
           message = AppMessage.ERROR_NO_ADDRESS_SUGGESTION_FOUND,
           response = ErrorMessages.class)
     })
 public Response getValidateAddress(
     @HeaderParam(Constants.HEADER_SECURITY_TOKEN) String securityToken,
     @ApiParam(required = true, value = "Address to validate and settings for validation")
         LocationParam locationParam) {
   try {
     this.securityService.getSessionUser(securityToken);
     final List<Location> locations = this.ncopQueryService.getAddressSuggestion(locationParam);
     return Response.status(Status.OK).entity(locations).build();
   } catch (ServiceException e) {
     return Response.status(e.getHttpErrorCode()).entity(e.getErrorMessages()).build();
   }
 }