Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

DeploymentConfiguration.java 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /*
  2. * Copyright 2000-2018 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.server;
  17. import java.io.Serializable;
  18. import java.util.Properties;
  19. import com.vaadin.shared.communication.PushMode;
  20. /**
  21. * A collection of properties configured at deploy time as well as a way of
  22. * accessing third party properties not explicitly supported by this class.
  23. *
  24. * @author Vaadin Ltd
  25. * @since 7.0.0
  26. */
  27. public interface DeploymentConfiguration extends Serializable {
  28. /**
  29. * Returns whether Vaadin is in production mode.
  30. *
  31. * @return true if in production mode, false otherwise.
  32. */
  33. public boolean isProductionMode();
  34. /**
  35. * Returns whether cross-site request forgery protection is enabled.
  36. *
  37. * @return true if XSRF protection is enabled, false otherwise.
  38. */
  39. public boolean isXsrfProtectionEnabled();
  40. /**
  41. * Returns whether sync id checking is enabled. The sync id is used to
  42. * gracefully handle situations when the client sends a message to a
  43. * connector that has recently been removed on the server.
  44. *
  45. * @since 7.3
  46. * @return <code>true</code> if sync id checking is enabled;
  47. * <code>false</code> otherwise
  48. */
  49. public boolean isSyncIdCheckEnabled();
  50. /**
  51. * Returns the time resources can be cached in the browsers, in seconds.
  52. *
  53. * @return The resource cache time.
  54. */
  55. public int getResourceCacheTime();
  56. /**
  57. * Returns the number of seconds between heartbeat requests of a UI, or a
  58. * non-positive number if heartbeat is disabled.
  59. *
  60. * @return The time between heartbeats.
  61. */
  62. public int getHeartbeatInterval();
  63. /**
  64. * Returns whether the sending of URL's as GET and POST parameters in
  65. * requests with content-type <code>application/x-www-form-urlencoded</code>
  66. * is enabled or not.
  67. *
  68. * @return <code>false</code> if set to false or <code>true</code> otherwise
  69. */
  70. public boolean isSendUrlsAsParameters();
  71. /**
  72. * Returns whether a session should be closed when all its open UIs have
  73. * been idle for longer than its configured maximum inactivity time.
  74. * <p>
  75. * A UI is idle if it is open on the client side but has no activity other
  76. * than heartbeat requests. If {@code isCloseIdleSessions() == false},
  77. * heartbeat requests cause the session to stay open for as long as there
  78. * are open UIs on the client side. If it is {@code true}, the session is
  79. * eventually closed if the open UIs do not have any user interaction.
  80. *
  81. * @see WrappedSession#getMaxInactiveInterval()
  82. *
  83. * @since 7.0.0
  84. *
  85. * @return True if UIs and sessions receiving only heartbeat requests are
  86. * eventually closed; false if heartbeat requests extend UI and
  87. * session lifetime indefinitely.
  88. */
  89. public boolean isCloseIdleSessions();
  90. /**
  91. * Returns the mode of bidirectional ("push") client-server communication
  92. * that should be used.
  93. *
  94. * @return The push mode in use.
  95. */
  96. public PushMode getPushMode();
  97. /**
  98. * Gets the properties configured for the deployment, e.g. as init
  99. * parameters to the servlet or portlet.
  100. *
  101. * @return properties for the application.
  102. */
  103. public Properties getInitParameters();
  104. /**
  105. * Gets a configured property. The properties are typically read from e.g.
  106. * web.xml or from system properties of the JVM.
  107. *
  108. * @param propertyName
  109. * The simple of the property, in some contexts, lookup might be
  110. * performed using variations of the provided name.
  111. * @param defaultValue
  112. * the default value that should be used if no value has been
  113. * defined
  114. * @return the property value, or the passed default value if no property
  115. * value is found
  116. */
  117. public String getApplicationOrSystemProperty(String propertyName,
  118. String defaultValue);
  119. /**
  120. * Gets UI class configuration option value.
  121. *
  122. * @return UI class name
  123. *
  124. * @since 7.4
  125. */
  126. public String getUIClassName();
  127. /**
  128. * Gets UI provider class configuration option value.
  129. *
  130. * @since 7.4
  131. *
  132. * @return UI class name
  133. */
  134. public String getUIProviderClassName();
  135. /**
  136. * Gets Widgetset configuration option value. {@code defaultValue} is
  137. * returned if widgetset parameter is not configured.
  138. *
  139. * @since 7.4
  140. *
  141. * @return UI class name
  142. */
  143. public String getWidgetset(String defaultValue);
  144. /**
  145. * Gets resources path configuration option value.
  146. *
  147. * @since 7.4
  148. */
  149. public String getResourcesPath();
  150. /**
  151. * Gets class loader configuration option value.
  152. *
  153. * @since 7.4
  154. */
  155. public String getClassLoaderName();
  156. }