Spring Data Document

org.springframework.data.mongodb
Class CannotGetMongoDbConnectionException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.springframework.core.NestedRuntimeException
                  extended by org.springframework.dao.DataAccessException
                      extended by org.springframework.dao.NonTransientDataAccessException
                          extended by org.springframework.dao.NonTransientDataAccessResourceException
                              extended by org.springframework.dao.DataAccessResourceFailureException
                                  extended by org.springframework.data.mongodb.CannotGetMongoDbConnectionException
All Implemented Interfaces:
Serializable

public class CannotGetMongoDbConnectionException
extends DataAccessResourceFailureException

Exception being thrown in case we cannot connect to a MongoDB instance.

Author:
Oliver Gierke
See Also:
Serialized Form

Constructor Summary
CannotGetMongoDbConnectionException(String msg)
           
CannotGetMongoDbConnectionException(String msg, String database, org.springframework.data.authentication.UserCredentials credentials)
           
CannotGetMongoDbConnectionException(String msg, Throwable cause)
           
 
Method Summary
 org.springframework.data.authentication.UserCredentials getCredentials()
          Returns the UserCredentials that were used when trying to connect to the MongoDB instance.
 String getDatabase()
          Returns the name of the database trying to be accessed.
 
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CannotGetMongoDbConnectionException

public CannotGetMongoDbConnectionException(String msg,
                                           Throwable cause)

CannotGetMongoDbConnectionException

public CannotGetMongoDbConnectionException(String msg)

CannotGetMongoDbConnectionException

public CannotGetMongoDbConnectionException(String msg,
                                           String database,
                                           org.springframework.data.authentication.UserCredentials credentials)
Method Detail

getCredentials

public org.springframework.data.authentication.UserCredentials getCredentials()
Returns the UserCredentials that were used when trying to connect to the MongoDB instance.

Returns:

getDatabase

public String getDatabase()
Returns the name of the database trying to be accessed.

Returns:

Spring Data Document

Copyright © 2012. All Rights Reserved.