DP
- is the type of Desc.PublicDR
- is the type of Desc.PrivateSP
- is the type of Subscription.PublicSR
- is the type of Subscription.Privatepublic class Topic<DP,DR,SP,SR> extends java.lang.Object implements LocalData, java.lang.Comparable<Topic>
Modifier and Type | Class and Description |
---|---|
static class |
Topic.Listener<DP,DR,SP,SR> |
static class |
Topic.MetaGetBuilder
Helper class for generating query parameters for {sub get} and {get} packets.
|
protected static class |
Topic.NoteType |
static class |
Topic.TopicType |
LocalData.Payload
Modifier and Type | Field and Description |
---|---|
protected boolean |
mAttached |
protected boolean |
mDeleted |
protected Description<DP,DR> |
mDesc |
protected long |
mLastKeyPress |
protected Topic.Listener<DP,DR,SP,SR> |
mListener |
protected int |
mMaxDel |
protected java.lang.String |
mName |
protected boolean |
mOnline |
protected java.util.HashMap<java.lang.String,Subscription<SP,SR>> |
mSubs |
protected java.util.Date |
mSubsUpdated |
protected java.lang.String[] |
mTags |
protected Tinode |
mTinode |
Modifier | Constructor and Description |
---|---|
protected |
Topic(Tinode tinode,
java.lang.String name,
Description<DP,DR> desc) |
protected |
Topic(Tinode tinode,
java.lang.String name,
Topic.Listener<DP,DR,SP,SR> l)
Create a named topic.
|
protected |
Topic(Tinode tinode,
Subscription<SP,SR> sub) |
protected |
Topic(Tinode tinode,
Topic.Listener<DP,DR,SP,SR> l,
boolean isChannel)
Start a new topic.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addSubToCache(Subscription<SP,SR> sub)
Add subscription to cache.
|
protected void |
allMessagesReceived(java.lang.Integer count) |
protected void |
allSubsReceived() |
int |
compareTo(@NotNull Topic t) |
PromisedReply<ServerMessage> |
delete(boolean hard)
Delete topic
|
PromisedReply<ServerMessage> |
delMessages(boolean hard)
Delete all messages.
|
PromisedReply<ServerMessage> |
delMessages(int fromId,
int toId,
boolean hard)
Delete message range.
|
PromisedReply<ServerMessage> |
delMessages(MsgRange[] ranges,
boolean hard)
Delete messages with id in the provided list.
|
PromisedReply<ServerMessage> |
eject(java.lang.String uid,
boolean ban)
Eject subscriber from topic.
|
protected void |
expunge(boolean hard)
Remove topic from DB or mark it as deleted.
|
Acs |
getAccessMode() |
AcsHelper |
getAnonAcs() |
java.lang.String |
getAnonAcsStr() |
AcsHelper |
getAuthAcs() |
java.lang.String |
getAuthAcsStr() |
MsgRange |
getCachedMessagesRange() |
int |
getClear() |
java.util.Date |
getCreated() |
Defacs |
getDefacs() |
java.util.Date |
getLastSeen()
Get timestamp when the topic was last online, if available.
|
java.lang.String |
getLastSeenUA()
Get user agent string associated with the time when the topic was last online.
|
LocalData.Payload |
getLocal() |
int |
getMaxDel() |
PromisedReply<ServerMessage> |
getMeta(MsgGetMeta query)
Query topic for data or metadata
|
Topic.MetaGetBuilder |
getMetaGetBuilder() |
MsgRange |
getMissingMessageRange() |
java.lang.String |
getName() |
boolean |
getOnline()
Get topic's online status.
|
DR |
getPriv() |
DP |
getPub() |
int |
getRead() |
int |
getRecv() |
int |
getSeq()
Get greatest known seq ID as reported by the server.
|
Subscription<SP,SR> |
getSubscription(java.lang.String key) |
java.util.Collection<Subscription<SP,SR>> |
getSubscriptions() |
java.util.Date |
getSubsUpdated()
Get timestamp of the latest update to subscriptions.
|
java.lang.String[] |
getTags() |
Topic.TopicType |
getTopicType()
Get type of the topic.
|
static Topic.TopicType |
getTopicTypeByName(java.lang.String name)
Get type of the topic from the given topic name.
|
java.util.Date |
getTouched() |
TrustedType |
getTrusted() |
int |
getUnreadCount() |
java.util.Date |
getUpdated() |
PromisedReply<ServerMessage> |
invite(java.lang.String uid,
java.lang.String mode)
Invite user to the topic.
|
boolean |
isApprover()
Check if user has an Approver (A) permission.
|
boolean |
isArchived()
Checks if the topic is archived.
|
boolean |
isAttached() |
boolean |
isBlocked()
Check if current user is blocked in the topic (does not have J permission on the Given side).
|
boolean |
isDeleted()
Checks if the topic is deleted by remote.
|
boolean |
isDeleter()
Check if user has permission to hard-delete messages (D).
|
boolean |
isFndType()
Check if topic is 'fnd' type.
|
boolean |
isGrpType()
Check if topic is 'grp' type.
|
static boolean |
isGrpType(java.lang.String name)
Check if the type of the given topic name is Group.
|
boolean |
isJoiner()
Check if user has Join (J) permission on both sides: 'want' and 'given'.
|
boolean |
isManager()
Check if user has O or A permissions.
|
boolean |
isMeType()
Check if topic is 'me' type.
|
boolean |
isMuted() |
boolean |
isNew()
Check if topic is not yet synchronized to the server.
|
static boolean |
isNew(java.lang.String name)
Checks if given topic name is a new (unsynchronized) topic.
|
boolean |
isOwner()
Check if user is the Owner (O) of the topic.
|
boolean |
isP2PType()
Check if topic is 'p2p' type.
|
static boolean |
isP2PType(java.lang.String name)
Check if the type of the given topic name is P2P.
|
protected boolean |
isPersisted()
Check if the topic is stored.
|
boolean |
isReader()
Check if user has Read (R) permission.
|
boolean |
isSharer()
Check if user has a Sharer (S) permission.
|
protected boolean |
isTrusted(java.lang.String key) |
boolean |
isTrustedDanger() |
boolean |
isTrustedStaff() |
boolean |
isTrustedVerified() |
boolean |
isUserType()
Check if topic is a communication topic, i.e.
|
boolean |
isValid() |
boolean |
isWriter()
Check if user has Write (W) permission.
|
PromisedReply<ServerMessage> |
leave()
Leave topic without unsubscribing
|
PromisedReply<ServerMessage> |
leave(boolean unsub)
Leave topic
|
protected int |
loadSubs() |
int |
msgReadCount(int seq)
Tells how many topic subscribers have reported the message as read.
|
int |
msgRecvCount(int seq)
Tells how many topic subscribers have reported the message as received.
|
void |
noteKeyPress()
Send a key press notification to server.
|
int |
noteRead()
Notify the server that the client read the last message.
|
int |
noteRead(boolean fromMe,
int seq) |
int |
noteRead(int seq) |
protected int |
noteReadRecv(Topic.NoteType what,
boolean fromMe,
int seq)
Let server know the seq id of the most recent received/read message.
|
int |
noteRecv()
Notify the server that the messages is stored on the client
|
protected int |
noteRecv(boolean fromMe) |
protected void |
persist()
Store topic to DB.
|
protected void |
processSub(Subscription<SP,SR> newsub) |
PromisedReply<ServerMessage> |
publish(Drafty content)
Publish message to a topic.
|
PromisedReply<ServerMessage> |
publish(Drafty content,
java.util.Map<java.lang.String,java.lang.Object> extraHeaders)
Publish message to a topic.
|
protected PromisedReply<ServerMessage> |
publish(Drafty content,
java.util.Map<java.lang.String,java.lang.Object> head,
long msgId) |
PromisedReply<ServerMessage> |
publish(java.lang.String content)
Convenience method for plain text messages.
|
protected void |
removeSubFromCache(Subscription<SP,SR> sub)
Remove subscription to cache.
|
protected void |
routeData(MsgServerData data) |
protected void |
routeInfo(MsgServerInfo info) |
protected void |
routeMeta(MsgServerMeta<DP,DR,SP,SR> meta) |
protected void |
routeMetaDel(int clear,
MsgRange[] delseq) |
protected void |
routeMetaDesc(MsgServerMeta<DP,DR,SP,SR> meta) |
protected void |
routeMetaSub(MsgServerMeta<DP,DR,SP,SR> meta) |
protected void |
routeMetaTags(java.lang.String[] tags) |
protected void |
routePres(MsgServerPres pres) |
void |
setAccessMode(Acs mode) |
void |
setClear(int clear) |
void |
setCreated(java.util.Date created) |
void |
setDefacs(Defacs da) |
void |
setDefacs(java.lang.String auth,
java.lang.String anon) |
void |
setDeleted(boolean status)
Mark topic as deleted.
|
PromisedReply<ServerMessage> |
setDescription(DP pub,
DR priv,
java.lang.String[] attachments)
Update topic description.
|
protected PromisedReply<ServerMessage> |
setDescription(MetaSetDesc<DP,DR> desc)
Update topic description.
|
protected void |
setLastSeen(java.util.Date when)
Update timestamp of when the topic was last online.
|
void |
setLastSeen(java.util.Date when,
java.lang.String ua)
Update timestamp and user agent of when the topic was last online.
|
void |
setListener(Topic.Listener<DP,DR,SP,SR> l) |
void |
setLocal(LocalData.Payload value) |
void |
setMaxDel(int max_del) |
PromisedReply<ServerMessage> |
setMeta(MsgSetMeta<DP,DR> meta)
Update topic metadata
|
protected void |
setName(java.lang.String name) |
protected void |
setOnline(boolean online) |
void |
setPriv(DR priv) |
void |
setPub(DP pub) |
void |
setRead(int read) |
protected void |
setReadRecvByRemote(java.lang.String userId,
java.lang.String what,
int seq) |
void |
setRecv(int recv) |
void |
setSeq(int seq)
Update greatest known seq ID.
|
protected void |
setSeqAndFetch(int seq)
Set new seq value and if it's greater than the current value make a network call to fetch new messages.
|
protected void |
setStorage(Storage store)
Assign pointer to cache.
|
protected PromisedReply<ServerMessage> |
setSubscription(MetaSetSub sub)
Update subscription.
|
void |
setTags(java.lang.String[] tags) |
void |
setTouched(java.util.Date touched) |
void |
setTrusted(TrustedType trusted) |
void |
setTypes(java.lang.Class<?> typeOfDescPublic,
java.lang.Class<?> typeOfDescPrivate,
java.lang.Class<?> typeOfSubPublic,
java.lang.Class<?> typeOfSubPrivate)
Set types of payload: {data} as well as public and private content.
|
void |
setTypes(com.fasterxml.jackson.databind.JavaType typeOfDescPublic,
com.fasterxml.jackson.databind.JavaType typeOfDescPrivate,
com.fasterxml.jackson.databind.JavaType typeOfSubPublic,
com.fasterxml.jackson.databind.JavaType typeOfSubPrivate)
Set custom types of payload: {data} as well as public and private content.
|
void |
setTypes(java.lang.String typeOfDescPublic,
java.lang.String typeOfDescPrivate,
java.lang.String typeOfSubPublic,
java.lang.String typeOfSubPrivate)
Set types of payload: {data} content as well as public and private fields of topic.
|
void |
setUpdated(java.util.Date updated) |
protected PromisedReply<ServerMessage> |
subscribe()
Subscribe to topic.
|
PromisedReply<ServerMessage> |
subscribe(MsgSetMeta<DP,DR> set,
MsgGetMeta get)
Subscribe to topic with parameters, optionally in background.
|
<ML extends java.util.Iterator<Storage.Message> & java.io.Closeable> |
syncAll()
Re-send pending messages, delete messages marked for deletion.
|
PromisedReply<ServerMessage> |
syncOne(long msgDatabaseId)
Try to sync one message.
|
protected void |
topicLeft(boolean unsub,
int code,
java.lang.String reason)
Called when the topic receives leave() confirmation.
|
protected void |
update(Description<DP,DR> desc)
Update topic parameters from a Description object.
|
protected void |
update(java.util.Map<java.lang.String,java.lang.Object> params,
MetaSetSub sSub)
Topic sent an update to subscription, got a confirmation.
|
protected void |
update(MetaSetDesc<DP,DR> desc)
Topic sent an update to topic parameters, got a confirmation, now copy
these parameters to topic description.
|
protected void |
update(MsgServerCtrl ctrl,
MsgSetMeta<DP,DR> meta)
Topic sent an update to description or subscription, got a confirmation, now
update local data with the new info.
|
protected void |
update(java.lang.String[] tags)
Update topic parameters from a tags array.
|
protected boolean |
update(Subscription<SP,SR> sub)
Update topic parameters from a Subscription object.
|
boolean |
updateAccessMode(AccessChange ac) |
PromisedReply<ServerMessage> |
updateAdmin(boolean admin) |
PromisedReply<ServerMessage> |
updateDefAcs(java.lang.String auth,
java.lang.String anon)
Update topic's default access
|
PromisedReply<ServerMessage> |
updateMode(java.lang.String update)
Update own access mode.
|
PromisedReply<ServerMessage> |
updateMode(java.lang.String uid,
java.lang.String update)
Update another user's access mode.
|
PromisedReply<ServerMessage> |
updateMuted(boolean muted) |
PromisedReply<ServerMessage> |
updateSharer(boolean sharer) |
protected Tinode mTinode
protected java.lang.String mName
protected Description<DP,DR> mDesc
protected java.util.HashMap<java.lang.String,Subscription<SP,SR>> mSubs
protected java.util.Date mSubsUpdated
protected java.lang.String[] mTags
protected boolean mAttached
protected Topic.Listener<DP,DR,SP,SR> mListener
protected long mLastKeyPress
protected boolean mOnline
protected int mMaxDel
protected boolean mDeleted
protected Topic(Tinode tinode, Subscription<SP,SR> sub)
protected Topic(Tinode tinode, java.lang.String name, Description<DP,DR> desc)
protected Topic(Tinode tinode, java.lang.String name, Topic.Listener<DP,DR,SP,SR> l)
tinode
- instance of Tinode object to communicate with the servername
- name of the topicl
- event listener, optionaljava.lang.IllegalArgumentException
- if 'tinode' argument is nullprotected Topic(Tinode tinode, Topic.Listener<DP,DR,SP,SR> l, boolean isChannel)
Construct typeOfT} with one of com.fasterxml.jackson.databind.type.TypeFactory.constructXYZ()
methods such as
mMyConnectionInstance.getTypeFactory().constructType(MyPayloadClass.class)
.
The actual topic name will be set after completion of a successful subscribe call
tinode
- tinode instancel
- event listener, optionalpublic static Topic.TopicType getTopicTypeByName(java.lang.String name)
name
- name to get type from.public static boolean isP2PType(java.lang.String name)
name
- name of the topic to check.true
if the given name is P2P, false
otherwise.public static boolean isGrpType(java.lang.String name)
name
- name of the topic to check.true
if the given name is Group, false
otherwise.public static boolean isNew(java.lang.String name)
name
- name to checkpublic void setTypes(com.fasterxml.jackson.databind.JavaType typeOfDescPublic, com.fasterxml.jackson.databind.JavaType typeOfDescPrivate, com.fasterxml.jackson.databind.JavaType typeOfSubPublic, com.fasterxml.jackson.databind.JavaType typeOfSubPrivate)
typeOfDescPublic
- type of {meta.desc.public}typeOfDescPrivate
- type of {meta.desc.private}typeOfSubPublic
- type of {meta.subs[].public}typeOfSubPrivate
- type of {meta.subs[].private}public void setTypes(java.lang.Class<?> typeOfDescPublic, java.lang.Class<?> typeOfDescPrivate, java.lang.Class<?> typeOfSubPublic, java.lang.Class<?> typeOfSubPrivate)
typeOfDescPublic
- type of {meta.desc.public}typeOfDescPrivate
- type of {meta.desc.private}typeOfSubPublic
- type of {meta.sub[].public}typeOfSubPrivate
- type of {meta.sub[].private}public void setTypes(java.lang.String typeOfDescPublic, java.lang.String typeOfDescPrivate, java.lang.String typeOfSubPublic, java.lang.String typeOfSubPrivate) throws java.lang.IllegalArgumentException
ResolvedType.toCanonical()
typeOfDescPublic
- type of {meta.desc.public}typeOfDescPrivate
- type of {meta.desc.private}typeOfSubPublic
- type of {meta.desc.public}typeOfSubPrivate
- type of {meta.desc.private}java.lang.IllegalArgumentException
- if types cannot be parsedprotected boolean update(Subscription<SP,SR> sub)
sub
- updated topic parametersprotected void update(Description<DP,DR> desc)
desc
- updated topic parametersprotected void update(java.util.Map<java.lang.String,java.lang.Object> params, MetaSetSub sSub)
params
- {ctrl} parameters returned by the server (could be null).sSub
- updated topic parameters.protected void update(MetaSetDesc<DP,DR> desc)
desc
- updated topic parametersprotected void update(MsgServerCtrl ctrl, MsgSetMeta<DP,DR> meta)
ctrl
- {ctrl} packet sent by the servermeta
- original {meta} packet updated topic parametersprotected void update(java.lang.String[] tags)
tags
- updated topic tagsprotected void setStorage(Storage store)
Tinode.startTrackingTopic(Topic)
store
- storage objectpublic java.util.Date getCreated()
public void setCreated(java.util.Date created)
public java.util.Date getUpdated()
public void setUpdated(java.util.Date updated)
public java.util.Date getTouched()
public void setTouched(java.util.Date touched)
public int compareTo(@NotNull @NotNull Topic t)
compareTo
in interface java.lang.Comparable<Topic>
public java.util.Date getSubsUpdated()
public int getSeq()
public void setSeq(int seq)
seq
- new seq ID.protected void setSeqAndFetch(int seq)
seq
- sequential ID to assign.public int getClear()
public void setClear(int clear)
public int getMaxDel()
public void setMaxDel(int max_del)
public int getRead()
public void setRead(int read)
public int getRecv()
public void setRecv(int recv)
public java.lang.String[] getTags()
public void setTags(java.lang.String[] tags)
public DP getPub()
public void setPub(DP pub)
public TrustedType getTrusted()
public void setTrusted(TrustedType trusted)
public DR getPriv()
public void setPriv(DR priv)
public boolean isArchived()
public boolean isDeleted()
public void setDeleted(boolean status)
status
- true to mark topic as deleted, false to restore.public MsgRange getCachedMessagesRange()
public MsgRange getMissingMessageRange()
public Acs getAccessMode()
public void setAccessMode(Acs mode)
public boolean updateAccessMode(AccessChange ac)
public boolean isApprover()
public PromisedReply<ServerMessage> updateAdmin(boolean admin)
public boolean isManager()
public boolean isSharer()
public PromisedReply<ServerMessage> updateSharer(boolean sharer)
public boolean isMuted()
public PromisedReply<ServerMessage> updateMuted(boolean muted)
public boolean isOwner()
public boolean isReader()
public boolean isWriter()
public boolean isJoiner()
public boolean isBlocked()
public boolean isDeleter()
public Defacs getDefacs()
public void setDefacs(Defacs da)
public void setDefacs(java.lang.String auth, java.lang.String anon)
public AcsHelper getAuthAcs()
public java.lang.String getAuthAcsStr()
public AcsHelper getAnonAcs()
public java.lang.String getAnonAcsStr()
public int getUnreadCount()
public boolean getOnline()
protected void setOnline(boolean online)
protected boolean isPersisted()
protected void persist()
protected void expunge(boolean hard)
protected boolean isTrusted(java.lang.String key)
public boolean isTrustedVerified()
public boolean isTrustedStaff()
public boolean isTrustedDanger()
public void setLastSeen(java.util.Date when, java.lang.String ua)
protected void setLastSeen(java.util.Date when)
public java.util.Date getLastSeen()
public java.lang.String getLastSeenUA()
protected PromisedReply<ServerMessage> subscribe()
public PromisedReply<ServerMessage> subscribe(MsgSetMeta<DP,DR> set, MsgGetMeta get)
NotConnectedException
- if there is no live connection to the serverAlreadySubscribedException
- if the client is already subscribed to the given topicpublic Topic.MetaGetBuilder getMetaGetBuilder()
public PromisedReply<ServerMessage> leave(boolean unsub)
unsub
- true to disconnect and unsubscribe from topic, otherwise just disconnectpublic PromisedReply<ServerMessage> leave()
protected PromisedReply<ServerMessage> publish(Drafty content, java.util.Map<java.lang.String,java.lang.Object> head, long msgId)
public PromisedReply<ServerMessage> publish(Drafty content)
content
- payloadpublic PromisedReply<ServerMessage> publish(Drafty content, java.util.Map<java.lang.String,java.lang.Object> extraHeaders)
content
- payloadextraHeaders
- additional message headers.public PromisedReply<ServerMessage> publish(java.lang.String content)
content
- message to sendpublic <ML extends java.util.Iterator<Storage.Message> & java.io.Closeable> PromisedReply<ServerMessage> syncAll()
PromisedReply
of the last sent command.NotSubscribedException
- if the client is not subscribed to the topicNotConnectedException
- if there is no connection to serverpublic PromisedReply<ServerMessage> syncOne(long msgDatabaseId)
PromisedReply
resolved on result of the operation.NotSubscribedException
- if the client is not subscribed to the topicNotConnectedException
- if there is no connection to serverpublic PromisedReply<ServerMessage> getMeta(MsgGetMeta query)
public PromisedReply<ServerMessage> setMeta(MsgSetMeta<DP,DR> meta)
NotSubscribedException
- if the client is not subscribed to the topicNotConnectedException
- if there is no connection to the serverprotected PromisedReply<ServerMessage> setDescription(MetaSetDesc<DP,DR> desc)
setMeta(co.tinode.tinodesdk.model.MsgSetMeta<DP, DR>)
.desc
- new description (public, private, default access)NotSubscribedException
- if the client is not subscribed to the topicNotConnectedException
- if there is no connection to the serverpublic PromisedReply<ServerMessage> setDescription(DP pub, DR priv, java.lang.String[] attachments)
setMeta(co.tinode.tinodesdk.model.MsgSetMeta<DP, DR>)
.pub
- new public infopriv
- new private infoattachments
- URLs of out-of-band attachments contained in the values of pub (or priv).NotSubscribedException
- if the client is not subscribed to the topicNotConnectedException
- if there is no connection to the serverpublic PromisedReply<ServerMessage> updateDefAcs(java.lang.String auth, java.lang.String anon)
auth
- default access mode for authenticated usersanon
- default access mode for anonymous usersNotSubscribedException
- if the client is not subscribed to the topicNotConnectedException
- if there is no connection to the serverprotected PromisedReply<ServerMessage> setSubscription(MetaSetSub sub)
setMeta(co.tinode.tinodesdk.model.MsgSetMeta<DP, DR>)
.NotSubscribedException
- if the client is not subscribed to the topicNotConnectedException
- if there is no connection to the serverpublic PromisedReply<ServerMessage> updateMode(java.lang.String update)
update
- string which defines the update. It could be a full value or a change.public PromisedReply<ServerMessage> updateMode(java.lang.String uid, java.lang.String update)
uid
- UID of the user to update.update
- string which defines the update. It could be a full value or a change.public PromisedReply<ServerMessage> invite(java.lang.String uid, java.lang.String mode)
uid
- ID of the user to invite to topicmode
- access mode granted to userpublic PromisedReply<ServerMessage> eject(java.lang.String uid, boolean ban)
uid
- id of the user to unsubscribe from the topicban
- ban user (set mode.Given = 'N')public PromisedReply<ServerMessage> delMessages(int fromId, int toId, boolean hard)
hard
- hard-delete messagespublic PromisedReply<ServerMessage> delMessages(MsgRange[] ranges, boolean hard)
ranges
- delete messages with ids in these ranges.hard
- hard-delete messagespublic PromisedReply<ServerMessage> delMessages(boolean hard)
hard
- hard-delete messagespublic PromisedReply<ServerMessage> delete(boolean hard)
hard
- hard-delete topic.protected int noteReadRecv(Topic.NoteType what, boolean fromMe, int seq)
what
- "read" or "recv" to indicate which action to reportfromMe
- indicates if the message is from the current user; update cache but do not send a message.seq
- explicit ID to acknowledge; ignored if <= 0.public int noteRead()
public int noteRead(int seq)
public int noteRead(boolean fromMe, int seq)
public int noteRecv()
protected int noteRecv(boolean fromMe)
public void noteKeyPress()
public java.lang.String getName()
protected void setName(java.lang.String name)
protected int loadSubs()
protected void addSubToCache(Subscription<SP,SR> sub)
sub
- subscription to add to cacheprotected void removeSubFromCache(Subscription<SP,SR> sub)
sub
- subscription to remove from cachepublic Subscription<SP,SR> getSubscription(java.lang.String key)
public java.util.Collection<Subscription<SP,SR>> getSubscriptions()
public boolean isAttached()
public boolean isValid()
public int msgRecvCount(int seq)
seq
- sequence id of the message to testpublic int msgReadCount(int seq)
seq
- sequence id of the message to test.public Topic.TopicType getTopicType()
public boolean isMeType()
public boolean isP2PType()
public boolean isUserType()
public boolean isFndType()
public boolean isGrpType()
public boolean isNew()
protected void topicLeft(boolean unsub, int code, java.lang.String reason)
unsub
- - not just detached but also unsubscribedcode
- result code, always 200reason
- usually "OK"protected void routeMeta(MsgServerMeta<DP,DR,SP,SR> meta)
protected void routeMetaDesc(MsgServerMeta<DP,DR,SP,SR> meta)
protected void processSub(Subscription<SP,SR> newsub)
protected void routeMetaSub(MsgServerMeta<DP,DR,SP,SR> meta)
protected void routeMetaDel(int clear, MsgRange[] delseq)
protected void routeMetaTags(java.lang.String[] tags)
protected void routeData(MsgServerData data)
protected void allMessagesReceived(java.lang.Integer count)
protected void allSubsReceived()
protected void routePres(MsgServerPres pres)
protected void setReadRecvByRemote(java.lang.String userId, java.lang.String what, int seq)
protected void routeInfo(MsgServerInfo info)
public LocalData.Payload getLocal()
public void setLocal(LocalData.Payload value)
public void setListener(Topic.Listener<DP,DR,SP,SR> l)