Class RemoteClientSession
- java.lang.Object
-
- org.jivesoftware.openfire.session.RemoteSession
-
- org.jivesoftware.openfire.session.RemoteClientSession
-
- All Implemented Interfaces:
ChannelHandler<org.xmpp.packet.Packet>,RoutableChannelHandler,ClientSession,Session
public class RemoteClientSession extends RemoteSession implements ClientSession
Surrogate for client sessions hosted in some remote cluster node.- Author:
- Gaston Dombiak
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jivesoftware.openfire.session.Session
Session.Status
-
-
Field Summary
-
Fields inherited from class org.jivesoftware.openfire.session.RemoteSession
address, nodeID, streamID
-
Fields inherited from interface org.jivesoftware.openfire.session.Session
Log, MAJOR_VERSION, MINOR_VERSION
-
-
Constructor Summary
Constructors Constructor Description RemoteClientSession(byte[] nodeID, org.xmpp.packet.JID address)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanFloodOfflineMessages()Returns true if the offline messages of the user should be sent to the user when the user becomes online.PrivacyListgetActiveList()Returns the Privacy list that overrides the default privacy list.PrivacyListgetDefaultList()Returns the default Privacy list used for the session's user.org.xmpp.packet.PresencegetPresence()Obtain the presence of this session.StringgetUsername()Returns the username associated with this session.booleanhasRequestedBlocklist()Indicates whether this session has requested a blocklist, as specified in XEP-0191.intincrementConflictCount()Increments the conflict by one and returns new number of conflicts detected on this session.booleanisAnonymousUser()Returns true if the authetnicated user is an anonymous user or if the use has not authenticated yet.booleanisInitialized()Flag indicating if this session has been initialized once coming online.booleanisMessageCarbonsEnabled()Indicates, whether message carbons are enabled.booleanisOfflineFloodStopped()Returns true if the user requested to not receive offline messages when sending an available presence.voidsetActiveList(PrivacyList activeList)Sets the Privacy list that overrides the default privacy list.voidsetDefaultList(PrivacyList defaultList)Sets the default Privacy list used for the session's user.voidsetHasRequestedBlocklist(boolean hasRequestedBlocklist)Defines if this session has requested a blocklist, as specified in XEP-0191.voidsetInitialized(boolean isInit)Sets the initialization state of the session.voidsetMessageCarbonsEnabled(boolean enabled)Enables or disables XEP-0280: Message Carbons for this session.voidsetPresence(org.xmpp.packet.Presence presence)Set the presence of this session-
Methods inherited from class org.jivesoftware.openfire.session.RemoteSession
close, deliverRawText, doClusterTask, doSynchronousClusterTask, getAddress, getCipherSuiteName, getCreationDate, getHostAddress, getHostName, getLanguage, getLastActiveDate, getNumClientPackets, getNumServerPackets, getPeerCertificates, getServerName, getSoftwareVersion, getStatus, getStreamID, getTLSProtocolName, isClosed, isEncrypted, process, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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, process, validate
-
-
-
-
Method Detail
-
getActiveList
public PrivacyList getActiveList()
Description copied from interface:ClientSessionReturns the Privacy list that overrides the default privacy list. This list affects only this session and only for the duration of the session.- Specified by:
getActiveListin interfaceClientSession- Returns:
- the Privacy list that overrides the default privacy list.
-
setActiveList
public void setActiveList(PrivacyList activeList)
Description copied from interface:ClientSessionSets the Privacy list that overrides the default privacy list. This list affects only this session and only for the duration of the session.- Specified by:
setActiveListin interfaceClientSession- Parameters:
activeList- the Privacy list that overrides the default privacy list.
-
getDefaultList
public PrivacyList getDefaultList()
Description copied from interface:ClientSessionReturns the default Privacy list used for the session's user. This list is processed if there is no active list set for the session.- Specified by:
getDefaultListin interfaceClientSession- Returns:
- the default Privacy list used for the session's user.
-
setDefaultList
public void setDefaultList(PrivacyList defaultList)
Description copied from interface:ClientSessionSets the default Privacy list used for the session's user. This list is processed if there is no active list set for the session.- Specified by:
setDefaultListin interfaceClientSession- Parameters:
defaultList- the default Privacy list used for the session's user.
-
getUsername
public String getUsername() throws UserNotFoundException
Description copied from interface:ClientSessionReturns the username associated with this session. Use this information with the user manager to obtain the user based on username.- Specified by:
getUsernamein interfaceClientSession- Returns:
- the username associated with this session
- Throws:
UserNotFoundException- if a user is not associated with a session (the session has not authenticated yet)
-
isAnonymousUser
public boolean isAnonymousUser()
Description copied from interface:ClientSessionReturns true if the authetnicated user is an anonymous user or if the use has not authenticated yet.- Specified by:
isAnonymousUserin interfaceClientSession- Returns:
- true if the authetnicated user is an anonymous user or if the use has not authenticated yet.
-
isInitialized
public boolean isInitialized()
Description copied from interface:ClientSessionFlag indicating if this session has been initialized once coming online. Session initialization occurs after the session receives the first "available" presence update from the client. Initialization actions include pushing offline messages, presence subscription requests, and presence statuses to the client. Initialization occurs only once following the first available presence transition.- Specified by:
isInitializedin interfaceClientSession- Returns:
- True if the session has already been initializsed
-
setInitialized
public void setInitialized(boolean isInit)
Description copied from interface:ClientSessionSets the initialization state of the session.- Specified by:
setInitializedin interfaceClientSession- Parameters:
isInit- True if the session has been initialized- See Also:
ClientSession.isInitialized()
-
canFloodOfflineMessages
public boolean canFloodOfflineMessages()
Description copied from interface:ClientSessionReturns true if the offline messages of the user should be sent to the user when the user becomes online. If the user sent a disco request with node "http://jabber.org/protocol/offline" before the available presence then do not flood the user with the offline messages. If the user is connected from many resources then if one of the sessions stopped the flooding then no session should flood the user.- Specified by:
canFloodOfflineMessagesin interfaceClientSession- Returns:
- true if the offline messages of the user should be sent to the user when the user becomes online.
-
isOfflineFloodStopped
public boolean isOfflineFloodStopped()
Description copied from interface:ClientSessionReturns true if the user requested to not receive offline messages when sending an available presence. The user may send a disco request with node "http://jabber.org/protocol/offline" so that no offline messages are sent to the user when he becomes online. If the user is connected from many resources then if one of the sessions stopped the flooding then no session should flood the user.- Specified by:
isOfflineFloodStoppedin interfaceClientSession- Returns:
- true if the user requested to not receive offline messages when sending an available presence.
-
getPresence
public org.xmpp.packet.Presence getPresence()
Description copied from interface:ClientSessionObtain the presence of this session.- Specified by:
getPresencein interfaceClientSession- Returns:
- The presence of this session or null if not authenticated
-
setPresence
public void setPresence(org.xmpp.packet.Presence presence)
Description copied from interface:ClientSessionSet the presence of this session- Specified by:
setPresencein interfaceClientSession- Parameters:
presence- The presence for the session
-
incrementConflictCount
public int incrementConflictCount()
Description copied from interface:ClientSessionIncrements the conflict by one and returns new number of conflicts detected on this session.- Specified by:
incrementConflictCountin interfaceClientSession- Returns:
- the new number of conflicts detected on this session.
-
isMessageCarbonsEnabled
public boolean isMessageCarbonsEnabled()
Description copied from interface:ClientSessionIndicates, whether message carbons are enabled.- Specified by:
isMessageCarbonsEnabledin interfaceClientSession- Returns:
- True, if message carbons are enabled.
-
setMessageCarbonsEnabled
public void setMessageCarbonsEnabled(boolean enabled)
Description copied from interface:ClientSessionEnables or disables XEP-0280: Message Carbons for this session.- Specified by:
setMessageCarbonsEnabledin interfaceClientSession- Parameters:
enabled- True, if message carbons are enabled.- See Also:
- XEP-0280: Message Carbons
-
hasRequestedBlocklist
public boolean hasRequestedBlocklist()
Description copied from interface:ClientSessionIndicates whether this session has requested a blocklist, as specified in XEP-0191.- Specified by:
hasRequestedBlocklistin interfaceClientSession- Returns:
- true when a blocklist was requested, otherwise false;
-
setHasRequestedBlocklist
public void setHasRequestedBlocklist(boolean hasRequestedBlocklist)
Description copied from interface:ClientSessionDefines if this session has requested a blocklist, as specified in XEP-0191.- Specified by:
setHasRequestedBlocklistin interfaceClientSession- Parameters:
hasRequestedBlocklist- True when a blocklist has been requested by this session, otherwise false.
-
-