public class DefaultActorTracker extends Object implements ActorTracker
ActorTracker
.Constructor and Description |
---|
DefaultActorTracker(Client.WithManagement client)
Constructs the tracker.
|
Modifier and Type | Method and Description |
---|---|
@NonNull Actor |
getActor(@NonNull String name)
Gets an Actor based on the name provided.
|
@NonNull Optional<Channel> |
getChannel(@NonNull String channel)
Gets a channel.
|
@NonNull Optional<Channel> |
getTrackedChannel(@NonNull String channel)
Gets a tracked channel.
|
@NonNull Set<Channel> |
getTrackedChannels()
Gets all tracked channels.
|
@NonNull Optional<User> |
getTrackedUser(@NonNull String nick)
Gets a tracked user.
|
boolean |
isStale(@NonNull Staleable staleable)
Gets if the given staleable object is considered stale by the tracker.
|
void |
reset()
Resets.
|
void |
setChannelListReceived(@NonNull String channel)
Sets a channel is having had the full user list received.
|
void |
setChannelModeInfoList(@NonNull String channel,
char mode,
List<ModeInfo> modeInfo)
Sets a channel's mode info list for a given mode, such as bans.
|
void |
setChannelTopic(@NonNull String channel,
@NonNull String topic)
Sets a channel's topic.
|
void |
setChannelTopicInfo(@NonNull String channel,
long time,
@NonNull Actor actor)
Sets info on a channel's topic.
|
void |
setQueryChannelInformation(boolean query)
Sets if channel information should be queried (WHO, MODE)
automatically on join.
|
void |
setUserAccount(@NonNull String nick,
@Nullable String account)
Sets the account for a tracked user.
|
void |
setUserAway(@NonNull String nick,
boolean away)
Sets a user as away without knowing the away message.
|
void |
setUserAway(@NonNull String nick,
@Nullable String message)
Sets a user away message, setting them to be recorded as away.
|
void |
setUserOperString(@NonNull String nick,
@NonNull String operString)
Sets OPER information known about a user.
|
void |
setUserRealName(@NonNull String nick,
@NonNull String realName)
Sets the real name of the user.
|
void |
setUserServer(@NonNull String nick,
@NonNull String server)
Sets the server of a user.
|
boolean |
shouldQueryChannelInformation()
Gets if channel information should be queried (WHO, MODE)
automatically on join.
|
void |
trackChannel(@NonNull String channel)
Tracks a channel.
|
void |
trackChannelMode(@NonNull String channel,
@NonNull ChannelMode mode,
boolean track)
Sets tracking status of a mode (such as bans).
|
void |
trackChannelModeInfo(@NonNull String channel,
boolean add,
@NonNull ModeInfo modeInfo)
Tracks mode info.
|
void |
trackChannelNick(@NonNull String channel,
@NonNull String nick,
@NonNull Set<ChannelUserMode> modes)
Tracks a user based on likely nickname input.
|
void |
trackChannelUser(@NonNull String channel,
@NonNull User user,
@NonNull Set<ChannelUserMode> modes)
Tracks a user.
|
void |
trackUser(@NonNull User user)
Tracks a user.
|
void |
trackUserHostnameChange(@NonNull String nick,
@NonNull String newHostname)
Tracks a user's hostname changing.
|
void |
trackUserNickChange(@NonNull String oldNick,
@NonNull String newNick)
Tracks a user's nick change.
|
void |
trackUserPart(@NonNull String channel,
@NonNull String nick)
Tracks a user parting a channel, potentially untracking them overall
if they are no longer in any tracked channel.
|
void |
trackUserQuit(@NonNull String nick)
Tracks a user quitting, removing them from all channels in which they
were tracked.
|
void |
trackUserRealnameChange(@NonNull String nick,
@NonNull String newRealname)
Tracks a user's realname changing.
|
void |
trackUserUserStringChange(@NonNull String nick,
@NonNull String newUserString)
Tracks a users's user string (ident) changing.
|
void |
unTrackChannel(@NonNull String channel)
Stops tracking a channel.
|
void |
updateChannelModes(@NonNull String channel,
@NonNull ModeStatusList<ChannelMode> statusList)
Updates status modes.
|
public DefaultActorTracker(Client.WithManagement client)
client
- clientpublic @NonNull Actor getActor(@NonNull String name)
ActorTracker
For User
the name needs the full mask and for channels the
name needs the prefix.
getActor
in interface ActorTracker
name
- namepublic @NonNull Optional<Channel> getChannel(@NonNull String channel)
ActorTracker
getChannel
in interface ActorTracker
channel
- channel namepublic @NonNull Optional<Channel> getTrackedChannel(@NonNull String channel)
ActorTracker
getTrackedChannel
in interface ActorTracker
channel
- channel namepublic @NonNull Set<Channel> getTrackedChannels()
ActorTracker
getTrackedChannels
in interface ActorTracker
public @NonNull Optional<User> getTrackedUser(@NonNull String nick)
ActorTracker
getTrackedUser
in interface ActorTracker
nick
- nickname of the userpublic boolean isStale(@NonNull Staleable staleable)
ActorTracker
isStale
in interface ActorTracker
staleable
- potentially stale objectpublic void setChannelListReceived(@NonNull String channel)
ActorTracker
setChannelListReceived
in interface ActorTracker
channel
- channelpublic void setChannelModeInfoList(@NonNull String channel, char mode, List<ModeInfo> modeInfo)
ActorTracker
setChannelModeInfoList
in interface ActorTracker
channel
- channelmode
- modemodeInfo
- mode infopublic void setChannelTopic(@NonNull String channel, @NonNull String topic)
ActorTracker
setChannelTopic
in interface ActorTracker
channel
- channeltopic
- topicpublic void setChannelTopicInfo(@NonNull String channel, long time, @NonNull Actor actor)
ActorTracker
setChannelTopicInfo
in interface ActorTracker
channel
- channeltime
- topic set timeactor
- topic setterpublic void setQueryChannelInformation(boolean query)
ActorTracker
setQueryChannelInformation
in interface ActorTracker
query
- true to query, false to notpublic void setUserAccount(@NonNull String nick, @Nullable String account)
ActorTracker
setUserAccount
in interface ActorTracker
nick
- nickaccount
- account or null if signed outpublic void setUserAway(@NonNull String nick, @Nullable String message)
ActorTracker
setUserAway
in interface ActorTracker
nick
- nickmessage
- away message or null for not awaypublic void setUserAway(@NonNull String nick, boolean away)
ActorTracker
setUserAway
in interface ActorTracker
nick
- nickaway
- true for away, false for not awaypublic void setUserOperString(@NonNull String nick, @NonNull String operString)
ActorTracker
setUserOperString
in interface ActorTracker
nick
- nickoperString
- oper infopublic void setUserRealName(@NonNull String nick, @NonNull String realName)
ActorTracker
setUserRealName
in interface ActorTracker
nick
- nickrealName
- real namepublic void setUserServer(@NonNull String nick, @NonNull String server)
ActorTracker
setUserServer
in interface ActorTracker
nick
- nickserver
- serverpublic boolean shouldQueryChannelInformation()
ActorTracker
shouldQueryChannelInformation
in interface ActorTracker
public void trackChannel(@NonNull String channel)
ActorTracker
trackChannel
in interface ActorTracker
channel
- channel to trackpublic void trackChannelMode(@NonNull String channel, @NonNull ChannelMode mode, boolean track)
ActorTracker
trackChannelMode
in interface ActorTracker
channel
- channelmode
- mode to tracktrack
- true to track false to stop trackingpublic void trackChannelModeInfo(@NonNull String channel, boolean add, @NonNull ModeInfo modeInfo)
ActorTracker
trackChannelModeInfo
in interface ActorTracker
channel
- channeladd
- true to add false to removemodeInfo
- infopublic void trackChannelNick(@NonNull String channel, @NonNull String nick, @NonNull Set<ChannelUserMode> modes)
ActorTracker
trackChannelNick
in interface ActorTracker
channel
- channelnick
- nickmodes
- modes on the userpublic void trackChannelUser(@NonNull String channel, @NonNull User user, @NonNull Set<ChannelUserMode> modes)
ActorTracker
trackChannelUser
in interface ActorTracker
channel
- channeluser
- usermodes
- modes on userpublic void trackUser(@NonNull User user)
ActorTracker
trackUser
in interface ActorTracker
user
- user to trackpublic void trackUserHostnameChange(@NonNull String nick, @NonNull String newHostname)
ActorTracker
trackUserHostnameChange
in interface ActorTracker
nick
- nicknewHostname
- new hostnamepublic void trackUserNickChange(@NonNull String oldNick, @NonNull String newNick)
ActorTracker
trackUserNickChange
in interface ActorTracker
oldNick
- old nicknewNick
- new nickpublic void trackUserRealnameChange(@NonNull String nick, @NonNull String newRealname)
ActorTracker
trackUserRealnameChange
in interface ActorTracker
nick
- nicknewRealname
- new realnamepublic void trackUserPart(@NonNull String channel, @NonNull String nick)
ActorTracker
trackUserPart
in interface ActorTracker
channel
- channelnick
- nick partingpublic void trackUserQuit(@NonNull String nick)
ActorTracker
trackUserQuit
in interface ActorTracker
nick
- nick quittingpublic void trackUserUserStringChange(@NonNull String nick, @NonNull String newUserString)
ActorTracker
trackUserUserStringChange
in interface ActorTracker
nick
- nicknewUserString
- new user stringpublic void unTrackChannel(@NonNull String channel)
ActorTracker
unTrackChannel
in interface ActorTracker
channel
- channel to untrackpublic void updateChannelModes(@NonNull String channel, @NonNull ModeStatusList<ChannelMode> statusList)
ActorTracker
updateChannelModes
in interface ActorTracker
channel
- channelstatusList
- mode status listpublic void reset()
Resettable
reset
in interface Resettable
Copyright © 2013–2021 Kitteh. All rights reserved.