@Override public Response deleteProperties(String userId) { try { propertiesStore.deleteProperties(userId); return Response.noContent().build(); } catch (IResourceStore.ResourceStoreException e) { log.error(e.getLocalizedMessage(), e); throw new InternalServerErrorException(e.getLocalizedMessage()); } } }
@Override public Response mergeProperties(String userId, Properties properties) { try { propertiesStore.mergeProperties(userId, properties); return Response.ok().build(); } catch (IResourceStore.ResourceStoreException e) { log.error(e.getLocalizedMessage(), e); throw new InternalServerErrorException(e.getLocalizedMessage()); } }
@Override public Response deleteBotTrigger(String intent) { try { botTriggerStore.deleteBotTrigger(intent); botTriggersCache.remove(intent); return Response.ok().build(); } catch (IResourceStore.ResourceStoreException e) { log.error(e.getLocalizedMessage(), e); throw new InternalServerErrorException(e.getLocalizedMessage()); } } }
@Override public List<String> readExpressions(String id, Integer version, String filter, String order, Integer index, Integer limit) { try { return regularDictionaryStore.readExpressions(id, version, filter, order, index, limit); } catch (IResourceStore.ResourceStoreException e) { log.error(e.getLocalizedMessage(), e); throw new InternalServerErrorException(e.getLocalizedMessage(), e); } catch (IResourceStore.ResourceNotFoundException e) { throw new NotFoundException(e.getLocalizedMessage(), e); } }
@Override public DocumentDescriptor readDescriptor(String id, Integer version) { try { return documentDescriptorStore.readDescriptor(id, version); } catch (IResourceStore.ResourceStoreException e) { log.error(e.getLocalizedMessage(), e); throw new InternalServerErrorException(e.getLocalizedMessage(), e); } catch (IResourceStore.ResourceNotFoundException e) { throw new NotFoundException(e.getLocalizedMessage(), e); } }
@Override public Properties readProperties(String userId) { try { return propertiesStore.readProperties(userId); } catch (IResourceStore.ResourceStoreException e) { log.error(e.getLocalizedMessage(), e); throw new InternalServerErrorException(e.getLocalizedMessage()); } }
@Override public Permissions readPermissions(String resourceId) { try { return permissionStore.readFilteredPermissions(resourceId); } catch (IResourceStore.ResourceStoreException e) { throw new InternalServerErrorException(e.getLocalizedMessage(), e); } catch (IResourceStore.ResourceNotFoundException e) { throw new NoLogWebApplicationException(Response.Status.NOT_FOUND); } }
@Override public TestCase readTestCase(String id) { try { return testCaseStore.read(id, 0); } catch (IResourceStore.ResourceStoreException e) { log.error(e.getLocalizedMessage(), e); throw new InternalServerErrorException(e); } catch (IResourceStore.ResourceNotFoundException e) { throw new NoLogWebApplicationException(Response.Status.NOT_FOUND); } }
@Override public List<String> readOutputKeys(String id, Integer version, String filter, String order, Integer limit) { try { return outputStore.readOutputActions(id, version, filter, order, limit); } catch (IResourceStore.ResourceStoreException e) { log.error(e.getLocalizedMessage(), e); throw new InternalServerErrorException(e.getLocalizedMessage(), e); } catch (IResourceStore.ResourceNotFoundException e) { throw new NotFoundException(e.getLocalizedMessage(), e); } }
@Override public OutputConfigurationSet readOutputSet(String id, Integer version, String filter, String order, Integer index, Integer limit) { try { return outputStore.read(id, version, filter, order, index, limit); } catch (IResourceStore.ResourceNotFoundException e) { throw new NotFoundException(e.getLocalizedMessage(), e); } catch (IResourceStore.ResourceStoreException e) { log.error(e.getLocalizedMessage(), e); throw new InternalServerErrorException(e.getLocalizedMessage(), e); } }
@Override public User readUser(String userId) { try { return userStore.readUser(userId); } catch (IResourceStore.ResourceStoreException e) { log.error(e.getLocalizedMessage(), e); throw new InternalServerErrorException(); } catch (IResourceStore.ResourceNotFoundException e) { throw new NoLogWebApplicationException(Response.Status.NOT_FOUND); } }
@Override public List<DeploymentInfo> readDeploymentInfos() { try { return deploymentStore.readDeploymentInfos(); } catch (IResourceStore.ResourceStoreException e) { log.error(e.getLocalizedMessage(), e); throw new InternalServerErrorException("Error while reading DeploymentInfos."); } } }
@Override public void updateUser(String userId, User user) { try { userStore.updateUser(userId, user); } catch (IResourceStore.ResourceStoreException e) { log.error(e.getLocalizedMessage(), e); throw new InternalServerErrorException(); } }
@Override public void updateGroup(String groupId, Group group) { try { groupStore.updateGroup(groupId, group); } catch (IResourceStore.ResourceStoreException e) { log.error(e.getLocalizedMessage(), e); throw new InternalServerErrorException(); } }
@Override public Group readGroup(String groupId) { try { return groupStore.readGroup(groupId); } catch (IResourceStore.ResourceStoreException e) { log.error(e.getLocalizedMessage(), e); throw new InternalServerErrorException(); } catch (IResourceStore.ResourceNotFoundException e) { throw new NoLogWebApplicationException(Response.Status.NOT_FOUND); } }
@Override public List<DocumentDescriptor> readDescriptors(String type, String filter, Integer index, Integer limit) { try { return documentDescriptorStore.readDescriptors(type, filter, index, limit, false); } catch (IResourceStore.ResourceStoreException e) { log.error(e.getLocalizedMessage(), e); throw new InternalServerErrorException(e.getLocalizedMessage(), e); } catch (IResourceStore.ResourceNotFoundException e) { throw new NotFoundException(e.getLocalizedMessage(), e); } }
@Override public Response patchOutputSet(String id, Integer version, PatchInstruction<OutputConfigurationSet>[] patchInstructions) { try { OutputConfigurationSet currentOutputConfigurationSet = outputStore.read(id, version); OutputConfigurationSet patchedOutputConfigurationSet = patchDocument(currentOutputConfigurationSet, patchInstructions); return updateOutputSet(id, version, patchedOutputConfigurationSet); } catch (IResourceStore.ResourceStoreException e) { log.error(e.getLocalizedMessage(), e); throw new InternalServerErrorException(e.getLocalizedMessage(), e); } catch (IResourceStore.ResourceNotFoundException e) { throw new NotFoundException(e.getLocalizedMessage(), e); } }
@Override public void updatePermissions(String resourceId, Permissions permissions) { try { permissionStore.updatePermissions(resourceId, permissions); } catch (IResourceStore.ResourceStoreException e) { throw new InternalServerErrorException(e.getLocalizedMessage(), e); } } }
@Override public Response deleteUserConversation(String intent, String userId) { try { userConversationStore.deleteUserConversation(intent, userId); userConversationCache.remove(calculateCacheKey(intent, userId)); return Response.ok().build(); } catch (IResourceStore.ResourceStoreException e) { log.error(e.getLocalizedMessage(), e); throw new InternalServerErrorException(e.getLocalizedMessage()); } }
@Override public URI searchUser(String username) { try { String id = userStore.searchUser(username); return RestUtilities.createURI(resourceURI, id); } catch (IResourceStore.ResourceStoreException e) { log.error(e.getLocalizedMessage(), e); throw new InternalServerErrorException(); } catch (IResourceStore.ResourceNotFoundException e) { throw new NoLogWebApplicationException(Response.Status.NOT_FOUND); } }