You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

NetworkConfiguration.java 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. package org.apache.archiva.configuration;
  2. /*
  3. * Licensed to the Apache Software Foundation (ASF) under one
  4. * or more contributor license agreements. See the NOTICE file
  5. * distributed with this work for additional information
  6. * regarding copyright ownership. The ASF licenses this file
  7. * to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance
  9. * with the License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing,
  14. * software distributed under the License is distributed on an
  15. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. * KIND, either express or implied. See the License for the
  17. * specific language governing permissions and limitations
  18. * under the License.
  19. */
  20. /**
  21. *
  22. * The network configuration for external http request to
  23. * repositories.
  24. *
  25. *
  26. * @version $Revision$ $Date$
  27. */
  28. @SuppressWarnings( "all" )
  29. public class NetworkConfiguration
  30. implements java.io.Serializable
  31. {
  32. //--------------------------/
  33. //- Class/Member Variables -/
  34. //--------------------------/
  35. /**
  36. * maximum total external http connections.
  37. */
  38. private int maxTotal = 30;
  39. /**
  40. * maximum total external http connections per host.
  41. */
  42. private int maxTotalPerHost = 30;
  43. /**
  44. * use or not http connection pooling default true.
  45. */
  46. private boolean usePooling = true;
  47. //-----------/
  48. //- Methods -/
  49. //-----------/
  50. /**
  51. * Get maximum total external http connections.
  52. *
  53. * @return int
  54. */
  55. public int getMaxTotal()
  56. {
  57. return this.maxTotal;
  58. } //-- int getMaxTotal()
  59. /**
  60. * Get maximum total external http connections per host.
  61. *
  62. * @return int
  63. */
  64. public int getMaxTotalPerHost()
  65. {
  66. return this.maxTotalPerHost;
  67. } //-- int getMaxTotalPerHost()
  68. /**
  69. * Get use or not http connection pooling default true.
  70. *
  71. * @return boolean
  72. */
  73. public boolean isUsePooling()
  74. {
  75. return this.usePooling;
  76. } //-- boolean isUsePooling()
  77. /**
  78. * Set maximum total external http connections.
  79. *
  80. * @param maxTotal
  81. */
  82. public void setMaxTotal( int maxTotal )
  83. {
  84. this.maxTotal = maxTotal;
  85. } //-- void setMaxTotal( int )
  86. /**
  87. * Set maximum total external http connections per host.
  88. *
  89. * @param maxTotalPerHost
  90. */
  91. public void setMaxTotalPerHost( int maxTotalPerHost )
  92. {
  93. this.maxTotalPerHost = maxTotalPerHost;
  94. } //-- void setMaxTotalPerHost( int )
  95. /**
  96. * Set use or not http connection pooling default true.
  97. *
  98. * @param usePooling
  99. */
  100. public void setUsePooling( boolean usePooling )
  101. {
  102. this.usePooling = usePooling;
  103. } //-- void setUsePooling( boolean )
  104. }