Clover Coverage Report - ARESTC 0.1.7-SNAPSHOT
Coverage timestamp: Fri Aug 27 2010 19:12:04 CEST
../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
9   107   6   1.5
0   32   0.67   6
6     1  
1    
 
  ServiceConnectionData       Line # 27 9 0% 6 0 100% 1.0
 
  (36)
 
1    /*
2    *
3    * (C)opyright 2010, Nikolaos Georgosopoulos
4    *
5    * This file is part of ARESTC.
6    *
7    * ARESTC is free software: you can redistribute it and/or modify it under the
8    * terms of the Lesser General Public License as published by the Free Software
9    * Foundation, either version 3 of the License, or (at your option) any later
10    * version.
11    *
12    * ARESTC is distributed in the hope that it will be useful, but WITHOUT ANY
13    * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14    * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15    *
16    * You should have received a copy of the Lesser General Public License along
17    * with ARESTC. If not, see <http://www.gnu.org/licenses/>.
18    */
19    package net.sf.arestc.core.services;
20   
21    import java.text.MessageFormat;
22   
23    // TODO: Auto-generated Javadoc
24    /**
25    * The Class ServiceConnectionData.
26    */
 
27    public class ServiceConnectionData {
28   
29    /** The Constant URL_FORMAT. */
30    private static final String URL_FORMAT = "{0}:{1,number,####}/{2}";
31    /** The context path. */
32    private final String contextPath;
33    /** The method. */
34    private final HTTPMethods method;
35    /** The server. */
36    private final String server;
37    /** The port. */
38    private final int port;
39   
40    /**
41    * Instantiates a new service connection data.
42    *
43    * @param server
44    * the server
45    * @param port
46    * the port
47    * @param contextPath
48    * the context path
49    * @param method
50    * the method
51    */
 
52  280 toggle public ServiceConnectionData(final String server, final int port,
53    final String contextPath, final HTTPMethods method) {
54  280 this.contextPath = contextPath;
55  280 this.method = method;
56  280 this.server = server;
57  280 this.port = port;
58   
59    }
60   
61    /**
62    * Gets the context path.
63    *
64    * @return the context path
65    */
 
66  33 toggle public String getContextPath() {
67  33 return contextPath;
68    }
69   
70    /**
71    * Gets the method.
72    *
73    * @return the method
74    */
 
75  40 toggle public HTTPMethods getMethod() {
76  40 return method;
77    }
78   
79    /**
80    * Gets the port.
81    *
82    * @return the port
83    */
 
84  30 toggle public int getPort() {
85  30 return port;
86    }
87   
88    /**
89    * Gets the real path.
90    *
91    * @return the real path
92    */
 
93  30 toggle public String getRealPath() {
94  30 return MessageFormat.format(URL_FORMAT, new Object[] { getServer(),
95    getPort(), getContextPath() });
96    }
97   
98    /**
99    * Gets the server.
100    *
101    * @return the server
102    */
 
103  30 toggle public String getServer() {
104  30 return server;
105    }
106   
107    }