@Override public void create(StackImpl stack) throws ConflictException, ServerException { requireNonNull(stack, "Required non-null stack"); try { doCreate(stack); } catch (DuplicateKeyException x) { throw new ConflictException( format("Stack with id '%s' or name '%s' already exists", stack.getId(), stack.getName())); } catch (RuntimeException x) { throw new ServerException(x.getLocalizedMessage(), x); } }
@Override public StackImpl update(StackImpl update) throws NotFoundException, ServerException, ConflictException { requireNonNull(update, "Required non-null update"); try { return new StackImpl(doUpdate(update)); } catch (DuplicateKeyException x) { throw new ConflictException(format("Stack with name '%s' already exists", update.getName())); } catch (RuntimeException x) { throw new ServerException(x.getLocalizedMessage(), x); } }
@Override public void create(StackImpl stack) throws ConflictException, ServerException { requireNonNull(stack, "Required non-null stack"); try { doCreate(stack); } catch (DuplicateKeyException x) { throw new ConflictException( format("Stack with id '%s' or name '%s' already exists", stack.getId(), stack.getName())); } catch (RuntimeException x) { throw new ServerException(x.getLocalizedMessage(), x); } }
@Override public StackImpl update(StackImpl update) throws NotFoundException, ServerException, ConflictException { requireNonNull(update, "Required non-null update"); try { return new StackImpl(doUpdate(update)); } catch (DuplicateKeyException x) { throw new ConflictException(format("Stack with name '%s' already exists", update.getName())); } catch (RuntimeException x) { throw new ServerException(x.getLocalizedMessage(), x); } }
public StackImpl(StackImpl stack) { this( stack.getId(), stack.getName(), stack.getDescription(), stack.getScope(), stack.getCreator(), stack.getTags(), stack.getWorkspaceConfig(), stack.getComponents(), stack.getStackIcon()); }