Example usage for org.springframework.http HttpStatus NOT_IMPLEMENTED

List of usage examples for org.springframework.http HttpStatus NOT_IMPLEMENTED

Introduction

In this page you can find the example usage for org.springframework.http HttpStatus NOT_IMPLEMENTED.

Prototype

HttpStatus NOT_IMPLEMENTED

To view the source code for org.springframework.http HttpStatus NOT_IMPLEMENTED.

Click Source Link

Document

501 Not Implemented .

Usage

From source file:com.ge.predix.acs.privilege.management.ResourcePrivilegeManagementController.java

private void failIfParentsSpecified(final List<BaseResource> resources) {
    if (this.getTitanProfileActive()) {
        return;//from www  .j  a  v a2s  .c om
    }

    for (BaseResource resource : resources) {
        if (!CollectionUtils.isEmpty(resource.getParents())) {
            throw new RestApiException(HttpStatus.NOT_IMPLEMENTED, PARENTS_ATTR_NOT_SUPPORTED_MSG);
        }
    }
}

From source file:de.thm.arsnova.controller.SecurityExceptionControllerAdvice.java

@ResponseStatus(HttpStatus.NOT_IMPLEMENTED)
@ExceptionHandler(NotImplementedException.class)
public void handleNotImplementedException(final Exception e, final HttpServletRequest request) {
}

From source file:org.osiam.resources.exception.OsiamExceptionHandler.java

@ExceptionHandler(UnsupportedOperationException.class)
@ResponseStatus(HttpStatus.NOT_IMPLEMENTED)
@ResponseBody//from w  ww  . j ava  2  s  .com
public ErrorResponse handleUnsupportedOperation(UnsupportedOperationException e) {
    return produceErrorResponse(e.getMessage(), HttpStatus.NOT_IMPLEMENTED);
}

From source file:org.kurento.repository.test.RangePutTests.java

protected void uploadFileWithSeqPUTs(RepositoryHttpRecorder recorder, File fileToUpload,
        RepositoryItem repositoryItem) throws Exception {

    recorder.setAutoTerminationTimeout(500000);
    String url = recorder.getURL();

    DataInputStream is = null;//from  ww w .j  a  v  a 2 s. c om

    try {

        is = new DataInputStream(new FileInputStream(fileToUpload));

        int sentBytes = 0;

        byte[] info = new byte[40000];

        int readBytes;

        int numRequest = 0;

        while ((readBytes = is.read(info)) != -1) {

            ResponseEntity<String> response = putContent(url, Arrays.copyOf(info, readBytes), sentBytes);

            sentBytes += readBytes;

            log.info(numRequest + ": " + response.toString());

            assertEquals("Returned response: " + response.getBody(), HttpStatus.OK, response.getStatusCode());

            if (numRequest == 3) {

                // Simulating retry

                response = putContent(url, Arrays.copyOf(info, readBytes), sentBytes - readBytes);

                log.info(numRequest + ": " + response.toString());

                assertEquals("Returned response: " + response.getBody(), HttpStatus.OK,
                        response.getStatusCode());

            } else if (numRequest == 4) {

                // Simulating retry with new data

                byte[] newInfo = new byte[500];
                int newReadBytes = is.read(newInfo);

                response = putContent(url,
                        concat(Arrays.copyOf(info, readBytes), Arrays.copyOf(newInfo, newReadBytes)),
                        sentBytes - readBytes);

                sentBytes += newReadBytes;

                log.info(numRequest + ": " + response.toString());

                assertEquals("Returned response: " + response.getBody(), HttpStatus.OK,
                        response.getStatusCode());

            } else if (numRequest == 5) {

                // Simulating send ahead data

                response = putContent(url, Arrays.copyOf(info, readBytes), sentBytes + 75000);

                log.info(numRequest + ": " + response.toString());

                assertEquals("Returned response: " + response.getBody(), HttpStatus.NOT_IMPLEMENTED,
                        response.getStatusCode());

            }

            numRequest++;
        }

    } finally {
        if (is != null) {
            try {
                is.close();
            } catch (IOException e) {
            }
        }

        recorder.stop();
    }
}

From source file:de.zib.gndms.dspace.service.SliceKindServiceImpl.java

@Override
@RequestMapping(value = "/_{subspaceId}/_{sliceKindId}/config", method = RequestMethod.GET)
@Secured("ROLE_USER")
public final ResponseEntity<SliceKindConfiguration> getSliceKindConfig(@PathVariable final String subspaceId,
        @PathVariable final String sliceKindId, @RequestHeader("DN") final String dn) {
    try {//from  w w w .ja  v  a  2s  .  com
        SliceKind sliceKind = sliceKindProvider.get(subspaceId, sliceKindId);
        SliceKindConfiguration sliceKindConfiguration = sliceKind.getSliceKindConfiguration();

        return new ResponseEntity<SliceKindConfiguration>(sliceKindConfiguration, new GNDMSResponseHeader(),
                HttpStatus.NOT_IMPLEMENTED);
    } catch (NoSuchElementException e) {
        throw new IllegalArgumentException("Could not find SliceKind " + sliceKindId, e);
    }
}

From source file:de.thm.arsnova.controller.SessionController.java

@RequestMapping(value = "/", method = RequestMethod.GET)
public List<Session> getSessions(
        @RequestParam(value = "ownedonly", defaultValue = "false") final boolean ownedOnly,
        @RequestParam(value = "visitedonly", defaultValue = "false") final boolean visitedOnly,
        @RequestParam(value = "sortby", defaultValue = "name") final String sortby,
        final HttpServletResponse response) {
    List<Session> sessions = null;

    /* TODO implement all parameter combinations, implement use of user parameter */
    try {// w  w w .j  av a 2  s .  c o  m
        if (ownedOnly && !visitedOnly) {
            sessions = sessionService.getMySessions();
        } else if (visitedOnly && !ownedOnly) {
            sessions = sessionService.getMyVisitedSessions();
        } else {
            response.setStatus(HttpStatus.NOT_IMPLEMENTED.value());
            return null;
        }
    } catch (final AccessDeniedException e) {
        throw new UnauthorizedException();
    }

    if (sessions == null || sessions.isEmpty()) {
        response.setStatus(HttpServletResponse.SC_NO_CONTENT);
        return null;
    }

    if (sortby != null && sortby.equals("shortname")) {
        Collections.sort(sessions, new SessionShortNameComparator());
    } else {
        Collections.sort(sessions, new SessionNameComparator());
    }

    return sessions;
}

From source file:com.github.lynxdb.server.api.http.handlers.EpQuery.java

@RequestMapping(path = "/exp", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity exp() {
    return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build();
}

From source file:com.github.lynxdb.server.api.http.handlers.EpQuery.java

@RequestMapping(path = "/gexp", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity gexp() {
    return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build();
}

From source file:com.github.lynxdb.server.api.http.handlers.EpQuery.java

@RequestMapping(path = "/last", method = { RequestMethod.GET,
        RequestMethod.POST }, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity last(QueryRequest _request) {
    return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build();
}

From source file:gob.mx.salud.api.util.ResponseWrapper.java

/**
 * Genera una respuesta fallida del tipo <b>501-NOT_IMPLEMENTED</b>
 * @param message//from   w  w  w .j a  v  a2s .  c  o  m
 * @param data
 * @return {@code ResponseWrapper<T>}
 */
@SuppressWarnings("unchecked")
public ResponseWrapper<T> failNotImplemented(String message, List<ErrorDetail> data) {
    fail(ResponseWrapper.FAIL, HttpStatus.NOT_IMPLEMENTED.value(), message, (T) data);
    return this;
}