@Override
  public GenericAcknowledgmentType release(ReleaseRequestType parameters) throws ServiceException {
    validateOAuthScope(NsiScope.RELEASE);

    ServiceExceptionType exceptionType = new ServiceExceptionType();
    exceptionType.setErrorId(NOT_IMPLEMENTED.getId());
    exceptionType.setText(NOT_IMPLEMENTED.getText());

    throw new ServiceException("Not supported", exceptionType);
  }
Exemplo n.º 2
0
 /* RFC 2616: 9.6. The recipient of the entity MUST NOT ignore any
  * Content-* (e.g. Content-Range) headers that it does not
  * understand or implement and MUST return a 501 (Not Implemented)
  * response in such cases.
  */
 private static void checkContentHeader(
     Collection<String> headerNames, Collection<String> excludes) throws HttpException {
   outer:
   for (String headerName : headerNames) {
     if (headerName.toLowerCase().startsWith("content-")) {
       for (String exclude : excludes) {
         if (exclude.equalsIgnoreCase(headerName)) {
           continue outer;
         }
       }
       throw new HttpException(NOT_IMPLEMENTED.code(), headerName + " is not implemented");
     }
   }
 }