01: /*
02: * <copyright>
03: * Copyright 1999-2004 Cougaar Software, Inc.
04: * under sponsorship of the Defense Advanced Research Projects
05: * Agency (DARPA).
06: *
07: * You can redistribute this software and/or modify it under the
08: * terms of the Cougaar Open Source License as published on the
09: * Cougaar Open Source Website (www.cougaar.org).
10: *
11: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
12: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
13: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
14: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
15: * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
16: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
18: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
19: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
21: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22: *
23: * </copyright>
24: */
25: package org.cougaar.mts.http;
26:
27: import org.cougaar.core.service.ServletService; // javadoc only
28: import org.cougaar.mts.base.LinkProtocol; // javadoc only
29: import org.cougaar.mts.std.AttributedMessage;
30:
31: /**
32: * This {@link LinkProtocol} uses the Cougaar's {@link ServletService}
33: * (Tomcat) for communication via https (ssl).
34: */
35: public class HTTPSLinkProtocol extends HTTPLinkProtocol {
36: public HTTPSLinkProtocol() {
37: super ();
38: }
39:
40: public String getProtocolType() {
41: return "-HTTPS";
42: }
43:
44: public String getProtocol() {
45: return "https";
46: }
47:
48: /**
49: * Returns TRUE
50: */
51: protected Boolean usesEncryptedSocket() {
52: return Boolean.TRUE;
53: }
54:
55: // hard-code value. higher than RMI but lower than SSLRMI
56: protected int computeCost(AttributedMessage message) {
57: return super .computeCost(message) * 3;
58: }
59:
60: // cost of DestinationLink is hard-coded to 500
61:
62: public Class getProtocolClass() {
63: return HTTPSLinkProtocol.class;
64: } //getProtocolClass()
65:
66: }
|