当前位置: 首页>>代码示例>>Java>>正文


Java HttpStatus.NOT_FOUND_404属性代码示例

本文整理汇总了Java中org.eclipse.jetty.http.HttpStatus.NOT_FOUND_404属性的典型用法代码示例。如果您正苦于以下问题:Java HttpStatus.NOT_FOUND_404属性的具体用法?Java HttpStatus.NOT_FOUND_404怎么用?Java HttpStatus.NOT_FOUND_404使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.jetty.http.HttpStatus的用法示例。


在下文中一共展示了HttpStatus.NOT_FOUND_404属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testApexCall

@Test
public void testApexCall() throws Exception {
    try {
        doTestApexCall("");
        doTestApexCall("Xml");
    } catch (CamelExecutionException e) {
        if (e.getCause() instanceof SalesforceException) {
            SalesforceException cause = (SalesforceException) e.getCause();
            if (cause.getStatusCode() == HttpStatus.NOT_FOUND_404) {
                LOG.error("Make sure test REST resource MerchandiseRestResource.apxc has been loaded: "
                    + e.getMessage());
            }
        }
        throw e;
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:16,代码来源:RestApiIntegrationTest.java

示例2: getRun

@GET
@Path("/{runId}")
@UnitOfWork
@ApiOperation(value = "Get a specific run")
@ApiResponses({
        @ApiResponse(code = HttpStatus.OK_200, response = RunApiEntity.class, message = "OK"),
        @ApiResponse(code = HttpStatus.NOT_FOUND_404, response = ErrorMessage.class, message = "Not found"),
        @ApiResponse(
                code = HttpStatus.CONFLICT_409,
                response = ErrorMessage.class,
                message = "Event ID and Run ID are mismatched"
        )
})
public RunApiEntity getRun(
        @PathParam("eventId") @ApiParam(value = "Event ID", required = true) String eventId,
        @PathParam("runId") @ApiParam(value = "Run ID", required = true) String runId
) throws EntityMismatchException, EntityNotFoundException {
    Run domainRun = runEntityService.getByEventIdAndRunId(eventId, runId);
    return runMapper.toApiEntity(domainRun);
}
 
开发者ID:caeos,项目名称:coner-core,代码行数:20,代码来源:EventRunsResource.java

示例3: getRegistration

@GET
@Path("/{registrationId}")
@UnitOfWork
@ApiOperation(value = "Get a specific registration")
@ApiResponses({
        @ApiResponse(code = HttpStatus.OK_200, response = RegistrationApiEntity.class, message = "OK"),
        @ApiResponse(code = HttpStatus.NOT_FOUND_404, response = ErrorMessage.class, message = "Not found"),
        @ApiResponse(
                code = HttpStatus.CONFLICT_409,
                response = ErrorMessage.class,
                message = "Event ID and Registration ID are mismatched"
        )
})
public RegistrationApiEntity getRegistration(
        @PathParam("eventId") @ApiParam(value = "Event ID", required = true) String eventId,
        @PathParam("registrationId") @ApiParam(value = "Registration ID", required = true) String registrationId
) throws EntityMismatchException, EntityNotFoundException {
    Registration domainRegistration = eventRegistrationService.getByEventIdAndRegistrationId(
            eventId,
            registrationId
    );
    return registrationMapper.toApiEntity(domainRegistration);
}
 
开发者ID:caeos,项目名称:coner-core,代码行数:23,代码来源:EventRegistrationsResource.java

示例4: addHandicapGroupToHandicapGroupSet

@POST
@Path("/{handicapGroupSetId}/handicapGroups/{handicapGroupId}")
@UnitOfWork
@ApiOperation(value = "Add a Handicap Group to a Handicap Group Set", response = HandicapGroupSetApiEntity.class)
@ApiResponses({
        @ApiResponse(code = HttpStatus.OK_200, response = HandicapGroupSetApiEntity.class, message = "OK"),
        @ApiResponse(code = HttpStatus.NOT_FOUND_404, response = ErrorMessage.class, message = "Not found"),
})
public HandicapGroupSetApiEntity addHandicapGroupToHandicapGroupSet(
        @PathParam("handicapGroupSetId") @ApiParam(value = "Handicap Group Set ID", required = true)
                String handicapGroupSetId,
        @PathParam("handicapGroupId") @ApiParam(value = "Handicap Group ID", required = true)
                String handicapGroupId
) throws EntityNotFoundException {
    HandicapGroupSet domainSetEntity = handicapGroupSetService.getById(handicapGroupSetId);
    HandicapGroup domainEntity = handicapGroupEntityService.getById(handicapGroupId);
    handicapGroupSetService.addToHandicapGroups(domainSetEntity, domainEntity);
    return handicapGroupSetMapper.toApiEntity(domainSetEntity);
}
 
开发者ID:caeos,项目名称:coner-core,代码行数:19,代码来源:HandicapGroupSetsResource.java

示例5: addCompetitionGroupToCompetitionGroupSet

@POST
@Path("/{competitionGroupSetId}/competitionGroups/{competitionGroupId}")
@UnitOfWork
@ApiOperation(
        value = "Add a Competition Group to a Competition Group Set",
        response = CompetitionGroupSetApiEntity.class
)
@ApiResponses({
        @ApiResponse(code = HttpStatus.OK_200, response = CompetitionGroupSetApiEntity.class, message = "OK"),
        @ApiResponse(code = HttpStatus.NOT_FOUND_404, response = ErrorMessage.class, message = "Not found"),
})
public CompetitionGroupSetApiEntity addCompetitionGroupToCompetitionGroupSet(
        @PathParam("competitionGroupSetId") @ApiParam(value = "Competition Group Set ID", required = true)
                String competitionGroupSetId,
        @PathParam("competitionGroupId") @ApiParam(value = "Competition Group ID", required = true)
                String competitionGroupId
) throws EntityNotFoundException {
    CompetitionGroupSet domainSetEntity = competitionGroupSetService.getById(competitionGroupSetId);
    CompetitionGroup domainEntity = competitionGroupEntityService.getById(competitionGroupId);
    competitionGroupSetService.addToCompetitionGroups(domainSetEntity, domainEntity);
    return competitionGroupSetMapper.toApiEntity(domainSetEntity);
}
 
开发者ID:caeos,项目名称:coner-core,代码行数:22,代码来源:CompetitionGroupSetsResource.java

示例6: acquireLease

/**
 * Acquires a lease on a blob. The lease ID is NULL initially.
 * @param leaseTimeInSec The time in seconds you want to acquire the lease for.
 * @param leaseId Proposed ID you want to acquire the lease with, null if not proposed.
 * @return String that represents lease ID.  Null if acquireLease is unsuccessful because the blob is leased already.
 * @throws AzureException If a Azure storage service error occurred. This includes the case where the blob you're trying to lease does not exist.
 */
public String acquireLease(int leaseTimeInSec, String leaseId) {
  try {
    String id = leaseBlob.acquireLease(leaseTimeInSec, leaseId);
    LOG.info("Acquired lease with lease id = " + id);
    return id;
  } catch (StorageException storageException) {
    int httpStatusCode = storageException.getHttpStatusCode();
    if (httpStatusCode == HttpStatus.CONFLICT_409) {
      LOG.info("The blob you're trying to acquire is leased already.", storageException.getMessage());
    } else if (httpStatusCode == HttpStatus.NOT_FOUND_404) {
      LOG.error("The blob you're trying to lease does not exist.", storageException);
      throw new AzureException(storageException);
    } else {
      LOG.error("Error acquiring lease!", storageException);
      throw new AzureException(storageException);
    }
  }
  return null;
}
 
开发者ID:apache,项目名称:samza,代码行数:26,代码来源:LeaseBlobManager.java

示例7: getCompetitionGroup

@GET
@Path("/{competitionGroupId}")
@UnitOfWork
@ApiOperation(value = "Get a Competition Group", response = CompetitionGroupApiEntity.class)
@ApiResponses({
        @ApiResponse(code = HttpStatus.OK_200, response = CompetitionGroupApiEntity.class, message = "OK"),
        @ApiResponse(code = HttpStatus.NOT_FOUND_404, response = ErrorMessage.class, message = "Not found")
})
public CompetitionGroupApiEntity getCompetitionGroup(
        @PathParam("competitionGroupId") @ApiParam(value = "Competition Group ID", required = true) String id
) throws EntityNotFoundException {
    CompetitionGroup domainEntity = competitionGroupEntityService.getById(id);
    return competitionGroupMapper.toApiEntity(domainEntity);
}
 
开发者ID:caeos,项目名称:coner-core,代码行数:14,代码来源:CompetitionGroupsResource.java

示例8: addRun

@POST
@UnitOfWork
@ApiOperation(value = "Add a new run")
@ApiResponses({
        @ApiResponse(
                code = HttpStatus.CREATED_201,
                message = ApiResponseConstants.Created.MESSAGE,
                responseHeaders = {
                        @ResponseHeader(
                                name = ApiResponseConstants.Created.Headers.NAME,
                                description = ApiResponseConstants.Created.Headers.DESCRIPTION,
                                response = String.class
                        )
                }
        ),
        @ApiResponse(
                code = HttpStatus.NOT_FOUND_404,
                response = ErrorMessage.class,
                message = "No event with given ID"
        ),
        @ApiResponse(
                code = HttpStatus.UNPROCESSABLE_ENTITY_422,
                response = ValidationErrorMessage.class,
                message = "Failed validation"
        )
})
public Response addRun(
        @PathParam("eventId") @ApiParam(value = "Event ID", required = true) String eventId,
        @Valid @ApiParam(value = "Run", required = true) AddRunRequest request
) throws AddEntityException, EntityNotFoundException {
    RunAddPayload addPayload = runMapper.toDomainAddPayload(request, eventId);
    Run domainEntity = runEntityService.add(addPayload);
    RunApiEntity run = runMapper.toApiEntity(domainEntity);
    return Response.created(UriBuilder.fromPath("/events/{eventId}/runs/{runId}")
                                    .build(eventId, run.getId()))
            .build();
}
 
开发者ID:caeos,项目名称:coner-core,代码行数:37,代码来源:EventRunsResource.java

示例9: getEvent

@GET
@Path("/{eventId}")
@UnitOfWork
@ApiOperation(value = "Get an Event")
@ApiResponses({
        @ApiResponse(code = HttpStatus.OK_200, response = EventApiEntity.class, message = "OK"),
        @ApiResponse(code = HttpStatus.NOT_FOUND_404, response = ErrorMessage.class, message = "Not found")
})
public EventApiEntity getEvent(
        @PathParam("eventId") @ApiParam(value = "Event ID", required = true) String id
) throws EntityNotFoundException {
    Event domainEntity = eventEntityService.getById(id);
    return eventMapper.toApiEntity(domainEntity);
}
 
开发者ID:caeos,项目名称:coner-core,代码行数:14,代码来源:EventsResource.java

示例10: addRegistration

@POST
@UnitOfWork
@ApiOperation(value = "Add a new registration")
@ApiResponses({
        @ApiResponse(
                code = HttpStatus.CREATED_201,
                message = ApiResponseConstants.Created.MESSAGE,
                responseHeaders = {
                        @ResponseHeader(
                                name = ApiResponseConstants.Created.Headers.NAME,
                                description = ApiResponseConstants.Created.Headers.DESCRIPTION,
                                response = String.class
                        )
                }
        ),
        @ApiResponse(
                code = HttpStatus.NOT_FOUND_404,
                response = ErrorMessage.class,
                message = "No event with given ID"
        ),
        @ApiResponse(
                code = HttpStatus.UNPROCESSABLE_ENTITY_422,
                response = ValidationErrorMessage.class,
                message = "Failed validation"
        )
})
public Response addRegistration(
        @PathParam("eventId") @ApiParam(value = "Event ID", required = true) String eventId,
        @Valid @ApiParam(value = "Registration", required = true) AddRegistrationRequest request
) throws AddEntityException, EntityNotFoundException {
    RegistrationAddPayload addPayload = registrationMapper.toDomainAddPayload(request, eventId);
    Registration domainEntity = eventRegistrationService.add(addPayload);
    RegistrationApiEntity registration = registrationMapper.toApiEntity(domainEntity);
    return Response.created(UriBuilder.fromPath("/events/{eventId}/registrations/{registrationId}")
            .build(eventId, registration.getId()))
            .build();
}
 
开发者ID:caeos,项目名称:coner-core,代码行数:37,代码来源:EventRegistrationsResource.java

示例11: getHandicapGroupSet

@GET
@Path("/{handicapGroupSetId}")
@UnitOfWork
@ApiOperation(value = "Get a Handicap Group Set", response = HandicapGroupSetApiEntity.class)
@ApiResponses({
        @ApiResponse(code = HttpStatus.OK_200, response = HandicapGroupSetApiEntity.class, message = "OK"),
        @ApiResponse(code = HttpStatus.NOT_FOUND_404, response = ErrorMessage.class, message = "Not found")
})
public HandicapGroupSetApiEntity getHandicapGroupSet(
        @PathParam("handicapGroupSetId")
        @ApiParam(value = "Handicap Group Set ID", required = true) String id
) throws EntityNotFoundException {
    HandicapGroupSet domainEntity = handicapGroupSetService.getById(id);
    return handicapGroupSetMapper.toApiEntity(domainEntity);
}
 
开发者ID:caeos,项目名称:coner-core,代码行数:15,代码来源:HandicapGroupSetsResource.java

示例12: getCompetitionGroupSet

@GET
@Path("/{competitionGroupSetId}")
@UnitOfWork
@ApiOperation(value = "Get a Competition Group Set", response = CompetitionGroupSetApiEntity.class)
@ApiResponses({
        @ApiResponse(code = HttpStatus.OK_200, response = CompetitionGroupSetApiEntity.class, message = "OK"),
        @ApiResponse(code = HttpStatus.NOT_FOUND_404, response = ErrorMessage.class, message = "Not found")
})
public CompetitionGroupSetApiEntity getCompetitionGroupSet(
        @PathParam("competitionGroupSetId")
        @ApiParam(value = "Competition Group Set ID", required = true) String id
) throws EntityNotFoundException {
    CompetitionGroupSet domainEntity = competitionGroupSetService.getById(id);
    return competitionGroupSetMapper.toApiEntity(domainEntity);
}
 
开发者ID:caeos,项目名称:coner-core,代码行数:15,代码来源:CompetitionGroupSetsResource.java

示例13: getHandicapGroup

@GET
@Path("/{handicapGroupId}")
@UnitOfWork
@ApiOperation(value = "Get a Handicap Group", response = HandicapGroupApiEntity.class)
@ApiResponses({
        @ApiResponse(code = HttpStatus.OK_200, response = HandicapGroupApiEntity.class, message = "OK"),
        @ApiResponse(code = HttpStatus.NOT_FOUND_404, response = ErrorMessage.class, message = "Not found")
})
public HandicapGroupApiEntity getHandicapGroup(
        @PathParam("handicapGroupId") @ApiParam(value = "Handicap Group ID", required = true) String id
) throws EntityNotFoundException {
    HandicapGroup domainEntity = handicapGroupEntityService.getById(id);
    return handicapGroupMapper.toApiEntity(domainEntity);
}
 
开发者ID:caeos,项目名称:coner-core,代码行数:14,代码来源:HandicapGroupsResource.java

示例14: isAuthorised

@Override
public boolean isAuthorised(final ServiceUser serviceUser,
                            final DocRef docRef,
                            final String permissionName) {
    Response response;
    try {
        final Map<String, Object> request = new HashMap<>();
        request.put("docRef", new DocRef.Builder()
                .uuid(docRef.getUuid())
                .type(docRef.getType())
                .build()); // stripping out the name
        request.put("permission", permissionName);

        response = httpClient
                .target(this.isAuthorisedUrl)
                .request()
                .header("Authorization", "Bearer " + serviceUser.getJwt())
                .post(Entity.json(request));
    } catch (final Exception e) {
        LOGGER.error("Could not request authorisation " + e.getLocalizedMessage());
        return false;
    }

    boolean isUserAuthorised;

    switch (response.getStatus()) {
        case HttpStatus.UNAUTHORIZED_401:
            isUserAuthorised = false;
            break;
        case HttpStatus.OK_200:
            isUserAuthorised = true;
            break;
        case HttpStatus.NOT_FOUND_404:
            isUserAuthorised = false;
            LOGGER.error("Received a 404 when trying to access the authorisation service! I am unable to check authorisation so all requests will be rejected until this is fixed. Is the service location correctly configured? Is the service running? The URL I tried was: {}", this.isAuthorisedUrl);
            break;
        default:
            isUserAuthorised = false;
            LOGGER.error("Tried to check authorisation for a user but got an unknown response!",
                    response.getStatus());
    }

    return isUserAuthorised;
}
 
开发者ID:gchq,项目名称:stroom-query,代码行数:44,代码来源:AuthorisationServiceImpl.java

示例15: isNotFound

private static boolean isNotFound(com.google.common.base.Optional<Integer> statusCode) {
	return statusCode.isPresent() && statusCode.get() == HttpStatus.NOT_FOUND_404;
}
 
开发者ID:gustavkarlsson,项目名称:rocketchat-jira-trigger,代码行数:3,代码来源:DetectIssueRoute.java


注:本文中的org.eclipse.jetty.http.HttpStatus.NOT_FOUND_404属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。