public Workspace findByNameAndOwner(String name, String userAccount) { assert userAccount != null; Workspace result; result = workspaceRepository.findByName(name, userAccount); assert result != null; return result; }
public void delete(String workspaceName, String username) { Assert.notNull(workspaceName); Assert.notNull(username); deleteReferences(workspaceName, username); Workspace ws = workspaceRepository.findByName(workspaceName, username); workspaceRepository.delete(ws); }
public void updateDemo(String demoWorkspaceName, String username) { Assert.notNull(demoWorkspaceName); Assert.notNull(username); Workspace demoWS = workspaceRepository.findByName(demoWorkspaceName, DEMO_MASTER); Workspace originWS = demoWS.getOrigin(); demoWS.setLastMod(Calendar.getInstance().getTime()); demoWS.setDescription(originWS.getDescription()); updateVersion(originWS); demoWS.setWsVersion(originWS.getWsVersion()); workspaceRepository.saveAndFlush(demoWS); }
public void updateLaunches(String workspaceName, String username) { Assert.notNull(workspaceName); Assert.notNull(username); Workspace ws = workspaceRepository.findByName(workspaceName, username); int l = ws.getLaunches(); ws.setLaunches(l + 1); if (ws.getOrigin() != null && username.equals(DEMO_MASTER)) updateLaunches( ws.getOrigin().getName(), ws.getOrigin().getOwner().getUserAccount().getUsername()); workspaceRepository.saveAndFlush(ws); }
public boolean checkNameAvailability(String workspaceName, String username) { return (workspaceRepository.findByName(workspaceName, username) == null); }