Search in sources :

Example 1 with CSPRequestCache

use of org.collectionspace.csp.api.core.CSPRequestCache in project application by collectionspace.

the class WebUI method serviceRequest.

@Override
public void serviceRequest(UIRequest ui) throws UIException, UnauthorizedException {
    CSPRequestCache cache = new RequestCache();
    String[] path = ui.getPrincipalPath();
    Request r = new Request(xxx_storage, cache, ui);
    String test = ui.getRequestedOperation().toString();
    log.debug("ServiceRequest path: " + StringUtils.join(path, "/"));
    log.debug(test);
    try {
        if (tries.get(ui.getRequestedOperation()).call(path, r))
            return;
    } catch (UIException e) {
        throw e;
    } catch (UnauthorizedException ue) {
        throw ue;
    } catch (Exception e) {
        log.error("Error in WebUI.serviceRequest", e);
        log.error(String.format("Request body= %s", ui.getBody()));
        throw new UIException("Error in read", e);
    }
    throw new UIException("path not used");
}
Also used : CSPRequestCache(org.collectionspace.csp.api.core.CSPRequestCache) RequestCache(org.collectionspace.csp.helper.core.RequestCache) UIRequest(org.collectionspace.csp.api.ui.UIRequest) UnauthorizedException(org.collectionspace.csp.api.persistence.UnauthorizedException) UIException(org.collectionspace.csp.api.ui.UIException) CSPRequestCache(org.collectionspace.csp.api.core.CSPRequestCache) UIException(org.collectionspace.csp.api.ui.UIException) CSPDependencyException(org.collectionspace.csp.api.core.CSPDependencyException) UnauthorizedException(org.collectionspace.csp.api.persistence.UnauthorizedException)

Aggregations

CSPDependencyException (org.collectionspace.csp.api.core.CSPDependencyException)1 CSPRequestCache (org.collectionspace.csp.api.core.CSPRequestCache)1 UnauthorizedException (org.collectionspace.csp.api.persistence.UnauthorizedException)1 UIException (org.collectionspace.csp.api.ui.UIException)1 UIRequest (org.collectionspace.csp.api.ui.UIRequest)1 RequestCache (org.collectionspace.csp.helper.core.RequestCache)1