/** * Delete the specified issue link type. * * @response.representation.204.qname * issueLinkType * * @response.representation.404.doc * Returned if issue linking is disabled or no issue link type with the given id exists. * * @response.represenation.400.doc * Returned if the supplied id is not a number. * * @return Returns NO_CONTENT if successful. */ @DELETE @Path ("/{issueLinkTypeId}") public Response deleteIssueLinkType(@PathParam ("issueLinkTypeId") final String issueLinkTypeIdString) { final IssueLinkType linkType = findLinkType(issueLinkTypeIdString); ServiceOutcome<IssueLinkType> outcome = issueLinkTypeService.deleteIssueLinkType(authenticationContext.getUser(), linkType); if (outcome.isValid()) { return Response.noContent().cacheControl(never()).build(); } else { throw new RESTException(ErrorCollection.of(outcome.getErrorCollection())); } }
public Response getIssueLinkTypes() final ServiceOutcome<Collection<IssueLinkType>> outcome = issueLinkTypeService.getIssueLinkTypes(authenticationContext.getUser()); if (outcome.isValid())
/** * Update the specified issue link type. * * @request.representation.example * {@link ResourceExamples#ISSUE_LINK_TYPE_EXAMPLE_CREATE} * * @response.representation.404.doc * Returned if issue linking is disabled or no issue link type with the given id exists. * * @response.representation.400.doc * Returned if the supplied id is not a number. * * @response.representation.200.example * {@link ResourceExamples#ISSUE_LINK_TYPE_EXAMPLE} */ @PUT @Path ("/{issueLinkTypeId}") public Response updateIssueLinkType(@PathParam ("issueLinkTypeId") final String issueLinkTypeIdString, IssueLinkTypeJsonBean linkTypeJsonBean) { final IssueLinkType linkType = findLinkType(issueLinkTypeIdString); final ServiceOutcome<IssueLinkType> outcome = issueLinkTypeService.updateIssueLinkType(authenticationContext.getUser(), linkType, linkTypeJsonBean.name(), linkTypeJsonBean.outward(), linkTypeJsonBean.inward()); if (outcome.isValid()) { return status(Response.Status.OK).entity(getIssueLinkType(issueLinkTypeIdString).getEntity()).build(); } else { throw new RESTException(ErrorCollection.of(outcome.getErrorCollection())); } }
ServiceOutcome<IssueLinkType> outcome = issueLinkTypeService.createIssueLinkType(authenticationContext.getUser(), linkTypeBean.name(), linkTypeBean.outward(), linkTypeBean.inward()); if (outcome.isValid())
try ServiceOutcome<Collection<IssueLinkType>> outcome = issueLinkTypeService.getIssueLinkTypes(authenticationContext.getUser()); if (!outcome.isValid())