Interface ClientSession
-
- All Superinterfaces:
ChannelHandler<org.xmpp.packet.Packet>
,RoutableChannelHandler
,Session
- All Known Implementing Classes:
HttpSession
,LocalClientSession
,RemoteClientSession
public interface ClientSession extends Session
Represents a session between the server and a client.- Author:
- Gaston Dombiak
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jivesoftware.openfire.session.Session
Session.Status
-
-
Field Summary
-
Fields inherited from interface org.jivesoftware.openfire.session.Session
Log, MAJOR_VERSION, MINOR_VERSION
-
-
Method Summary
All Methods Instance Methods Abstract 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 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
PrivacyList getActiveList()
Returns the Privacy list that overrides the default privacy list. This list affects only this session and only for the duration of the session.- Returns:
- the Privacy list that overrides the default privacy list.
-
setActiveList
void setActiveList(PrivacyList activeList)
Sets the Privacy list that overrides the default privacy list. This list affects only this session and only for the duration of the session.- Parameters:
activeList
- the Privacy list that overrides the default privacy list.
-
getDefaultList
PrivacyList getDefaultList()
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.- Returns:
- the default Privacy list used for the session's user.
-
setDefaultList
void setDefaultList(PrivacyList defaultList)
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.- Parameters:
defaultList
- the default Privacy list used for the session's user.
-
getUsername
String getUsername() throws UserNotFoundException
Returns the username associated with this session. Use this information with the user manager to obtain the user based on username.- 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
boolean isAnonymousUser()
Returns true if the authetnicated user is an anonymous user or if the use has not authenticated yet.- Returns:
- true if the authetnicated user is an anonymous user or if the use has not authenticated yet.
-
isInitialized
boolean isInitialized()
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.- Returns:
- True if the session has already been initializsed
-
setInitialized
void setInitialized(boolean isInit)
Sets the initialization state of the session.- Parameters:
isInit
- True if the session has been initialized- See Also:
isInitialized()
-
canFloodOfflineMessages
boolean canFloodOfflineMessages()
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.- Returns:
- true if the offline messages of the user should be sent to the user when the user becomes online.
-
isOfflineFloodStopped
boolean isOfflineFloodStopped()
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.- Returns:
- true if the user requested to not receive offline messages when sending an available presence.
-
getPresence
org.xmpp.packet.Presence getPresence()
Obtain the presence of this session.- Returns:
- The presence of this session or null if not authenticated
-
setPresence
void setPresence(org.xmpp.packet.Presence presence)
Set the presence of this session- Parameters:
presence
- The presence for the session
-
incrementConflictCount
int incrementConflictCount()
Increments the conflict by one and returns new number of conflicts detected on this session.- Returns:
- the new number of conflicts detected on this session.
-
isMessageCarbonsEnabled
boolean isMessageCarbonsEnabled()
Indicates, whether message carbons are enabled.- Returns:
- True, if message carbons are enabled.
-
setMessageCarbonsEnabled
void setMessageCarbonsEnabled(boolean enabled)
Enables or disables XEP-0280: Message Carbons for this session.- Parameters:
enabled
- True, if message carbons are enabled.- See Also:
- XEP-0280: Message Carbons
-
hasRequestedBlocklist
boolean hasRequestedBlocklist()
Indicates whether this session has requested a blocklist, as specified in XEP-0191.- Returns:
- true when a blocklist was requested, otherwise false;
-
setHasRequestedBlocklist
void setHasRequestedBlocklist(boolean hasRequestedBlocklist)
Defines if this session has requested a blocklist, as specified in XEP-0191.- Parameters:
hasRequestedBlocklist
- True when a blocklist has been requested by this session, otherwise false.
-
-