Package com.cedarsoft.exceptions

Examples of com.cedarsoft.exceptions.NotFoundException


  private CouchDoc<DesignDocumentsVersionInfo> queryCurrentVersionInfoDoc() throws ActionFailedException, NotFoundException {
    try {
      return db.get( DESIGN_DOCS_VERSION_ID, serializer );
    } catch ( ActionFailedException e ) {
      if ( e.getStatus() == 404 ) {
        throw new NotFoundException( "No document found for <" + DESIGN_DOCS_VERSION_ID + ">", e );
      }
      throw e;
    }
  }
View Full Code Here


  @Override
  @Nonnull
  public T findStoredObject( @Nonnull Matcher<T> matcher, @Nonnull String notFoundMessage ) throws NotFoundException {
    T found = findStoredObject( matcher );
    if ( found == null ) {
      throw new NotFoundException( notFoundMessage );
    }

    return found;
  }
View Full Code Here

  @Override
  public void remove( @Nonnull T object, @Nonnull String removeMessage ) throws NotFoundException {
    lock.writeLock().lock();
    try {
      if ( !storedObjects.remove( object ) ) {
        throw new NotFoundException( removeMessage );
      }
      for ( Listener<T> listener : new ArrayList<Listener<T>>( listeners ) ) {
        listener.objectRemoved( object );
      }
    } finally {
View Full Code Here

  @Override
  @Nonnull
  public T findStoredObject( @Nonnull Matcher<T> matcher, @Nonnull String notFoundMessage ) throws NotFoundException {
    T found = findStoredObject( matcher );
    if ( found == null ) {
      throw new NotFoundException( notFoundMessage );
    }

    return found;
  }
View Full Code Here

  @Override
  public void remove( @Nonnull T object, @Nonnull String removeMessage ) throws NotFoundException {
    try {
      lock.writeLock().lock();
      if ( !storedObjects.remove( object ) ) {
        throw new NotFoundException( removeMessage );
      }
      for ( Listener<T> listener : new ArrayList<Listener<T>>( listeners ) ) {
        listener.objectRemoved( object );
      }
    } finally {
View Full Code Here

  private CouchDoc<DesignDocumentsVersionInfo> queryCurrentVersionInfoDoc() throws ActionFailedException, NotFoundException {
    try {
      return db.get( DESIGN_DOCS_VERSION_ID, serializer );
    } catch ( ActionFailedException e ) {
      if ( e.getStatus() == 404 ) {
        throw new NotFoundException( "No document found for <" + DESIGN_DOCS_VERSION_ID + ">", e );
      }
      throw e;
    }
  }
View Full Code Here

    JDefinedClass resolved = model._getClass( qualifiedName );
    if ( resolved != null ) {
      return resolved;
    }

    throw new NotFoundException();
  }
View Full Code Here

  @Nonnull
  private static TypeMirror getFirstTypeParam( @Nonnull DeclaredType type ) throws NotFoundException {
    Collection<TypeMirror> typeArguments = type.getActualTypeArguments();
    if ( typeArguments.isEmpty() ) {
      throw new NotFoundException( "No typeArguments found for <" + type + ">" );
    }

    return typeArguments.iterator().next();
  }
View Full Code Here

TOP

Related Classes of com.cedarsoft.exceptions.NotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.