/hibernate-ogm-mongodb/src/main/java/org/hibernate/ogm/logging/mongodb/impl/Log.java

https://bitbucket.org/cprenzberg/hibernate-ogm · Java · 91 lines · 50 code · 18 blank · 23 comment · 0 complexity · 29efafa554fac8ea1740a6a2481c19db MD5 · raw file

  1. /*
  2. * Hibernate, Relational Persistence for Idiomatic Java
  3. *
  4. * JBoss, Home of Professional Open Source
  5. * Copyright 2012 Red Hat Inc. and/or its affiliates and other contributors
  6. * as indicated by the @authors tag. All rights reserved.
  7. * See the copyright.txt in the distribution for a
  8. * full listing of individual contributors.
  9. *
  10. * This copyrighted material is made available to anyone wishing to use,
  11. * modify, copy, or redistribute it subject to the terms and conditions
  12. * of the GNU Lesser General Public License, v. 2.1.
  13. * This program is distributed in the hope that it will be useful, but WITHOUT A
  14. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  15. * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
  16. * You should have received a copy of the GNU Lesser General Public License,
  17. * v.2.1 along with this distribution; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  19. * MA 02110-1301, USA.
  20. */
  21. package org.hibernate.ogm.logging.mongodb.impl;
  22. import static org.jboss.logging.Logger.Level.INFO;
  23. import static org.jboss.logging.Logger.Level.TRACE;
  24. import static org.jboss.logging.Logger.Level.WARN;
  25. import com.mongodb.MongoException;
  26. import org.hibernate.HibernateException;
  27. import org.hibernate.ogm.datastore.mongodb.Environment;
  28. import org.jboss.logging.Cause;
  29. import org.jboss.logging.LogMessage;
  30. import org.jboss.logging.Message;
  31. import org.jboss.logging.MessageLogger;
  32. /**
  33. * @author Sanne Grinovero <sanne@hibernate.org> (C) 2012 Red Hat Inc.
  34. */
  35. @MessageLogger(projectCode = "OGM")
  36. public interface Log extends org.hibernate.ogm.util.impl.Log {
  37. @LogMessage(level = INFO)
  38. @Message(id = 1201, value = "Connecting to MongoDB at %1$s:%2$d with a timeout set at %3$d millisecond(s)")
  39. void connectingToMongo(String host, int port, int timeout);
  40. @LogMessage(level = INFO)
  41. @Message(id = 1202, value = "Closing connection to MongoDB")
  42. void disconnectingFromMongo();
  43. @Message(id = 1203, value = "Unable to find or initialize a connection to the MongoDB server")
  44. HibernateException unableToInitializeMongoDB(@Cause RuntimeException e);
  45. @Message(id = 1204, value = "The value set for the configuration property '" + Environment.MONGODB_PORT + "' must be a number between 1 and 65535. Found '[%s]'.")
  46. HibernateException mongoPortIllegalValue(String value);
  47. @Message(id = 1205, value = "Could not resolve MongoDB hostname [%s]")
  48. HibernateException mongoOnUnknownHost(String hostname);
  49. @LogMessage(level = INFO)
  50. @Message(id = 1206, value = "Mongo database named [%s] is not defined. Creating it!")
  51. void creatingDatabase(String dbName);
  52. @LogMessage(level = INFO)
  53. @Message(id = 1207, value = "Connecting to Mongo database named [%s].")
  54. void connectingToMongoDatabase(String dbName);
  55. @Message(id = 1208, value = "The configuration property '" + Environment.MONGODB_DATABASE + "' was not set. Can't connect to MongoDB.")
  56. HibernateException mongoDbNameMissing();
  57. @Message(id = 1209, value = "The database named [%s] cannot be dropped")
  58. HibernateException unableToDropDatabase(@Cause MongoException e, String databaseName);
  59. @LogMessage(level = TRACE)
  60. @Message(id = 1210, value = "Removed [%d] associations")
  61. void removedAssociation(int nAffected);
  62. @LogMessage(level = INFO)
  63. @Message(id = 1211, value = "The configuration property '" + Environment.MONGODB_SAFE + "' is set to %b")
  64. void useSafe(boolean safe);
  65. @Message(id = 1212, value = "Unknown association storage strategy: [%s]. Supported values in enum %s" )
  66. HibernateException unknownAssociationStorageStrategy(String databaseName, Class<?> enumType);
  67. @Message(id = 1213, value = "MongoDB authentication failed with username [%s]" )
  68. HibernateException authenticationFailed(String username);
  69. @Message(id = 1214, value = "Unable to connect to MongoDB instance %1$s:%2$d" )
  70. HibernateException unableToConnectToDatastore(String host, int port, @Cause Exception e);
  71. @Message( id = 1215, value = "The value set for the configuration property" + Environment.MONGODB_TIMEOUT +" must be a number greater than 0. Found '[%s]'.")
  72. HibernateException mongoDBTimeOutIllegalValue(String value);
  73. }