org.apache.qpid.transport
Class Connection
java.lang.Object
org.apache.qpid.transport.ConnectionInvoker
org.apache.qpid.transport.Connection
- All Implemented Interfaces:
- Receiver<ProtocolEvent>, Sender<ProtocolEvent>
public class Connection
- extends ConnectionInvoker
- implements Receiver<ProtocolEvent>, Sender<ProtocolEvent>
Connection
- Todo:
- the channels map should probably be replaced with something
more efficient, e.g. an array or a map implementation that can use
short instead of Short
Method Summary |
void |
addConnectionListener(ConnectionListener listener)
|
void |
close()
|
void |
close(ConnectionCloseCode replyCode,
String replyText,
Option... _options)
|
(package private) void |
closeCode(ConnectionClose close)
|
void |
closed()
|
void |
connect(ConnectionSettings settings)
|
void |
connect(String host,
int port,
String vhost,
String username,
String password)
|
void |
connect(String host,
int port,
String vhost,
String username,
String password,
boolean ssl)
|
void |
connect(String host,
int port,
String vhost,
String username,
String password,
boolean ssl,
String saslMechs)
|
void |
connect(String host,
int port,
String vhost,
String username,
String password,
boolean ssl,
String saslMechs,
Map<String,Object> clientProps)
|
Session |
createSession()
|
Session |
createSession(Binary name,
long expiry)
|
Session |
createSession(byte[] name,
long expiry)
|
Session |
createSession(long expiry)
|
Session |
createSession(String name)
|
Session |
createSession(String name,
long expiry)
|
void |
dispatch(Method method)
|
void |
exception(ConnectionException e)
|
void |
exception(Throwable t)
|
void |
flush()
|
String |
getAuthorizationID()
|
int |
getChannelMax()
|
String |
getClientId()
|
ConnectionDelegate |
getConnectionDelegate()
|
long |
getConnectionId()
|
ConnectionSettings |
getConnectionSettings()
|
int |
getIdleTimeout()
|
(package private) String |
getLocale()
|
SaslClient |
getSaslClient()
|
(package private) SaslServer |
getSaslServer()
|
SecurityLayer |
getSecurityLayer()
|
Sender<ProtocolEvent> |
getSender()
|
Map<String,Object> |
getServerProperties()
|
(package private) Session |
getSession(int channel)
|
String |
getUserID()
|
protected void |
invoke(Method method)
|
(package private) void |
map(Session ssn,
int channel)
|
void |
mgmtClose()
|
void |
received(ProtocolEvent event)
|
(package private) void |
removeSession(Session ssn)
|
void |
resume()
|
void |
send(ProtocolEvent event)
|
void |
setAuthorizationID(String authorizationID)
|
(package private) void |
setChannelMax(int max)
|
void |
setClientId(String id)
|
void |
setConnectionDelegate(ConnectionDelegate delegate)
|
void |
setIdleTimeout(int i)
|
(package private) void |
setLocale(String locale)
|
(package private) void |
setSaslClient(SaslClient saslClient)
|
(package private) void |
setSaslServer(SaslServer saslServer)
|
void |
setSender(Sender<ProtocolEvent> sender)
|
void |
setServerProperties(Map<String,Object> serverProperties)
|
void |
setSessionFactory(Connection.SessionFactory sessionFactory)
|
protected void |
setState(Connection.State state)
|
void |
setUserID(String id)
|
String |
toString()
|
(package private) void |
unmap(Session ssn)
|
Methods inherited from class org.apache.qpid.transport.ConnectionInvoker |
connectionClose, connectionCloseOk, connectionHeartbeat, connectionOpen, connectionOpenOk, connectionRedirect, connectionSecure, connectionSecureOk, connectionStart, connectionStartOk, connectionTune, connectionTuneOk |
log
protected static final Logger log
Connection
public Connection()
setConnectionDelegate
public void setConnectionDelegate(ConnectionDelegate delegate)
addConnectionListener
public void addConnectionListener(ConnectionListener listener)
getSender
public Sender<ProtocolEvent> getSender()
setSender
public void setSender(Sender<ProtocolEvent> sender)
setState
protected void setState(Connection.State state)
getClientId
public String getClientId()
setClientId
public void setClientId(String id)
setLocale
void setLocale(String locale)
getLocale
String getLocale()
setSaslServer
void setSaslServer(SaslServer saslServer)
getSaslServer
SaslServer getSaslServer()
setSaslClient
void setSaslClient(SaslClient saslClient)
getSaslClient
public SaslClient getSaslClient()
connect
public void connect(String host,
int port,
String vhost,
String username,
String password)
connect
public void connect(String host,
int port,
String vhost,
String username,
String password,
boolean ssl)
connect
public void connect(String host,
int port,
String vhost,
String username,
String password,
boolean ssl,
String saslMechs)
connect
public void connect(String host,
int port,
String vhost,
String username,
String password,
boolean ssl,
String saslMechs,
Map<String,Object> clientProps)
connect
public void connect(ConnectionSettings settings)
createSession
public Session createSession()
createSession
public Session createSession(long expiry)
createSession
public Session createSession(String name)
createSession
public Session createSession(String name,
long expiry)
createSession
public Session createSession(byte[] name,
long expiry)
createSession
public Session createSession(Binary name,
long expiry)
removeSession
void removeSession(Session ssn)
setSessionFactory
public void setSessionFactory(Connection.SessionFactory sessionFactory)
getConnectionId
public long getConnectionId()
getConnectionDelegate
public ConnectionDelegate getConnectionDelegate()
received
public void received(ProtocolEvent event)
- Specified by:
received
in interface Receiver<ProtocolEvent>
send
public void send(ProtocolEvent event)
- Specified by:
send
in interface Sender<ProtocolEvent>
flush
public void flush()
- Specified by:
flush
in interface Sender<ProtocolEvent>
invoke
protected void invoke(Method method)
- Specified by:
invoke
in class ConnectionInvoker
dispatch
public void dispatch(Method method)
getChannelMax
public int getChannelMax()
setChannelMax
void setChannelMax(int max)
map
void map(Session ssn,
int channel)
unmap
void unmap(Session ssn)
getSession
Session getSession(int channel)
resume
public void resume()
exception
public void exception(ConnectionException e)
exception
public void exception(Throwable t)
- Specified by:
exception
in interface Receiver<ProtocolEvent>
closeCode
void closeCode(ConnectionClose close)
closed
public void closed()
- Specified by:
closed
in interface Receiver<ProtocolEvent>
close
public void close()
- Specified by:
close
in interface Sender<ProtocolEvent>
mgmtClose
public void mgmtClose()
close
public void close(ConnectionCloseCode replyCode,
String replyText,
Option... _options)
setIdleTimeout
public void setIdleTimeout(int i)
- Specified by:
setIdleTimeout
in interface Sender<ProtocolEvent>
getIdleTimeout
public int getIdleTimeout()
setAuthorizationID
public void setAuthorizationID(String authorizationID)
getAuthorizationID
public String getAuthorizationID()
getUserID
public String getUserID()
setUserID
public void setUserID(String id)
setServerProperties
public void setServerProperties(Map<String,Object> serverProperties)
getServerProperties
public Map<String,Object> getServerProperties()
toString
public String toString()
- Overrides:
toString
in class Object
getConnectionSettings
public ConnectionSettings getConnectionSettings()
getSecurityLayer
public SecurityLayer getSecurityLayer()
Licensed to the Apache Software Foundation