summaryrefslogtreecommitdiff
path: root/java/newclient/src/main/java/org/apache/qpid/nclient/transport/TransportConnectionFactory.java
blob: 5c97100bdc5298f52d95180499bae55f132ea2a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package org.apache.qpid.nclient.transport;

import java.net.URISyntaxException;

public class TransportConnectionFactory
{
    public enum ConnectionType 
    {	
	TCP,VM
    }
    
    public static TransportConnection createTransportConnection(String url,ConnectionType type) throws URISyntaxException
    {
	return createTransportConnection(new AMQPConnectionURL(url),type);
	
    }
    
    public static TransportConnection createTransportConnection(ConnectionURL url,ConnectionType type)
    {
	switch (type)
	{
	    case TCP : default:
	    {
		return createTCPConnection(url);
	    }
	    
	    case VM :
	    {
		return createVMConnection(url);
	    }
	}
	
    }

    private static TransportConnection createTCPConnection(ConnectionURL url)
    {
	return new TCPConnection(url);
    }
    
    private static TransportConnection createVMConnection(ConnectionURL url)
    {
	return null;
    }
}