@RequestMapping(value = "/{fortressName:.*}", method = RequestMethod.DELETE) @ResponseStatus(value = HttpStatus.ACCEPTED) public AdminResponse purgeFortress( @PathVariable("fortressName") String fortressCode, HttpServletRequest request) throws FlockException { Company company = CompanyResolver.resolveCompany(request); mediationFacade.purge(company, fortressCode); return new AdminResponse("Purging " + fortressCode + "... This may take a while"); }
@RequestMapping(value = "/{code:.*}/{docType}", method = RequestMethod.DELETE) public AdminResponse deleteDocType( @PathVariable("code") String fortressCode, @PathVariable("docType") String docType, HttpServletRequest request) throws FlockException { Company company = CompanyResolver.resolveCompany(request); mediationFacade.purge(company, fortressCode, docType); return new AdminResponse("Purging " + fortressCode + "... This may take a while"); }
@Override public String writeTags(Collection<TagInputBean> tagInputBeans) throws FlockException { Company company = securityHelper.getCompany(); try { mediationFacade.createTags(company, tagInputBeans); } catch (ExecutionException | InterruptedException e) { throw new FlockException("Interrupted", e); } return null; }
@RequestMapping(value = "/{fortressCode:.*}/rebuild", method = RequestMethod.POST) @ResponseStatus(value = HttpStatus.ACCEPTED) public AdminResponse rebuildSearch( @PathVariable("fortressCode") String fortressCode, HttpServletRequest request) throws FlockException { Company company = CompanyResolver.resolveCompany(request); logger.info( "Reindex command received for " + fortressCode + " from [" + securityHelper.getLoggedInUser() + "]"); String message = mediationFacade.reindex(company, fortressCode); return new AdminResponse(message); }
@Override public String writeEntities(Collection<EntityInputBean> entityBatch) throws FlockException { Company company = securityHelper.getCompany(); try { for (EntityInputBean entityInputBean : entityBatch) { mediationFacade.trackEntity(company, entityInputBean); } return "ok"; } catch (InterruptedException e) { throw new FlockException("Interrupted", e); } catch (ExecutionException e) { throw new FlockException("Execution Problem", e); } catch (IOException e) { throw new FlockException("IO Exception", e); } }
@RequestMapping(value = "/{fortressName:.*}/{docType}/validate", method = RequestMethod.POST) @ResponseStatus(value = HttpStatus.ACCEPTED) public AdminResponse validateFromSearch( @PathVariable("fortressName") String fortressName, @PathVariable("docType") String docType, HttpServletRequest request) throws FlockException { Company company = CompanyResolver.resolveCompany(request); logger.info( "Validate command received for " + fortressName + " & docType " + docType + " from [" + securityHelper.getLoggedInUser() + "]"); String message = mediationFacade.validateFromSearch(company, fortressName, docType); return new AdminResponse(message); }