Search in sources :

Example 1 with GetFilterDefResponse

use of org.bedework.calfacade.responses.GetFilterDefResponse in project bw-calendar-engine by Bedework.

the class Filters method get.

@Override
public GetFilterDefResponse get(final String name) {
    final GetFilterDefResponse gfdr = new GetFilterDefResponse();
    try {
        final BwFilterDef fdef = getCal().getFilterDef(name, getEntityOwner(getPrincipal()));
        if (fdef == null) {
            gfdr.setStatus(Response.Status.notFound);
        } else {
            gfdr.setStatus(Response.Status.ok);
            gfdr.setFilterDef(fdef);
        }
    } catch (final CalFacadeException cfe) {
        gfdr.setStatus(Response.Status.failed);
        gfdr.setMessage(cfe.getLocalizedMessage());
    }
    return gfdr;
}
Also used : GetFilterDefResponse(org.bedework.calfacade.responses.GetFilterDefResponse) BwFilterDef(org.bedework.calfacade.BwFilterDef) CalFacadeException(org.bedework.calfacade.exc.CalFacadeException)

Aggregations

BwFilterDef (org.bedework.calfacade.BwFilterDef)1 CalFacadeException (org.bedework.calfacade.exc.CalFacadeException)1 GetFilterDefResponse (org.bedework.calfacade.responses.GetFilterDefResponse)1