@Test public void shouldNotSetServiceVdbForSingleTableMissingParameter() throws Exception { createDataservice(DATASERVICE_NAME); URI dataservicesUri = _uriBuilder.workspaceDataservicesUri(); URI uri = UriBuilder.fromUri(dataservicesUri).path(V1Constants.SERVICE_VDB_FOR_SINGLE_TABLE).build(); KomodoDataserviceUpdateAttributes updateAttr = new KomodoDataserviceUpdateAttributes(); updateAttr.setDataserviceName(DATASERVICE_NAME); updateAttr.setTablePath("/path/to/table"); ClientRequest request = request(uri, MediaType.APPLICATION_JSON_TYPE); addJsonConsumeContentType(request); addBody(request, updateAttr); ClientResponse<String> response = request.post(String.class); final String entity = response.getEntity(); assertTrue(entity.contains("missing one or more required parameters")); }
@POST @Path( StringConstants.FORWARD_SLASH + V1Constants.DATA_SERVICE_PLACEHOLDER ) @Produces( MediaType.APPLICATION_JSON ) @ApiOperation( value = "Create a dataservice in the workspace", consumes=MediaType.APPLICATION_JSON ) @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) public Response createDataservice( final @Context HttpHeaders headers, final @Context UriInfo uriInfo, @ApiParam( value = "Name of the data service", required = true ) final @PathParam( "dataserviceName" ) String dataserviceName, @ApiParam( value = "" + "JSON of the properties of the new data service:<br>" + OPEN_PRE_TAG + OPEN_BRACE + BR + NBSP + "keng\\_\\_id: \"id of the data service\"" + COMMA + BR + NBSP + OPEN_PRE_CMT + "(identical to dataserviceName parameter)" + CLOSE_PRE_CMT + BR + BR + NBSP + "tko__description: \"the description\"" + BR + CLOSE_BRACE + CLOSE_PRE_TAG, required = true ) final String dataserviceJson) throws KomodoRestException { SecurityPrincipal principal = checkSecurityContext(headers); if (principal.hasErrorResponse()) return principal.getErrorResponse(); List<MediaType> mediaTypes = headers.getAcceptableMediaTypes(); if (! isAcceptable(mediaTypes, MediaType.APPLICATION_JSON_TYPE)) return notAcceptableMediaTypesBuilder().build(); if (StringUtils.isBlank( dataserviceName )) { return createErrorResponseWithForbidden(mediaTypes, RelationalMessages.Error.DATASERVICE_SERVICE_CREATE_MISSING_NAME); } final RestDataservice restDataservice = KomodoJsonMarshaller.unmarshall( dataserviceJson, RestDataservice.class ); final String jsonDataserviceName = restDataservice.getId(); if ( StringUtils.isBlank( jsonDataserviceName ) ) { return createErrorResponseWithForbidden(mediaTypes, RelationalMessages.Error.DATASERVICE_SERVICE_JSON_MISSING_NAME); } final boolean namesMatch = dataserviceName.equals( jsonDataserviceName ); if ( !namesMatch ) { return createErrorResponseWithForbidden(mediaTypes, DATASERVICE_SERVICE_SERVICE_NAME_ERROR, dataserviceName, jsonDataserviceName); } UnitOfWork uow = null; try { uow = createTransaction(principal, "createDataservice", false ); if ( getWorkspaceManager(uow).hasChild( uow, dataserviceName ) ) { return createErrorResponseWithForbidden(mediaTypes, RelationalMessages.Error.DATASERVICE_SERVICE_CREATE_ALREADY_EXISTS); } return doAddDataservice( uow, uriInfo.getBaseUri(), mediaTypes, restDataservice ); } catch (final Exception e) { if ((uow != null) && (uow.getState() != State.ROLLED_BACK)) { uow.rollback(); } if (e instanceof KomodoRestException) { throw (KomodoRestException)e; } return createErrorResponseWithForbidden(mediaTypes, e, DATASERVICE_SERVICE_CREATE_DATASERVICE_ERROR, dataserviceName); } }
KomodoDataserviceService extends KomodoService { @POST @Path( StringConstants.FORWARD_SLASH + V1Constants.DATA_SERVICE_PLACEHOLDER ) @Produces( MediaType.APPLICATION_JSON ) @ApiOperation( value = "Create a dataservice in the workspace", consumes=MediaType.APPLICATION_JSON ) @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) public Response createDataservice( final @Context HttpHeaders headers, final @Context UriInfo uriInfo, @ApiParam( value = "Name of the data service", required = true ) final @PathParam( "dataserviceName" ) String dataserviceName, @ApiParam( value = "" + "JSON of the properties of the new data service:<br>" + OPEN_PRE_TAG + OPEN_BRACE + BR + NBSP + "keng\\_\\_id: \"id of the data service\"" + COMMA + BR + NBSP + OPEN_PRE_CMT + "(identical to dataserviceName parameter)" + CLOSE_PRE_CMT + BR + BR + NBSP + "tko__description: \"the description\"" + BR + CLOSE_BRACE + CLOSE_PRE_TAG, required = true ) final String dataserviceJson) throws KomodoRestException { SecurityPrincipal principal = checkSecurityContext(headers); if (principal.hasErrorResponse()) return principal.getErrorResponse(); List<MediaType> mediaTypes = headers.getAcceptableMediaTypes(); if (! isAcceptable(mediaTypes, MediaType.APPLICATION_JSON_TYPE)) return notAcceptableMediaTypesBuilder().build(); if (StringUtils.isBlank( dataserviceName )) { return createErrorResponseWithForbidden(mediaTypes, RelationalMessages.Error.DATASERVICE_SERVICE_CREATE_MISSING_NAME); } final RestDataservice restDataservice = KomodoJsonMarshaller.unmarshall( dataserviceJson, RestDataservice.class ); final String jsonDataserviceName = restDataservice.getId(); if ( StringUtils.isBlank( jsonDataserviceName ) ) { return createErrorResponseWithForbidden(mediaTypes, RelationalMessages.Error.DATASERVICE_SERVICE_JSON_MISSING_NAME); } final boolean namesMatch = dataserviceName.equals( jsonDataserviceName ); if ( !namesMatch ) { return createErrorResponseWithForbidden(mediaTypes, DATASERVICE_SERVICE_SERVICE_NAME_ERROR, dataserviceName, jsonDataserviceName); } UnitOfWork uow = null; try { uow = createTransaction(principal, "createDataservice", false ); if ( getWorkspaceManager(uow).hasChild( uow, dataserviceName ) ) { return createErrorResponseWithForbidden(mediaTypes, RelationalMessages.Error.DATASERVICE_SERVICE_CREATE_ALREADY_EXISTS); } return doAddDataservice( uow, uriInfo.getBaseUri(), mediaTypes, restDataservice ); } catch (final Exception e) { if ((uow != null) && (uow.getState() != State.ROLLED_BACK)) { uow.rollback(); } if (e instanceof KomodoRestException) { throw (KomodoRestException)e; } return createErrorResponseWithForbidden(mediaTypes, e, DATASERVICE_SERVICE_CREATE_DATASERVICE_ERROR, dataserviceName); } } }
KomodoDataserviceService extends KomodoService { @POST @Path( StringConstants.FORWARD_SLASH + V1Constants.DATA_SERVICE_PLACEHOLDER ) @Produces( MediaType.APPLICATION_JSON ) @ApiOperation( value = "Create a dataservice in the workspace", consumes=MediaType.APPLICATION_JSON ) @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) public Response createDataservice( final @Context HttpHeaders headers, final @Context UriInfo uriInfo, @ApiParam( value = "Name of the data service", required = true ) final @PathParam( "dataserviceName" ) String dataserviceName, @ApiParam( value = "" + "JSON of the properties of the new data service:<br>" + OPEN_PRE_TAG + OPEN_BRACE + BR + NBSP + "keng\\_\\_id: \"id of the data service\"" + COMMA + BR + NBSP + OPEN_PRE_CMT + "(identical to dataserviceName parameter)" + CLOSE_PRE_CMT + BR + BR + NBSP + "tko__description: \"the description\"" + BR + CLOSE_BRACE + CLOSE_PRE_TAG, required = true ) final String dataserviceJson) throws KomodoRestException { SecurityPrincipal principal = checkSecurityContext(headers); if (principal.hasErrorResponse()) return principal.getErrorResponse(); List<MediaType> mediaTypes = headers.getAcceptableMediaTypes(); if (! isAcceptable(mediaTypes, MediaType.APPLICATION_JSON_TYPE)) return notAcceptableMediaTypesBuilder().build(); if (StringUtils.isBlank( dataserviceName )) { return createErrorResponseWithForbidden(mediaTypes, RelationalMessages.Error.DATASERVICE_SERVICE_CREATE_MISSING_NAME); } final RestDataservice restDataservice = KomodoJsonMarshaller.unmarshall( dataserviceJson, RestDataservice.class ); final String jsonDataserviceName = restDataservice.getId(); if ( StringUtils.isBlank( jsonDataserviceName ) ) { return createErrorResponseWithForbidden(mediaTypes, RelationalMessages.Error.DATASERVICE_SERVICE_JSON_MISSING_NAME); } final boolean namesMatch = dataserviceName.equals( jsonDataserviceName ); if ( !namesMatch ) { return createErrorResponseWithForbidden(mediaTypes, DATASERVICE_SERVICE_SERVICE_NAME_ERROR, dataserviceName, jsonDataserviceName); } UnitOfWork uow = null; try { uow = createTransaction(principal, "createDataservice", false ); if ( getWorkspaceManager(uow).hasChild( uow, dataserviceName ) ) { return createErrorResponseWithForbidden(mediaTypes, RelationalMessages.Error.DATASERVICE_SERVICE_CREATE_ALREADY_EXISTS); } return doAddDataservice( uow, uriInfo.getBaseUri(), mediaTypes, restDataservice ); } catch (final Exception e) { if ((uow != null) && (uow.getState() != State.ROLLED_BACK)) { uow.rollback(); } if (e instanceof KomodoRestException) { throw (KomodoRestException)e; } return createErrorResponseWithForbidden(mediaTypes, e, DATASERVICE_SERVICE_CREATE_DATASERVICE_ERROR, dataserviceName); } } KomodoDataserviceService( final KEngine engine ); }
KomodoDataserviceService extends KomodoService { @POST @Path( StringConstants.FORWARD_SLASH + V1Constants.DATA_SERVICE_PLACEHOLDER ) @Produces( MediaType.APPLICATION_JSON ) @ApiOperation( value = "Create a dataservice in the workspace", consumes=MediaType.APPLICATION_JSON ) @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) public Response createDataservice( final @Context HttpHeaders headers, final @Context UriInfo uriInfo, @ApiParam( value = "Name of the data service", required = true ) final @PathParam( "dataserviceName" ) String dataserviceName, @ApiParam( value = "" + "JSON of the properties of the new data service:<br>" + OPEN_PRE_TAG + OPEN_BRACE + BR + NBSP + "keng\\_\\_id: \"id of the data service\"" + COMMA + BR + NBSP + OPEN_PRE_CMT + "(identical to dataserviceName parameter)" + CLOSE_PRE_CMT + BR + BR + NBSP + "tko__description: \"the description\"" + BR + CLOSE_BRACE + CLOSE_PRE_TAG, required = true ) final String dataserviceJson) throws KomodoRestException { SecurityPrincipal principal = checkSecurityContext(headers); if (principal.hasErrorResponse()) return principal.getErrorResponse(); List<MediaType> mediaTypes = headers.getAcceptableMediaTypes(); if (! isAcceptable(mediaTypes, MediaType.APPLICATION_JSON_TYPE)) return notAcceptableMediaTypesBuilder().build(); if (StringUtils.isBlank( dataserviceName )) { return createErrorResponseWithForbidden(mediaTypes, RelationalMessages.Error.DATASERVICE_SERVICE_CREATE_MISSING_NAME); } final RestDataservice restDataservice = KomodoJsonMarshaller.unmarshall( dataserviceJson, RestDataservice.class ); final String jsonDataserviceName = restDataservice.getId(); if ( StringUtils.isBlank( jsonDataserviceName ) ) { return createErrorResponseWithForbidden(mediaTypes, RelationalMessages.Error.DATASERVICE_SERVICE_JSON_MISSING_NAME); } final boolean namesMatch = dataserviceName.equals( jsonDataserviceName ); if ( !namesMatch ) { return createErrorResponseWithForbidden(mediaTypes, DATASERVICE_SERVICE_SERVICE_NAME_ERROR, dataserviceName, jsonDataserviceName); } UnitOfWork uow = null; try { uow = createTransaction(principal, "createDataservice", false ); if ( getWorkspaceManager(uow).hasChild( uow, dataserviceName ) ) { return createErrorResponseWithForbidden(mediaTypes, RelationalMessages.Error.DATASERVICE_SERVICE_CREATE_ALREADY_EXISTS); } return doAddDataservice( uow, uriInfo.getBaseUri(), mediaTypes, restDataservice ); } catch (final Exception e) { if ((uow != null) && (uow.getState() != State.ROLLED_BACK)) { uow.rollback(); } if (e instanceof KomodoRestException) { throw (KomodoRestException)e; } return createErrorResponseWithForbidden(mediaTypes, e, DATASERVICE_SERVICE_CREATE_DATASERVICE_ERROR, dataserviceName); } } KomodoDataserviceService( final KEngine engine ); @GET @Produces( MediaType.APPLICATION_JSON ) @ApiOperation( value = "Return the collection of data services", response = RestDataservice[].class) @ApiImplicitParams({ @ApiImplicitParam( name = QueryParamKeys.PATTERN, value = "A regex expression used when searching. If not present, all objects are returned.", required = false, dataType = "string", paramType = "query"), @ApiImplicitParam( name = QueryParamKeys.SIZE, value = "The number of objects to return. If not present, all objects are returned", required = false, dataType = "integer", paramType = "query"), @ApiImplicitParam( name = QueryParamKeys.START, value = "Index of the first dataservice to return", required = false, dataType = "integer", paramType = "query") }) @ApiResponses( value = { @ApiResponse( code = 403, message = "An error has occurred.") } ) Response getDataservices( final @Context HttpHeaders headers,
                                     final @Context UriInfo uriInfo ); @GET @Path( V1Constants.DATA_SERVICE_PLACEHOLDER ) @Produces( { MediaType.APPLICATION_JSON } ) @ApiOperation( value = "Find dataservice by name", response = RestDataservice.class) @ApiResponses(value = { @ApiResponse(code = 404, message = "No Dataservice could be found with name"), @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response getDataservice( final @Context HttpHeaders headers,
                                    final @Context UriInfo uriInfo,
                                    @ApiParam(
                                              value = "Id of the dataservice to be fetched, ie. the value of the 'keng__id' property",
                                              required = true
                                    )
                                    final @PathParam( "dataserviceName" ) String dataserviceName); @POST @Path( StringConstants.FORWARD_SLASH + V1Constants.DATA_SERVICE_PLACEHOLDER ) @Produces( MediaType.APPLICATION_JSON ) @ApiOperation( value = "Create a dataservice in the workspace", consumes=MediaType.APPLICATION_JSON ) @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response createDataservice( final @Context HttpHeaders headers,
                                       final @Context UriInfo uriInfo,
                                       @ApiParam(
                                                 value = "Name of the data service",
                                                 required = true
                                       )
                                       final @PathParam( "dataserviceName" ) String dataserviceName,
                                       @ApiParam(
                                                 value = "" + 
                                                         "JSON of the properties of the new data service:<br>" +
                                                         OPEN_PRE_TAG +
                                                         OPEN_BRACE + BR +
                                                         NBSP + "keng\\_\\_id: \"id of the data service\"" + COMMA + BR +
                                                         NBSP + OPEN_PRE_CMT + "(identical to dataserviceName parameter)" + CLOSE_PRE_CMT + BR + BR +
                                                         NBSP + "tko__description: \"the description\"" + BR +
                                                         CLOSE_BRACE +
                                                         CLOSE_PRE_TAG,
                                                 required = true
                                       )
                                       final String dataserviceJson); @POST @Path( StringConstants.FORWARD_SLASH + V1Constants.CLONE_SEGMENT + StringConstants.FORWARD_SLASH + V1Constants.DATA_SERVICE_PLACEHOLDER ) @Produces( MediaType.APPLICATION_JSON ) @ApiOperation(value = "Clone a dataservice in the workspace") @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response cloneDataservice( final @Context HttpHeaders headers,
                                       final @Context UriInfo uriInfo,
                                       @ApiParam(
                                                 value = "Name of the data service",
                                                 required = true
                                       )
                                       final @PathParam( "dataserviceName" ) String dataserviceName,
                                       @ApiParam(
                                                 value = "Name of the cloned data service",
                                                 required = true
                                       )
                                       final String newDataserviceName); @POST @Path( StringConstants.FORWARD_SLASH + V1Constants.SERVICE_VDB_FOR_SINGLE_TABLE ) @Produces( MediaType.APPLICATION_JSON ) @ApiOperation(value = "Sets the data service's service vdb") @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response setServiceVdbForSingleTable( final @Context HttpHeaders headers,
    		final @Context UriInfo uriInfo,
    		@ApiParam(
                      value = "" + 
                              "JSON specifying the service vdb:<br>" +
                              OPEN_PRE_TAG +
                              OPEN_BRACE + BR +
                              NBSP + "dataserviceName: \"name of the data service\"" + COMMA + BR +
                              NBSP + "tablePath: \"/path/to/table\"" + COMMA + BR +
                              NBSP + "modelSourcePath: \"/path/to/modelSource\"" + COMMA + BR +
                              NBSP + "columnNames: {name1, name2, ...} [OPTIONAL]" + COMMA + BR +
                              NBSP + "viewDdl: \"DDL for the service view\" [OPTIONAL]" + BR +
                              CLOSE_BRACE +
                              CLOSE_PRE_TAG,
                      required = true
            )
    		final String dataserviceUpdateAttributes); @POST @Path( StringConstants.FORWARD_SLASH + V1Constants.SERVICE_VIEW_DDL_FOR_SINGLE_TABLE ) @Produces( MediaType.APPLICATION_JSON ) @ApiOperation(value = "Gets generated View DDL using parameters provided in the request body") @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response getServiceViewDdlForSingleTable( final @Context HttpHeaders headers,
                                                     final @Context UriInfo uriInfo,
                                                     @ApiParam(
                                                               value = "" + 
                                                                       "JSON parameters:<br>" +
                                                                       OPEN_PRE_TAG +
                                                                       OPEN_BRACE + BR +
                                                                       NBSP + "dataserviceName: \"name of the data service\"" + COMMA + BR +
                                                                       NBSP + "tablePath: \"/path/to/table\"" + COMMA + BR +
                                                                       NBSP + "modelSourcePath: \"/path/to/modelSource\"" + COMMA + BR +
                                                                       NBSP + "columnNames: {name1, name2, ...} [OPTIONAL]" + COMMA + BR +
                                                                       NBSP + "viewDdl: \"DDL for the service view\" [OPTIONAL]" + BR +
                                                                       CLOSE_BRACE +
                                                                       CLOSE_PRE_TAG,
                                                               required = true
                                                     )
                                                     final String dataserviceUpdateAttributes); @POST @Path( StringConstants.FORWARD_SLASH + V1Constants.SERVICE_VDB_FOR_JOIN_TABLES ) @Produces( MediaType.APPLICATION_JSON ) @ApiOperation(value = "Sets the dataservice vdb using parameters provided in the request body") @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response setServiceVdbForTwoTables( final @Context HttpHeaders headers,
            final @Context UriInfo uriInfo,
            @ApiParam(
                      value = "" + 
                              "JSON parameters:<br>" +
                              OPEN_PRE_TAG +
                              OPEN_BRACE + BR +
                              NBSP + "dataserviceName: \"name of the data service\"" + COMMA + BR +
                              NBSP + "tablePath: \"/path/to/table\"" + COMMA + BR +
                              NBSP + "rhTablePath: \"/path/to/table\"" + COMMA + BR +
                              NBSP + "modelSourcePath: \"/path/to/modelSource\"" + COMMA + BR +
                              NBSP + "rhModelSourcePath: \"/path/to/modelSource\"" + COMMA + BR +
                              NBSP + "columnNames: {name1, name2, ...} [OPTIONAL]" + COMMA + BR +
                              NBSP + "rhColumnNames: {name1, name2, ...} [OPTIONAL]" + COMMA + BR +
                              NBSP + "viewDdl: \"DDL for the service view\" [OPTIONAL]" + COMMA + BR +
                              NBSP + "joinType: \"Type of join\"" + COMMA + BR +
                              NBSP + "criteriaPredicates: []" + BR +
                              CLOSE_BRACE +
                              CLOSE_PRE_TAG,
                      required = true
            )
            final String dataserviceUpdateAttributes); @POST @Path( StringConstants.FORWARD_SLASH + V1Constants.SERVICE_VIEW_DDL_FOR_JOIN_TABLES ) @Produces( MediaType.APPLICATION_JSON ) @ApiOperation(value = "Gets generated View DDL using parameters provided in the request body") @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response getServiceViewDdlForTwoTables( final @Context HttpHeaders headers,
            final @Context UriInfo uriInfo,
            @ApiParam(
                      value = "" + 
                              "JSON parameters:<br>" +
                              OPEN_PRE_TAG +
                              OPEN_BRACE + BR +
                              NBSP + "dataserviceName: \"name of the data service\"" + COMMA + BR +
                              NBSP + "tablePath: \"/path/to/table\"" + COMMA + BR +
                              NBSP + "rhTablePath: \"/path/to/table\"" + COMMA + BR +
                              NBSP + "columnNames: {name1, name2, ...} [OPTIONAL]" + COMMA + BR +
                              NBSP + "rhColumnNames: {name1, name2, ...} [OPTIONAL]" + COMMA + BR +
                              NBSP + "joinType: \"Type of join\"" + COMMA + BR +
                              NBSP + "criteriaPredicates: []" + BR +
                              CLOSE_BRACE +
                              CLOSE_PRE_TAG,
                      required = true
            )
            final String dataserviceUpdateAttributes); @POST @Path( StringConstants.FORWARD_SLASH + V1Constants.CRITERIA_FOR_JOIN_TABLES ) @Produces( MediaType.APPLICATION_JSON ) @ApiOperation(value = "Generates join criteria using table parameters provided in the request body") @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response getJoinCriteriaForTables( final @Context HttpHeaders headers,
            final @Context UriInfo uriInfo,
            @ApiParam(
                      value = "" + 
                              "JSON parameters:<br>" +
                              OPEN_PRE_TAG +
                              OPEN_BRACE + BR +
                              NBSP + "tablePath: \"/path/to/table\"" + COMMA + BR +
                              NBSP + "rhTablePath: \"/path/to/table\"" + COMMA + BR +
                              CLOSE_BRACE +
                              CLOSE_PRE_TAG,
                      required = true
            )
            final String dataserviceUpdateAttributes); @PUT @Path( StringConstants.FORWARD_SLASH + V1Constants.DATA_SERVICE_PLACEHOLDER ) @Produces( MediaType.APPLICATION_JSON ) @ApiOperation(value = "Update a dataservice in the workspace") @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response updateDataservice( final @Context HttpHeaders headers,
                                       final @Context UriInfo uriInfo,
                                       @ApiParam(
                                                 value = "Name of the data service to be updated",
                                                 required = true
                                       )
                                       final @PathParam( "dataserviceName" ) String dataserviceName,
                                       @ApiParam(
                                                 value = "" + 
                                                         "JSON of the data service properties to update:<br>" +
                                                         OPEN_PRE_TAG +
                                                         OPEN_BRACE + BR +
                                                         NBSP + "keng\\_\\_id: \"id of the data service\"" + COMMA + BR +
                                                         NBSP + OPEN_PRE_CMT + "(identical to dataserviceName parameter)" + CLOSE_PRE_CMT + BR + BR +
                                                         NBSP + "tko__description: \"the description\"" + BR +
                                                         CLOSE_BRACE +
                                                         CLOSE_PRE_TAG,
                                                 required = true
                                       )
                                       final String dataserviceJson); @DELETE @Path("{dataserviceName}") @Produces( MediaType.APPLICATION_JSON ) @ApiOperation(value = "Delete a dataservice from the workspace") @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response deleteDataservice( final @Context HttpHeaders headers,
                                       final @Context UriInfo uriInfo,
                                       @ApiParam(
                                                 value = "Name of the data service to be deleted",
                                                 required = true
                                       )
                                       final @PathParam( "dataserviceName" ) String dataserviceName); @GET @Path( V1Constants.DATA_SERVICE_PLACEHOLDER + StringConstants.FORWARD_SLASH + V1Constants.CONNECTIONS_SEGMENT) @Produces( { MediaType.APPLICATION_JSON } ) @ApiOperation(value = "Find a dataservice's connections ", response = RestDataservice.class) @ApiResponses(value = { @ApiResponse(code = 404, message = "No Dataservice could be found with name"), @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response getConnections( final @Context HttpHeaders headers,
                                    final @Context UriInfo uriInfo,
                                    @ApiParam(
                                              value = "Name of the data service containing the required connections",
                                              required = true
                                    )
                                    final @PathParam( "dataserviceName" ) String dataserviceName); @GET @Path( V1Constants.DATA_SERVICE_PLACEHOLDER + StringConstants.FORWARD_SLASH + V1Constants.DRIVERS_SEGMENT) @Produces( { MediaType.APPLICATION_JSON } ) @ApiOperation(value = "Find a dataservice's drivers ", response = RestConnectionDriver.class) @ApiResponses(value = { @ApiResponse(code = 404, message = "No Dataservice could be found with name"), @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response getDrivers( final @Context HttpHeaders headers,
                                    final @Context UriInfo uriInfo,
                                    @ApiParam(
                                              value = "Name of the data service containing the required drivers",
                                              required = true
                                    )
                                    final @PathParam( "dataserviceName" ) String dataserviceName); @GET @Path( V1Constants.DATA_SERVICE_PLACEHOLDER + StringConstants.FORWARD_SLASH + V1Constants.SOURCE_VDB_MATCHES) @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } ) @ApiOperation(value = "Find workspace source VDB matches for a Dataservice", response = RestVdb[].class) @ApiResponses(value = { @ApiResponse(code = 404, message = "No dataservice could be found with name"), @ApiResponse(code = 406, message = "Only JSON or XML is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response getSourceVdbsForDataService( final @Context HttpHeaders headers,
                                                 final @Context UriInfo uriInfo,
                                                 @ApiParam(
                                                           value = "Name of the data service containing the required source vdbs",
                                                           required = true
                                                 )
                                                 final @PathParam( "dataserviceName" ) String dataserviceName); @GET @Path( V1Constants.DATA_SERVICE_PLACEHOLDER + StringConstants.FORWARD_SLASH + V1Constants.SERVICE_VIEW_INFO) @Produces( { MediaType.APPLICATION_JSON } ) @ApiOperation(value = "retrieve the service view information for a dataservice") @ApiResponses(value = { @ApiResponse(code = 404, message = "No dataservice could be found with name"), @ApiResponse(code = 406, message = "Only JSON or XML is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response getServiceViewInfoForDataService( final @Context HttpHeaders headers,
                                                      final @Context UriInfo uriInfo,
                                                      @ApiParam(
                                                                value = "Name of the required data service",
                                                                required = true
                                                      )
                                                      final @PathParam( "dataserviceName" ) String dataserviceName); @GET @Path( V1Constants.NAME_VALIDATION_SEGMENT + StringConstants.FORWARD_SLASH + V1Constants.DATA_SERVICE_PLACEHOLDER ) @Produces( { MediaType.TEXT_PLAIN } ) @ApiOperation( value = "Returns an error message if the data service name is invalid" ) @ApiResponses( value = { @ApiResponse( code = 400, message = "The URI cannot contain encoded slashes or backslashes." ), @ApiResponse( code = 403, message = "An unexpected error has occurred." ), @ApiResponse( code = 500, message = "The dataservice name cannot be empty." ) } ) Response validateDataserviceName( final @Context HttpHeaders headers,
                                             final @Context UriInfo uriInfo,
                                             @ApiParam( value = "The dataservice name being checked", required = true )
                                             final @PathParam( "dataserviceName" ) String dataserviceName ); }
KomodoDataserviceService extends KomodoService { @POST @Path( StringConstants.FORWARD_SLASH + V1Constants.DATA_SERVICE_PLACEHOLDER ) @Produces( MediaType.APPLICATION_JSON ) @ApiOperation( value = "Create a dataservice in the workspace", consumes=MediaType.APPLICATION_JSON ) @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) public Response createDataservice( final @Context HttpHeaders headers, final @Context UriInfo uriInfo, @ApiParam( value = "Name of the data service", required = true ) final @PathParam( "dataserviceName" ) String dataserviceName, @ApiParam( value = "" + "JSON of the properties of the new data service:<br>" + OPEN_PRE_TAG + OPEN_BRACE + BR + NBSP + "keng\\_\\_id: \"id of the data service\"" + COMMA + BR + NBSP + OPEN_PRE_CMT + "(identical to dataserviceName parameter)" + CLOSE_PRE_CMT + BR + BR + NBSP + "tko__description: \"the description\"" + BR + CLOSE_BRACE + CLOSE_PRE_TAG, required = true ) final String dataserviceJson) throws KomodoRestException { SecurityPrincipal principal = checkSecurityContext(headers); if (principal.hasErrorResponse()) return principal.getErrorResponse(); List<MediaType> mediaTypes = headers.getAcceptableMediaTypes(); if (! isAcceptable(mediaTypes, MediaType.APPLICATION_JSON_TYPE)) return notAcceptableMediaTypesBuilder().build(); if (StringUtils.isBlank( dataserviceName )) { return createErrorResponseWithForbidden(mediaTypes, RelationalMessages.Error.DATASERVICE_SERVICE_CREATE_MISSING_NAME); } final RestDataservice restDataservice = KomodoJsonMarshaller.unmarshall( dataserviceJson, RestDataservice.class ); final String jsonDataserviceName = restDataservice.getId(); if ( StringUtils.isBlank( jsonDataserviceName ) ) { return createErrorResponseWithForbidden(mediaTypes, RelationalMessages.Error.DATASERVICE_SERVICE_JSON_MISSING_NAME); } final boolean namesMatch = dataserviceName.equals( jsonDataserviceName ); if ( !namesMatch ) { return createErrorResponseWithForbidden(mediaTypes, DATASERVICE_SERVICE_SERVICE_NAME_ERROR, dataserviceName, jsonDataserviceName); } UnitOfWork uow = null; try { uow = createTransaction(principal, "createDataservice", false ); if ( getWorkspaceManager(uow).hasChild( uow, dataserviceName ) ) { return createErrorResponseWithForbidden(mediaTypes, RelationalMessages.Error.DATASERVICE_SERVICE_CREATE_ALREADY_EXISTS); } return doAddDataservice( uow, uriInfo.getBaseUri(), mediaTypes, restDataservice ); } catch (final Exception e) { if ((uow != null) && (uow.getState() != State.ROLLED_BACK)) { uow.rollback(); } if (e instanceof KomodoRestException) { throw (KomodoRestException)e; } return createErrorResponseWithForbidden(mediaTypes, e, DATASERVICE_SERVICE_CREATE_DATASERVICE_ERROR, dataserviceName); } } KomodoDataserviceService( final KEngine engine ); @GET @Produces( MediaType.APPLICATION_JSON ) @ApiOperation( value = "Return the collection of data services", response = RestDataservice[].class) @ApiImplicitParams({ @ApiImplicitParam( name = QueryParamKeys.PATTERN, value = "A regex expression used when searching. If not present, all objects are returned.", required = false, dataType = "string", paramType = "query"), @ApiImplicitParam( name = QueryParamKeys.SIZE, value = "The number of objects to return. If not present, all objects are returned", required = false, dataType = "integer", paramType = "query"), @ApiImplicitParam( name = QueryParamKeys.START, value = "Index of the first dataservice to return", required = false, dataType = "integer", paramType = "query") }) @ApiResponses( value = { @ApiResponse( code = 403, message = "An error has occurred.") } ) Response getDataservices( final @Context HttpHeaders headers,
                                     final @Context UriInfo uriInfo ); @GET @Path( V1Constants.DATA_SERVICE_PLACEHOLDER ) @Produces( { MediaType.APPLICATION_JSON } ) @ApiOperation( value = "Find dataservice by name", response = RestDataservice.class) @ApiResponses(value = { @ApiResponse(code = 404, message = "No Dataservice could be found with name"), @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response getDataservice( final @Context HttpHeaders headers,
                                    final @Context UriInfo uriInfo,
                                    @ApiParam(
                                              value = "Id of the dataservice to be fetched, ie. the value of the 'keng__id' property",
                                              required = true
                                    )
                                    final @PathParam( "dataserviceName" ) String dataserviceName); @POST @Path( StringConstants.FORWARD_SLASH + V1Constants.DATA_SERVICE_PLACEHOLDER ) @Produces( MediaType.APPLICATION_JSON ) @ApiOperation( value = "Create a dataservice in the workspace", consumes=MediaType.APPLICATION_JSON ) @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response createDataservice( final @Context HttpHeaders headers,
                                       final @Context UriInfo uriInfo,
                                       @ApiParam(
                                                 value = "Name of the data service",
                                                 required = true
                                       )
                                       final @PathParam( "dataserviceName" ) String dataserviceName,
                                       @ApiParam(
                                                 value = "" + 
                                                         "JSON of the properties of the new data service:<br>" +
                                                         OPEN_PRE_TAG +
                                                         OPEN_BRACE + BR +
                                                         NBSP + "keng\\_\\_id: \"id of the data service\"" + COMMA + BR +
                                                         NBSP + OPEN_PRE_CMT + "(identical to dataserviceName parameter)" + CLOSE_PRE_CMT + BR + BR +
                                                         NBSP + "tko__description: \"the description\"" + BR +
                                                         CLOSE_BRACE +
                                                         CLOSE_PRE_TAG,
                                                 required = true
                                       )
                                       final String dataserviceJson); @POST @Path( StringConstants.FORWARD_SLASH + V1Constants.CLONE_SEGMENT + StringConstants.FORWARD_SLASH + V1Constants.DATA_SERVICE_PLACEHOLDER ) @Produces( MediaType.APPLICATION_JSON ) @ApiOperation(value = "Clone a dataservice in the workspace") @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response cloneDataservice( final @Context HttpHeaders headers,
                                       final @Context UriInfo uriInfo,
                                       @ApiParam(
                                                 value = "Name of the data service",
                                                 required = true
                                       )
                                       final @PathParam( "dataserviceName" ) String dataserviceName,
                                       @ApiParam(
                                                 value = "Name of the cloned data service",
                                                 required = true
                                       )
                                       final String newDataserviceName); @POST @Path( StringConstants.FORWARD_SLASH + V1Constants.SERVICE_VDB_FOR_SINGLE_TABLE ) @Produces( MediaType.APPLICATION_JSON ) @ApiOperation(value = "Sets the data service's service vdb") @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response setServiceVdbForSingleTable( final @Context HttpHeaders headers,
    		final @Context UriInfo uriInfo,
    		@ApiParam(
                      value = "" + 
                              "JSON specifying the service vdb:<br>" +
                              OPEN_PRE_TAG +
                              OPEN_BRACE + BR +
                              NBSP + "dataserviceName: \"name of the data service\"" + COMMA + BR +
                              NBSP + "tablePath: \"/path/to/table\"" + COMMA + BR +
                              NBSP + "modelSourcePath: \"/path/to/modelSource\"" + COMMA + BR +
                              NBSP + "columnNames: {name1, name2, ...} [OPTIONAL]" + COMMA + BR +
                              NBSP + "viewDdl: \"DDL for the service view\" [OPTIONAL]" + BR +
                              CLOSE_BRACE +
                              CLOSE_PRE_TAG,
                      required = true
            )
    		final String dataserviceUpdateAttributes); @POST @Path( StringConstants.FORWARD_SLASH + V1Constants.SERVICE_VIEW_DDL_FOR_SINGLE_TABLE ) @Produces( MediaType.APPLICATION_JSON ) @ApiOperation(value = "Gets generated View DDL using parameters provided in the request body") @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response getServiceViewDdlForSingleTable( final @Context HttpHeaders headers,
                                                     final @Context UriInfo uriInfo,
                                                     @ApiParam(
                                                               value = "" + 
                                                                       "JSON parameters:<br>" +
                                                                       OPEN_PRE_TAG +
                                                                       OPEN_BRACE + BR +
                                                                       NBSP + "dataserviceName: \"name of the data service\"" + COMMA + BR +
                                                                       NBSP + "tablePath: \"/path/to/table\"" + COMMA + BR +
                                                                       NBSP + "modelSourcePath: \"/path/to/modelSource\"" + COMMA + BR +
                                                                       NBSP + "columnNames: {name1, name2, ...} [OPTIONAL]" + COMMA + BR +
                                                                       NBSP + "viewDdl: \"DDL for the service view\" [OPTIONAL]" + BR +
                                                                       CLOSE_BRACE +
                                                                       CLOSE_PRE_TAG,
                                                               required = true
                                                     )
                                                     final String dataserviceUpdateAttributes); @POST @Path( StringConstants.FORWARD_SLASH + V1Constants.SERVICE_VDB_FOR_JOIN_TABLES ) @Produces( MediaType.APPLICATION_JSON ) @ApiOperation(value = "Sets the dataservice vdb using parameters provided in the request body") @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response setServiceVdbForTwoTables( final @Context HttpHeaders headers,
            final @Context UriInfo uriInfo,
            @ApiParam(
                      value = "" + 
                              "JSON parameters:<br>" +
                              OPEN_PRE_TAG +
                              OPEN_BRACE + BR +
                              NBSP + "dataserviceName: \"name of the data service\"" + COMMA + BR +
                              NBSP + "tablePath: \"/path/to/table\"" + COMMA + BR +
                              NBSP + "rhTablePath: \"/path/to/table\"" + COMMA + BR +
                              NBSP + "modelSourcePath: \"/path/to/modelSource\"" + COMMA + BR +
                              NBSP + "rhModelSourcePath: \"/path/to/modelSource\"" + COMMA + BR +
                              NBSP + "columnNames: {name1, name2, ...} [OPTIONAL]" + COMMA + BR +
                              NBSP + "rhColumnNames: {name1, name2, ...} [OPTIONAL]" + COMMA + BR +
                              NBSP + "viewDdl: \"DDL for the service view\" [OPTIONAL]" + COMMA + BR +
                              NBSP + "joinType: \"Type of join\"" + COMMA + BR +
                              NBSP + "criteriaPredicates: []" + BR +
                              CLOSE_BRACE +
                              CLOSE_PRE_TAG,
                      required = true
            )
            final String dataserviceUpdateAttributes); @POST @Path( StringConstants.FORWARD_SLASH + V1Constants.SERVICE_VIEW_DDL_FOR_JOIN_TABLES ) @Produces( MediaType.APPLICATION_JSON ) @ApiOperation(value = "Gets generated View DDL using parameters provided in the request body") @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response getServiceViewDdlForTwoTables( final @Context HttpHeaders headers,
            final @Context UriInfo uriInfo,
            @ApiParam(
                      value = "" + 
                              "JSON parameters:<br>" +
                              OPEN_PRE_TAG +
                              OPEN_BRACE + BR +
                              NBSP + "dataserviceName: \"name of the data service\"" + COMMA + BR +
                              NBSP + "tablePath: \"/path/to/table\"" + COMMA + BR +
                              NBSP + "rhTablePath: \"/path/to/table\"" + COMMA + BR +
                              NBSP + "columnNames: {name1, name2, ...} [OPTIONAL]" + COMMA + BR +
                              NBSP + "rhColumnNames: {name1, name2, ...} [OPTIONAL]" + COMMA + BR +
                              NBSP + "joinType: \"Type of join\"" + COMMA + BR +
                              NBSP + "criteriaPredicates: []" + BR +
                              CLOSE_BRACE +
                              CLOSE_PRE_TAG,
                      required = true
            )
            final String dataserviceUpdateAttributes); @POST @Path( StringConstants.FORWARD_SLASH + V1Constants.CRITERIA_FOR_JOIN_TABLES ) @Produces( MediaType.APPLICATION_JSON ) @ApiOperation(value = "Generates join criteria using table parameters provided in the request body") @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response getJoinCriteriaForTables( final @Context HttpHeaders headers,
            final @Context UriInfo uriInfo,
            @ApiParam(
                      value = "" + 
                              "JSON parameters:<br>" +
                              OPEN_PRE_TAG +
                              OPEN_BRACE + BR +
                              NBSP + "tablePath: \"/path/to/table\"" + COMMA + BR +
                              NBSP + "rhTablePath: \"/path/to/table\"" + COMMA + BR +
                              CLOSE_BRACE +
                              CLOSE_PRE_TAG,
                      required = true
            )
            final String dataserviceUpdateAttributes); @PUT @Path( StringConstants.FORWARD_SLASH + V1Constants.DATA_SERVICE_PLACEHOLDER ) @Produces( MediaType.APPLICATION_JSON ) @ApiOperation(value = "Update a dataservice in the workspace") @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response updateDataservice( final @Context HttpHeaders headers,
                                       final @Context UriInfo uriInfo,
                                       @ApiParam(
                                                 value = "Name of the data service to be updated",
                                                 required = true
                                       )
                                       final @PathParam( "dataserviceName" ) String dataserviceName,
                                       @ApiParam(
                                                 value = "" + 
                                                         "JSON of the data service properties to update:<br>" +
                                                         OPEN_PRE_TAG +
                                                         OPEN_BRACE + BR +
                                                         NBSP + "keng\\_\\_id: \"id of the data service\"" + COMMA + BR +
                                                         NBSP + OPEN_PRE_CMT + "(identical to dataserviceName parameter)" + CLOSE_PRE_CMT + BR + BR +
                                                         NBSP + "tko__description: \"the description\"" + BR +
                                                         CLOSE_BRACE +
                                                         CLOSE_PRE_TAG,
                                                 required = true
                                       )
                                       final String dataserviceJson); @DELETE @Path("{dataserviceName}") @Produces( MediaType.APPLICATION_JSON ) @ApiOperation(value = "Delete a dataservice from the workspace") @ApiResponses(value = { @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response deleteDataservice( final @Context HttpHeaders headers,
                                       final @Context UriInfo uriInfo,
                                       @ApiParam(
                                                 value = "Name of the data service to be deleted",
                                                 required = true
                                       )
                                       final @PathParam( "dataserviceName" ) String dataserviceName); @GET @Path( V1Constants.DATA_SERVICE_PLACEHOLDER + StringConstants.FORWARD_SLASH + V1Constants.CONNECTIONS_SEGMENT) @Produces( { MediaType.APPLICATION_JSON } ) @ApiOperation(value = "Find a dataservice's connections ", response = RestDataservice.class) @ApiResponses(value = { @ApiResponse(code = 404, message = "No Dataservice could be found with name"), @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response getConnections( final @Context HttpHeaders headers,
                                    final @Context UriInfo uriInfo,
                                    @ApiParam(
                                              value = "Name of the data service containing the required connections",
                                              required = true
                                    )
                                    final @PathParam( "dataserviceName" ) String dataserviceName); @GET @Path( V1Constants.DATA_SERVICE_PLACEHOLDER + StringConstants.FORWARD_SLASH + V1Constants.DRIVERS_SEGMENT) @Produces( { MediaType.APPLICATION_JSON } ) @ApiOperation(value = "Find a dataservice's drivers ", response = RestConnectionDriver.class) @ApiResponses(value = { @ApiResponse(code = 404, message = "No Dataservice could be found with name"), @ApiResponse(code = 406, message = "Only JSON is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response getDrivers( final @Context HttpHeaders headers,
                                    final @Context UriInfo uriInfo,
                                    @ApiParam(
                                              value = "Name of the data service containing the required drivers",
                                              required = true
                                    )
                                    final @PathParam( "dataserviceName" ) String dataserviceName); @GET @Path( V1Constants.DATA_SERVICE_PLACEHOLDER + StringConstants.FORWARD_SLASH + V1Constants.SOURCE_VDB_MATCHES) @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } ) @ApiOperation(value = "Find workspace source VDB matches for a Dataservice", response = RestVdb[].class) @ApiResponses(value = { @ApiResponse(code = 404, message = "No dataservice could be found with name"), @ApiResponse(code = 406, message = "Only JSON or XML is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response getSourceVdbsForDataService( final @Context HttpHeaders headers,
                                                 final @Context UriInfo uriInfo,
                                                 @ApiParam(
                                                           value = "Name of the data service containing the required source vdbs",
                                                           required = true
                                                 )
                                                 final @PathParam( "dataserviceName" ) String dataserviceName); @GET @Path( V1Constants.DATA_SERVICE_PLACEHOLDER + StringConstants.FORWARD_SLASH + V1Constants.SERVICE_VIEW_INFO) @Produces( { MediaType.APPLICATION_JSON } ) @ApiOperation(value = "retrieve the service view information for a dataservice") @ApiResponses(value = { @ApiResponse(code = 404, message = "No dataservice could be found with name"), @ApiResponse(code = 406, message = "Only JSON or XML is returned by this operation"), @ApiResponse(code = 403, message = "An error has occurred.") }) Response getServiceViewInfoForDataService( final @Context HttpHeaders headers,
                                                      final @Context UriInfo uriInfo,
                                                      @ApiParam(
                                                                value = "Name of the required data service",
                                                                required = true
                                                      )
                                                      final @PathParam( "dataserviceName" ) String dataserviceName); @GET @Path( V1Constants.NAME_VALIDATION_SEGMENT + StringConstants.FORWARD_SLASH + V1Constants.DATA_SERVICE_PLACEHOLDER ) @Produces( { MediaType.TEXT_PLAIN } ) @ApiOperation( value = "Returns an error message if the data service name is invalid" ) @ApiResponses( value = { @ApiResponse( code = 400, message = "The URI cannot contain encoded slashes or backslashes." ), @ApiResponse( code = 403, message = "An unexpected error has occurred." ), @ApiResponse( code = 500, message = "The dataservice name cannot be empty." ) } ) Response validateDataserviceName( final @Context HttpHeaders headers,
                                             final @Context UriInfo uriInfo,
                                             @ApiParam( value = "The dataservice name being checked", required = true )
                                             final @PathParam( "dataserviceName" ) String dataserviceName );  }