1 package org.astrogrid.security;
2
3 import java.util.Hashtable;
4 import org.apache.axis.SimpleTargetedChain;
5 import org.apache.axis.ConfigurationException;
6 import org.apache.axis.configuration.SimpleProvider;
7 import org.apache.axis.transport.http.HTTPSender;
8 import org.apache.axis.transport.java.JavaSender;
9 import org.apache.axis.transport.local.LocalSender;
10
11 /***
12 * A SimpleProvider set up with hardcoded configuration for a client.
13 * The transports "java", "local" and "http" are configured as handler chains
14 * with their appropriate pivot handlers. In each chain, AstroGrid's security
15 * handler is set as the request handler and no response handlers are set.
16 *
17 * @author Guy Rixon
18 */
19 public class SecuredClientConfig extends SimpleProvider {
20
21 /***
22 * Constructor a configuration for a client engine with security handlers.
23 */
24 public SecuredClientConfig() throws ConfigurationException {
25
26
27 AxisClientCredentialHandler h = new AxisClientCredentialHandler();
28
29
30
31
32 deployTransport("java", new SimpleTargetedChain(h, new JavaSender(), null));
33 deployTransport("local", new SimpleTargetedChain(h, new LocalSender(), null));
34 deployTransport("http", new SimpleTargetedChain(h, new HTTPSender(), null));
35
36
37
38
39 Hashtable options = super.getGlobalOptions();
40 if (options == null) {
41 options = new Hashtable();
42 super.setGlobalOptions(options);
43 }
44 options.put("enableNamespacePrefixOptimization", Boolean.FALSE);
45 options.put("disablePrettyXML", Boolean.TRUE);
46 }
47
48 }