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 boolean
canFloodOfflineMessages()
Returns true if the offline messages of the user should be sent to the user when the user becomes online.PrivacyList
getActiveList()
Returns the Privacy list that overrides the default privacy list.PrivacyList
getDefaultList()
Returns the default Privacy list used for the session's user.org.xmpp.packet.Presence
getPresence()
Obtain the presence of this session.String
getUsername()
Returns the username associated with this session.boolean
hasRequestedBlocklist()
Indicates whether this session has requested a blocklist, as specified in XEP-0191.int
incrementConflictCount()
Increments the conflict by one and returns new number of conflicts detected on this session.boolean
isAnonymousUser()
Returns true if the authetnicated user is an anonymous user or if the use has not authenticated yet.boolean
isInitialized()
Flag indicating if this session has been initialized once coming online.boolean
isMessageCarbonsEnabled()
Indicates, whether message carbons are enabled.boolean
isOfflineFloodStopped()
Returns true if the user requested to not receive offline messages when sending an available presence.void
setActiveList(PrivacyList activeList)
Sets the Privacy list that overrides the default privacy list.void
setDefaultList(PrivacyList defaultList)
Sets the default Privacy list used for the session's user.void
setHasRequestedBlocklist(boolean hasRequestedBlocklist)
Defines if this session has requested a blocklist, as specified in XEP-0191.void
setInitialized(boolean isInit)
Sets the initialization state of the session.void
setMessageCarbonsEnabled(boolean enabled)
Enables or disables XEP-0280: Message Carbons for this session.void
setPresence(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:ClientSession
Returns 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:
getActiveList
in interfaceClientSession
- Returns:
- the Privacy list that overrides the default privacy list.
-
setActiveList
public void setActiveList(PrivacyList activeList)
Description copied from interface:ClientSession
Sets 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:
setActiveList
in interfaceClientSession
- Parameters:
activeList
- the Privacy list that overrides the default privacy list.
-
getDefaultList
public PrivacyList getDefaultList()
Description copied from interface:ClientSession
Returns 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:
getDefaultList
in interfaceClientSession
- Returns:
- the default Privacy list used for the session's user.
-
setDefaultList
public void setDefaultList(PrivacyList defaultList)
Description copied from interface:ClientSession
Sets 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:
setDefaultList
in interfaceClientSession
- Parameters:
defaultList
- the default Privacy list used for the session's user.
-
getUsername
public String getUsername() throws UserNotFoundException
Description copied from interface:ClientSession
Returns the username associated with this session. Use this information with the user manager to obtain the user based on username.- Specified by:
getUsername
in 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:ClientSession
Returns true if the authetnicated user is an anonymous user or if the use has not authenticated yet.- Specified by:
isAnonymousUser
in 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:ClientSession
Flag 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:
isInitialized
in interfaceClientSession
- Returns:
- True if the session has already been initializsed
-
setInitialized
public void setInitialized(boolean isInit)
Description copied from interface:ClientSession
Sets the initialization state of the session.- Specified by:
setInitialized
in interfaceClientSession
- Parameters:
isInit
- True if the session has been initialized- See Also:
ClientSession.isInitialized()
-
canFloodOfflineMessages
public boolean canFloodOfflineMessages()
Description copied from interface:ClientSession
Returns 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:
canFloodOfflineMessages
in 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:ClientSession
Returns 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:
isOfflineFloodStopped
in 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:ClientSession
Obtain the presence of this session.- Specified by:
getPresence
in 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:ClientSession
Set the presence of this session- Specified by:
setPresence
in interfaceClientSession
- Parameters:
presence
- The presence for the session
-
incrementConflictCount
public int incrementConflictCount()
Description copied from interface:ClientSession
Increments the conflict by one and returns new number of conflicts detected on this session.- Specified by:
incrementConflictCount
in interfaceClientSession
- Returns:
- the new number of conflicts detected on this session.
-
isMessageCarbonsEnabled
public boolean isMessageCarbonsEnabled()
Description copied from interface:ClientSession
Indicates, whether message carbons are enabled.- Specified by:
isMessageCarbonsEnabled
in interfaceClientSession
- Returns:
- True, if message carbons are enabled.
-
setMessageCarbonsEnabled
public void setMessageCarbonsEnabled(boolean enabled)
Description copied from interface:ClientSession
Enables or disables XEP-0280: Message Carbons for this session.- Specified by:
setMessageCarbonsEnabled
in interfaceClientSession
- Parameters:
enabled
- True, if message carbons are enabled.- See Also:
- XEP-0280: Message Carbons
-
hasRequestedBlocklist
public boolean hasRequestedBlocklist()
Description copied from interface:ClientSession
Indicates whether this session has requested a blocklist, as specified in XEP-0191.- Specified by:
hasRequestedBlocklist
in interfaceClientSession
- Returns:
- true when a blocklist was requested, otherwise false;
-
setHasRequestedBlocklist
public void setHasRequestedBlocklist(boolean hasRequestedBlocklist)
Description copied from interface:ClientSession
Defines if this session has requested a blocklist, as specified in XEP-0191.- Specified by:
setHasRequestedBlocklist
in interfaceClientSession
- Parameters:
hasRequestedBlocklist
- True when a blocklist has been requested by this session, otherwise false.
-
-