public static void isTrueOrThrowInvalidRequest(boolean theSuccess, String theMessage) { if (theSuccess == false) { throw new InvalidRequestException(theMessage); } }
/** * Adds a <code>WWW-Authenticate</code> header to the response, of the form:<br/> * <code>WWW-Authenticate: Basic realm="theRealm"</code> * * @return Returns a reference to <code>this</code> for easy method chaining */ public AuthenticationException addAuthenticateHeaderForRealm(String theRealm) { addResponseHeader("WWW-Authenticate", "Basic realm=\"" + theRealm + "\""); return this; }
/** * Specifies the list of allowed HTTP methods (GET, POST, etc). This is provided in an <code>Allow</code> header, as required by the HTTP specification (RFC 2616). */ public void setAllowedMethods(Set<RequestTypeEnum> theAllowedMethods) { myAllowedMethods = theAllowedMethods; updateAllowHeader(); }
public static void validateResourceListNotNull(List<? extends IBaseResource> theResourceList) { if (theResourceList == null) { throw new InternalErrorException("IBundleProvider returned a null list of resources - This is not allowed"); } }
/** * Utility constructor * * @param base the base exception */ public JaxRsResponseException(BaseServerResponseException base) { super(base.getStatusCode(), base.getMessage(), base.getCause(), base.getOperationOutcome()); }
@Override public IBundleProvider getDocumentForComposition(HttpServletRequest theServletRequest, IIdType theId, IPrimitiveType<Integer> theCount, DateRangeParam theLastUpdate, SortSpec theSort, RequestDetails theRequestDetails) { throw new NotImplementedOperationException("$document not implemented in DSTU2"); } }
public void basicAuthInterceptorRealm() { //START SNIPPET: basicAuthInterceptorRealm AuthenticationException ex = new AuthenticationException(); ex.addAuthenticateHeaderForRealm("myRealm"); throw ex; //END SNIPPET: basicAuthInterceptorRealm }
public ResourceNotFoundException(Class<? extends IResource> theClass, IdDt theId, IBaseOperationOutcome theOperationOutcome) { super(STATUS_CODE, createErrorMessage(theClass, theId), theOperationOutcome); }
/** * Constructor * * @param theMessage * The message * @param theAllowedMethods * A list of allowed methods (see {@link #setAllowedMethods(RequestTypeEnum...)} ) */ public MethodNotAllowedException(String theMessage, RequestTypeEnum... theAllowedMethods) { super(STATUS_CODE, theMessage); setAllowedMethods(theAllowedMethods); }
private static void throwInvalidSyntaxException(String theParameterName) { throw new InvalidRequestException("Invalid _has parameter syntax: " + theParameterName); }
public static IBaseBundle throwProcessMessageNotImplemented() { throw new NotImplementedOperationException("This operation is not yet implemented on this server"); } }
public ResourceNotFoundException(IIdType theId) { super(STATUS_CODE, createErrorMessage(theId)); }
/** * Constructor * * @param theMessage * The message * @param theOperationOutcome * The OperationOutcome resource to return to the client * @param theAllowedMethods * A list of allowed methods (see {@link #setAllowedMethods(RequestTypeEnum...)} ) */ public MethodNotAllowedException(String theMessage, IBaseOperationOutcome theOperationOutcome, RequestTypeEnum... theAllowedMethods) { super(STATUS_CODE, theMessage, theOperationOutcome); setAllowedMethods(theAllowedMethods); }
public static void throwInvalidMode(String paramValues) { throw new InvalidRequestException("Invalid mode value: \"" + paramValues + "\""); }
public ResourceNotFoundException(IIdType theId, IBaseOperationOutcome theOperationOutcome) { super(STATUS_CODE, createErrorMessage(theId), theOperationOutcome); }
public static void throwInvalidMode(String paramValues) { throw new InvalidRequestException("Invalid mode value: \"" + paramValues + "\""); }
public ResourceNotFoundException(Class<? extends IResource> theClass, IIdType theId) { super(STATUS_CODE, createErrorMessage(theClass, theId)); }
public ResourceNotFoundException(Class<? extends IResource> theClass, IIdType theId, IBaseOperationOutcome theOperationOutcome) { super(STATUS_CODE, createErrorMessage(theClass, theId), theOperationOutcome); }
public ResourceNotFoundException(Class<? extends IResource> theClass, IdDt theId) { super(STATUS_CODE, createErrorMessage(theClass, theId)); }
public ResourceNotFoundException(IdDt theId) { super(STATUS_CODE, createErrorMessage(theId)); }