Commit c6df5930 authored by Philippe Merle's avatar Philippe Merle

Cosmetic updates. Replaced tab by spaces.

parent fe8473fa
......@@ -37,8 +37,8 @@ import org.apache.cxf.transport.Conduit;
abstract public class AbstractConduitIntent<T extends Conduit>
extends AbstractBindingIntentHandler
{
public final void apply(Object proxy)
{
public final void apply(Object proxy)
{
log.info(this + " applied on " + proxy);
T conduit = null;
......@@ -54,7 +54,7 @@ abstract public class AbstractConduitIntent<T extends Conduit>
throw new IllegalArgumentException(proxy + " is not an Apache CXF Web Service or REST client!");
}
configure(conduit);
}
}
protected abstract void configure(T conduit);
}
......@@ -38,11 +38,11 @@ import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
abstract public class AbstractHTTPClientPolicyIntent
extends AbstractConduitIntent<HTTPConduit>
{
public final void configure(HTTPConduit httpConduit)
{
public final void configure(HTTPConduit httpConduit)
{
HTTPClientPolicy httpClientPolicy = httpConduit.getClient();
configure(httpClientPolicy);
}
}
protected abstract void configure(HTTPClientPolicy httpClientPolicy);
protected abstract void configure(HTTPClientPolicy httpClientPolicy);
}
......@@ -49,8 +49,8 @@ public abstract class AbstractHandlerIntent
// BindingIntentHandler interface.
// ----------------------------------------------------------------------
public final void apply(Object proxy)
{
public final void apply(Object proxy)
{
log.info(this + " applied on " + proxy);
Binding binding = null;
if(proxy instanceof BindingProvider) {
......@@ -66,12 +66,12 @@ public abstract class AbstractHandlerIntent
List<Handler> list = binding.getHandlerChain();
list.add(this.getHandler());
binding.setHandlerChain(list);
}
}
/**
* Get the JAX-WS Handler to add to the proxy instance.
*
* @return the JAX-WS Handler to add to the proxy instance.
*/
protected abstract Handler<MessageContext> getHandler();
/**
* Get the JAX-WS Handler to add to the proxy instance.
*
* @return the JAX-WS Handler to add to the proxy instance.
*/
protected abstract Handler<MessageContext> getHandler();
}
......@@ -38,8 +38,8 @@ import org.apache.cxf.endpoint.Server;
public abstract class AbstractInterceptorProviderIntent
extends AbstractBindingIntentHandler
{
public final void apply(Object proxy)
{
public final void apply(Object proxy)
{
log.info(this + " applied on " + proxy);
InterceptorProvider interceptorProvider = null;
......@@ -58,7 +58,7 @@ public abstract class AbstractInterceptorProviderIntent
throw new IllegalArgumentException(proxy + " is not an Apache CXF Web Service/REST client/server!");
}
configure(interceptorProvider);
}
}
protected abstract void configure(InterceptorProvider interceptorProvider);
protected abstract void configure(InterceptorProvider interceptorProvider);
}
......@@ -53,11 +53,11 @@ public class AuthorizationPolicyIntent
private String authorization;
protected final void configure(HTTPConduit httpConduit)
{
{
AuthorizationPolicy authorizationPolicy = httpConduit.getAuthorization();
authorizationPolicy.setUserName(this.userName);
authorizationPolicy.setPassword(this.password);
authorizationPolicy.setAuthorizationType(this.authorizationType);
authorizationPolicy.setAuthorization(this.authorization);
}
}
}
......@@ -38,11 +38,11 @@ import org.oasisopen.sca.annotation.Property;
*/
public class ConnectionTimeoutIntent extends AbstractHTTPClientPolicyIntent
{
@Property(name="ConnectionTimeout")
private int connectionTimeout;
@Property(name="ConnectionTimeout")
private int connectionTimeout;
protected final void configure(HTTPClientPolicy httpClientPolicy)
{
protected final void configure(HTTPClientPolicy httpClientPolicy)
{
httpClientPolicy.setConnectionTimeout(this.connectionTimeout);
}
}
}
......@@ -41,31 +41,30 @@ import org.oasisopen.sca.annotation.Property;
public class GZIPIntent
extends AbstractInterceptorProviderIntent
{
/**
* Apache CXF GZIP IN interceptor.
*/
private GZIPInInterceptor in = new GZIPInInterceptor();
/**
* Apache CXF GZIP IN interceptor.
*/
private GZIPInInterceptor in = new GZIPInInterceptor();
/**
* Apache CXF GZIP OUT interceptor.
*/
private GZIPOutInterceptor out = new GZIPOutInterceptor();
/**
* Apache CXF GZIP OUT interceptor.
*/
private GZIPOutInterceptor out = new GZIPOutInterceptor();
/**
* Configure Apache CXF interceptors.
*/
protected void configure(InterceptorProvider interceptorProvider)
{
interceptorProvider.getInInterceptors().add(in);
interceptorProvider.getInFaultInterceptors().add(in);
interceptorProvider.getOutInterceptors().add(out);
interceptorProvider.getOutFaultInterceptors().add(out);
}
/**
* Configure Apache CXF interceptors.
*/
protected void configure(InterceptorProvider interceptorProvider)
{
interceptorProvider.getInInterceptors().add(in);
interceptorProvider.getInFaultInterceptors().add(in);
interceptorProvider.getOutInterceptors().add(out);
interceptorProvider.getOutFaultInterceptors().add(out);
}
@Property(name="Threshold")
public void setThreshold(int threshold)
{
// System.out.println("setThreshold(" + threshold + ")");
this.out.setThreshold(threshold);
}
@Property(name="Threshold")
public void setThreshold(int threshold)
{
this.out.setThreshold(threshold);
}
}
......@@ -41,14 +41,14 @@ import org.oasisopen.sca.annotation.Property;
public class LoadBalancingIntent
extends AbstractBindingIntentHandler
{
/**
* Apache CXF load balancing feature.
*/
/**
* Apache CXF load balancing feature.
*/
private LoadDistributorFeature ldf = new LoadDistributorFeature();
/**
* Apache CXF load balancing strategy.
*/
/**
* Apache CXF load balancing strategy.
*/
private SequentialStrategy strategy = new SequentialStrategy();
/**
......@@ -75,7 +75,7 @@ public class LoadBalancingIntent
throw new IllegalArgumentException(proxy + " is not an Apache CXF Web Service client!");
}
// Configure the client instance with the load balancing feature.
// Configure the client instance with the load balancing feature.
ldf.initialize(client, null);
}
......
......@@ -41,14 +41,14 @@ import org.oasisopen.sca.annotation.Property;
public class LoggingInterceptorIntent
extends AbstractInterceptorProviderIntent
{
private LoggingInInterceptor logInIterceptor = new LoggingInInterceptor();
private LoggingOutInterceptor logOutIterceptor = new LoggingOutInterceptor();
private LoggingInInterceptor logInIterceptor = new LoggingInInterceptor();
private LoggingOutInterceptor logOutIterceptor = new LoggingOutInterceptor();
protected void configure(InterceptorProvider interceptorProvider)
{
protected void configure(InterceptorProvider interceptorProvider)
{
interceptorProvider.getInInterceptors().add(logInIterceptor);
interceptorProvider.getOutInterceptors().add(logOutIterceptor);
}
}
@Property(name="PrettyLogging")
public void setPrettyLogging(boolean flag)
......
......@@ -39,15 +39,15 @@ import org.oasisopen.sca.annotation.Property;
public class ProxyServerIntent
extends AbstractHTTPClientPolicyIntent
{
@Property(name="ProxyServer")
private String proxyServer;
@Property(name="ProxyServer")
private String proxyServer;
@Property(name="ProxyServerPort")
private int proxyServerPort;
@Property(name="ProxyServerPort")
private int proxyServerPort;
protected final void configure(HTTPClientPolicy httpClientPolicy)
{
protected final void configure(HTTPClientPolicy httpClientPolicy)
{
httpClientPolicy.setProxyServer(this.proxyServer);
httpClientPolicy.setProxyServerPort(this.proxyServerPort);
}
}
}
......@@ -38,11 +38,11 @@ import org.oasisopen.sca.annotation.Property;
*/
public class ReceiveTimeoutIntent extends AbstractHTTPClientPolicyIntent
{
@Property(name="ReceiveTimeout")
private int receiveTimeout;
@Property(name="ReceiveTimeout")
private int receiveTimeout;
protected final void configure(HTTPClientPolicy httpClientPolicy)
{
protected final void configure(HTTPClientPolicy httpClientPolicy)
{
httpClientPolicy.setReceiveTimeout(this.receiveTimeout);
}
}
}
......@@ -52,62 +52,62 @@ import org.oasisopen.sca.annotation.Property;
public class TLSClientParametersIntent
extends AbstractConduitIntent<HTTPConduit>
{
@Property(name="TrustManagerKeyStoreType")
private String trustManagerKeyStoreType = "JKS";
@Property(name="TrustManagerKeyStorePassword")
private String trustManagerKeyStorePassword;
@Property(name="TrustManagerKeyStoreFile")
private String trustManagerKeyStoreFile;
@Property(name="KeyManagerKeyStoreType")
private String keyManagerKeyStoreType = "JKS";
@Property(name="KeyManagerKeyStorePassword")
private String keyManagerKeyStorePassword;
@Property(name="KeyManagerKeyStoreFile")
private String keyManagerKeyStoreFile;
public final void configure(HTTPConduit httpConduit)
{
// Create a new TLSClientParameters.
TLSClientParameters tlsCP = new TLSClientParameters();
try {
// Init TrustManagers.
KeyStore trustStore = KeyStore.getInstance(this.trustManagerKeyStoreType);
trustStore.load(new FileInputStream(this.trustManagerKeyStoreFile), this.trustManagerKeyStorePassword.toCharArray());
TrustManagerFactory tmf = TrustManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
tmf.init(trustStore);
tlsCP.setTrustManagers(tmf.getTrustManagers());
// Init KeyManagers.
KeyStore keyStore = KeyStore.getInstance(this.keyManagerKeyStoreType);
keyStore.load(new FileInputStream(this.keyManagerKeyStoreFile), this.keyManagerKeyStorePassword.toCharArray());
KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
kmf.init(keyStore, this.keyManagerKeyStorePassword.toCharArray());
tlsCP.setKeyManagers(kmf.getKeyManagers());
// TODO: The following is not recommended and would not be done in a prodcution environment.
tlsCP.setDisableCNCheck(true);
@Property(name="TrustManagerKeyStoreType")
private String trustManagerKeyStoreType = "JKS";
@Property(name="TrustManagerKeyStorePassword")
private String trustManagerKeyStorePassword;
@Property(name="TrustManagerKeyStoreFile")
private String trustManagerKeyStoreFile;
@Property(name="KeyManagerKeyStoreType")
private String keyManagerKeyStoreType = "JKS";
@Property(name="KeyManagerKeyStorePassword")
private String keyManagerKeyStorePassword;
@Property(name="KeyManagerKeyStoreFile")
private String keyManagerKeyStoreFile;
public final void configure(HTTPConduit httpConduit)
{
// Create a new TLSClientParameters.
TLSClientParameters tlsCP = new TLSClientParameters();
try {
// Init TrustManagers.
KeyStore trustStore = KeyStore.getInstance(this.trustManagerKeyStoreType);
trustStore.load(new FileInputStream(this.trustManagerKeyStoreFile), this.trustManagerKeyStorePassword.toCharArray());
TrustManagerFactory tmf = TrustManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
tmf.init(trustStore);
tlsCP.setTrustManagers(tmf.getTrustManagers());
// Init KeyManagers.
KeyStore keyStore = KeyStore.getInstance(this.keyManagerKeyStoreType);
keyStore.load(new FileInputStream(this.keyManagerKeyStoreFile), this.keyManagerKeyStorePassword.toCharArray());
KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
kmf.init(keyStore, this.keyManagerKeyStorePassword.toCharArray());
tlsCP.setKeyManagers(kmf.getKeyManagers());
// TODO: The following is not recommended and would not be done in a prodcution environment.
tlsCP.setDisableCNCheck(true);
// Setup TLSClientParameters of the httpConduit.
httpConduit.setTlsClientParameters(tlsCP);
} catch(KeyStoreException kse) {
kse.printStackTrace();
} catch(NoSuchAlgorithmException nsae) {
nsae.printStackTrace();
} catch(CertificateException ce) {
ce.printStackTrace();
} catch(UnrecoverableKeyException uke) {
uke.printStackTrace();
} catch(FileNotFoundException fnfe) {
fnfe.printStackTrace();
} catch(IOException ioe) {
ioe.printStackTrace();
// Setup TLSClientParameters of the httpConduit.
httpConduit.setTlsClientParameters(tlsCP);
} catch(KeyStoreException kse) {
kse.printStackTrace();
} catch(NoSuchAlgorithmException nsae) {
nsae.printStackTrace();
} catch(CertificateException ce) {
ce.printStackTrace();
} catch(UnrecoverableKeyException uke) {
uke.printStackTrace();
} catch(FileNotFoundException fnfe) {
fnfe.printStackTrace();
} catch(IOException ioe) {
ioe.printStackTrace();
}
}
}
}
......@@ -53,7 +53,7 @@ public class TraceHandlerIntent
// JAX-WS Handler interface.
// ----------------------------------------------------------------------
public boolean handleMessage(MessageContext context)
public boolean handleMessage(MessageContext context)
{
log.info(this + " handleMessage(" + context + ")");
printMessageContext(context);
......@@ -67,16 +67,16 @@ public class TraceHandlerIntent
return true;
}
public void close(MessageContext context)
{
public void close(MessageContext context)
{
log.info(this + " close(" + context + ")");
printMessageContext(context);
}
}
private void printMessageContext(MessageContext context)
{
private void printMessageContext(MessageContext context)
{
for(java.util.Map.Entry<String,Object> entry : context.entrySet()) {
System.out.println(entry.getKey() + "=" + entry.getValue());
}
}
}
}
......@@ -41,46 +41,46 @@ import org.oasisopen.sca.annotation.Property;
public class WSAddressingIntent
extends AbstractInterceptorProviderIntent
{
/**
* Apache CXF WS Addressing interceptor.
*/
private MAPAggregator mapAggregator = new MAPAggregator();
/**
* Apache CXF WS Addressing interceptor.
*/
private MAPAggregator mapAggregator = new MAPAggregator();
/**
* Apache CXF WS Addressing interceptor.
*/
private MAPCodec mapCodec = new MAPCodec();
/**
* Apache CXF WS Addressing interceptor.
*/
private MAPCodec mapCodec = new MAPCodec();
/**
* Configure Apache CXF interceptors.
*/
protected void configure(InterceptorProvider interceptorProvider)
{
interceptorProvider.getInInterceptors().add(mapAggregator);
interceptorProvider.getInInterceptors().add(mapCodec);
interceptorProvider.getOutInterceptors().add(mapAggregator);
interceptorProvider.getOutInterceptors().add(mapCodec);
interceptorProvider.getInFaultInterceptors().add(mapAggregator);
interceptorProvider.getInFaultInterceptors().add(mapCodec);
interceptorProvider.getOutFaultInterceptors().add(mapAggregator);
interceptorProvider.getOutFaultInterceptors().add(mapCodec);
}
/**
* Configure Apache CXF interceptors.
*/
protected void configure(InterceptorProvider interceptorProvider)
{
interceptorProvider.getInInterceptors().add(mapAggregator);
interceptorProvider.getInInterceptors().add(mapCodec);
interceptorProvider.getOutInterceptors().add(mapAggregator);
interceptorProvider.getOutInterceptors().add(mapCodec);
interceptorProvider.getInFaultInterceptors().add(mapAggregator);
interceptorProvider.getInFaultInterceptors().add(mapCodec);
interceptorProvider.getOutFaultInterceptors().add(mapAggregator);
interceptorProvider.getOutFaultInterceptors().add(mapCodec);
}
@Property(name="AddressingRequired")
public void setAddressingRequired(boolean addressingRequired)
{
mapAggregator.setAddressingRequired(addressingRequired);
}
@Property(name="AddressingRequired")
public void setAddressingRequired(boolean addressingRequired)
{
mapAggregator.setAddressingRequired(addressingRequired);
}
@Property(name="AllowDuplicates")
public void setAllowDuplicates(boolean allowDuplicates)
{
mapAggregator.setAllowDuplicates(allowDuplicates);
}
@Property(name="AllowDuplicates")
public void setAllowDuplicates(boolean allowDuplicates)
{
mapAggregator.setAllowDuplicates(allowDuplicates);
}
@Property(name="UsingAddressingAdvisory")
public void setUsingAddressingAdvisory(boolean usingAddressingAdvisory)
{
mapAggregator.setUsingAddressingAdvisory(usingAddressingAdvisory);
}
@Property(name="UsingAddressingAdvisory")
public void setUsingAddressingAdvisory(boolean usingAddressingAdvisory)
{
mapAggregator.setUsingAddressingAdvisory(usingAddressingAdvisory);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment