Class LocalServerSession
- java.lang.Object
-
- org.jivesoftware.openfire.session.LocalSession
-
- org.jivesoftware.openfire.session.LocalServerSession
-
- All Implemented Interfaces:
ChannelHandler<org.xmpp.packet.Packet>,RoutableChannelHandler,ServerSession,Session
- Direct Known Subclasses:
LocalIncomingServerSession,LocalOutgoingServerSession
public class LocalServerSession extends LocalSession implements ServerSession
- Author:
- dwd
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jivesoftware.openfire.session.ServerSession
ServerSession.AuthenticationMethod
-
Nested classes/interfaces inherited from interface org.jivesoftware.openfire.session.Session
Session.Status
-
-
Field Summary
Fields Modifier and Type Field Description protected ServerSession.AuthenticationMethodauthenticationMethodThe method that was used to authenticate this session.protected booleaninboundAllowedprotected booleanoutboundAllowed-
Fields inherited from class org.jivesoftware.openfire.session.LocalSession
address, CHARSET, conn, serverName, sessionManager, startDate, status, streamID, streamManager
-
Fields inherited from interface org.jivesoftware.openfire.session.Session
Log, MAJOR_VERSION, MINOR_VERSION, STATUS_AUTHENTICATED, STATUS_CLOSED, STATUS_CONNECTED
-
-
Constructor Summary
Constructors Constructor Description LocalServerSession(String serverName, Connection connection, StreamID streamID)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerSession.AuthenticationMethodgetAuthenticationMethod()Obtain method that was used to authenticate this session.StringgetAvailableStreamFeatures()Returns a text with the available stream features.ConnectiongetConnection()Returns the connection associated with this Session.voidreattach(LocalSession connectionProvider, long h)Reattach the (existing) session to the connection provided by a new session (a session that will be replaced by the older, pre-existing session).voidsetAuthenticationMethod(ServerSession.AuthenticationMethod authenticationMethod)Set the method that was used to authenticate this session.voidsetDetached()Set the session to detached mode, indicating that the underlying connection has been closed.voidsetStatus(Session.Status status)Set the new status of this session.StringtoString()-
Methods inherited from class org.jivesoftware.openfire.session.LocalSession
close, decodeVersion, deliverRawText, getAddress, getCipherSuiteName, getCreationDate, getHostAddress, getHostName, getLanguage, getLastActiveDate, getNumClientPackets, getNumServerPackets, getPeerCertificates, getServerName, getSessionData, getSoftwareVersion, getStatus, getStreamID, getStreamManager, getTLSProtocolName, incrementClientPacketCount, incrementServerPacketCount, isClosed, isDetached, isEncrypted, isSecure, isUsingSelfSignedCertificate, process, removeSessionData, setAddress, setSessionData, setSoftwareVersionData, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jivesoftware.openfire.session.ServerSession
isUsingSaslExternal, isUsingServerDialback
-
Methods inherited from interface org.jivesoftware.openfire.session.Session
close, deliverRawText, getAddress, getCipherSuiteName, getCreationDate, getHostAddress, getHostName, getLanguage, getLastActiveDate, getNumClientPackets, getNumServerPackets, getPeerCertificates, getServerName, getSoftwareVersion, getStatus, getStreamID, getTLSProtocolName, isAuthenticated, isClosed, isEncrypted, isSecure, process, validate
-
-
-
-
Field Detail
-
outboundAllowed
protected boolean outboundAllowed
-
inboundAllowed
protected boolean inboundAllowed
-
authenticationMethod
protected ServerSession.AuthenticationMethod authenticationMethod
The method that was used to authenticate this session. Null when the session is not authenticated.
-
-
Constructor Detail
-
LocalServerSession
public LocalServerSession(String serverName, Connection connection, StreamID streamID)
-
-
Method Detail
-
getAvailableStreamFeatures
public String getAvailableStreamFeatures()
Description copied from class:LocalSessionReturns a text with the available stream features. Each subclass may return different values depending whether the session has been authenticated or not.- Specified by:
getAvailableStreamFeaturesin classLocalSession- Returns:
- a text with the available stream features or
nullto add nothing.
-
setDetached
public void setDetached()
Description copied from class:LocalSessionSet the session to detached mode, indicating that the underlying connection has been closed.- Overrides:
setDetachedin classLocalSession
-
reattach
public void reattach(LocalSession connectionProvider, long h)
Description copied from class:LocalSessionReattach the (existing) session to the connection provided by a new session (a session that will be replaced by the older, pre-existing session). The connection must already be initialized as a running XML Stream, normally by having run through XEP-0198 resumption.- Overrides:
reattachin classLocalSession- Parameters:
connectionProvider- Session from which to obtain the connection from.h- the sequence number of the last handled stanza sent over the former stream
-
getConnection
@Nonnull public Connection getConnection()
Returns the connection associated with this Session.- Overrides:
getConnectionin classLocalSession- Returns:
- The connection for this session
-
setStatus
public void setStatus(Session.Status status)
Description copied from class:LocalSessionSet the new status of this session. Setting a status may trigger certain events to occur (setting a closed status will close this session).- Overrides:
setStatusin classLocalSession- Parameters:
status- The new status code for this session
-
getAuthenticationMethod
public ServerSession.AuthenticationMethod getAuthenticationMethod()
Obtain method that was used to authenticate this session. Null when the session is not authenticated.- Specified by:
getAuthenticationMethodin interfaceServerSession- Returns:
- the method used for authentication (possibly null).
-
setAuthenticationMethod
public void setAuthenticationMethod(@Nonnull ServerSession.AuthenticationMethod authenticationMethod)Set the method that was used to authenticate this session. Setting a value will cause the status of this session to be updated to 'Authenticated'.- Parameters:
authenticationMethod- The new authentication method for this session
-
toString
public String toString()
- Overrides:
toStringin classLocalSession
-
-