/** Syncs {@link #name} with config name. */ private void syncName() { name = config == null ? null : config.getName(); }
public WorkspaceConfigImpl build() { return new WorkspaceConfigImpl( name, description, defaultEnvName, commands, projects, environments, attributes); }
public WorkspaceImpl build() { return new WorkspaceImpl(id, account, config, runtime, attributes, isTemporary, status); }
private void checkWorkspaceIsRunningOrStarting(WorkspaceImpl workspace) throws ConflictException { if (workspace.getStatus() != RUNNING && workspace.getStatus() != STARTING) { throw new ConflictException( format( "Could not stop the workspace '%s/%s' because its status is '%s'.", workspace.getNamespace(), workspace.getConfig().getName(), workspace.getStatus())); } }
@Override public int hashCode() { return Objects.hash(id, getPort(), getProtocol(), getPath(), getAttributes()); }
@Transactional protected void doCreate(WorkspaceImpl workspace) { if (workspace.getConfig() != null) { workspace.getConfig().getProjects().forEach(ProjectConfigImpl::prePersistAttributes); } EntityManager manager = managerProvider.get(); manager.persist(workspace); manager.flush(); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof ServerImpl)) { return false; } ServerImpl server = (ServerImpl) o; return Objects.equals(getUrl(), server.getUrl()) && getStatus() == server.getStatus() && Objects.equals(getAttributes(), server.getAttributes()); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof MachineImpl)) { return false; } MachineImpl machine = (MachineImpl) o; return Objects.equals(getAttributes(), machine.getAttributes()) && Objects.equals(getServers(), machine.getServers()) && getStatus() == machine.getStatus(); }
@Override public int hashCode() { return Objects.hash(id, getRecipe(), getMachines()); }
public static WorkspaceImplBuilder builder() { return new WorkspaceImplBuilder(); }
public ServerImpl withAttributes(Map<String, String> attributes) { setAttributes(attributes); return this; }
public ServerConfigImpl withAttributes(Map<String, String> attributes) { setAttributes(attributes); return this; }
public static WorkspaceConfigImplBuilder builder() { return new WorkspaceConfigImplBuilder(); }
@Transactional protected void doCreate(WorkspaceImpl workspace) { if (workspace.getConfig() != null) { workspace.getConfig().getProjects().forEach(ProjectConfigImpl::prePersistAttributes); } EntityManager manager = managerProvider.get(); manager.persist(workspace); manager.flush(); }
@Override public int hashCode() { return Objects.hash(getUrl(), getStatus(), getAttributes()); }
@Override public int hashCode() { return Objects.hash(getAttributes(), getServers(), getStatus()); }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof EnvironmentImpl)) return false; EnvironmentImpl that = (EnvironmentImpl) o; return Objects.equals(id, that.id) && Objects.equals(getRecipe(), that.getRecipe()) && Objects.equals(getMachines(), that.getMachines()); }
@Override public int hashCode() { return Objects.hash(id, getPath()); }