Fix duplicates from inserting
This commit is contained in:
parent
687288e697
commit
7905693fc7
|
@ -14,6 +14,8 @@ import androidx.core.app.NotificationManagerCompat;
|
|||
import org.mercury_im.messenger.entity.chat.DirectChat;
|
||||
import org.mercury_im.messenger.ui.chat.ChatActivity;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class Notifications {
|
||||
|
||||
public static final String NOTIFICATION_CHANNEL__FOREGROUND_SERVICE = "foreground_service";
|
||||
|
@ -62,7 +64,7 @@ public class Notifications {
|
|||
|
||||
public static int directChatMessageReceived(Context context, DirectChat chat, String contactName, String body) {
|
||||
NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(context);
|
||||
int id = (int) chat.getId();
|
||||
UUID id = chat.getId();
|
||||
|
||||
Intent tapAction = new Intent(context, ChatActivity.class);
|
||||
tapAction.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
|
@ -78,9 +80,9 @@ public class Notifications {
|
|||
builder.setContentIntent(pendingIntent);
|
||||
builder.setAutoCancel(true);
|
||||
|
||||
notificationManagerCompat.notify(id, builder.build());
|
||||
notificationManagerCompat.notify(id.hashCode(), builder.build());
|
||||
|
||||
return id;
|
||||
return id.hashCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ public class LoginActivity extends AppCompatActivity implements TextView.OnEdito
|
|||
|
||||
case R.id.password:
|
||||
if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_NULL) {
|
||||
viewModel.login();
|
||||
//viewModel.login();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@ import org.jxmpp.jid.impl.JidCreate;
|
|||
import org.mercury_im.messenger.MercuryImApplication;
|
||||
import org.mercury_im.messenger.R;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
|
@ -44,7 +46,7 @@ public class ChatActivity extends AppCompatActivity
|
|||
|
||||
private EntityBareJid jid;
|
||||
|
||||
private long accountId;
|
||||
private UUID accountId;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -72,7 +74,7 @@ public class ChatActivity extends AppCompatActivity
|
|||
jid = JidCreate.entityBareFromOrThrowUnchecked(jidString);
|
||||
// JID will never change, so just set it once
|
||||
getSupportActionBar().setSubtitle(jid.asUnescapedString());
|
||||
accountId = savedInstanceState.getLong(EXTRA_ACCOUNT);
|
||||
accountId = UUID.fromString(savedInstanceState.getString(EXTRA_ACCOUNT));
|
||||
|
||||
chatViewModel = new ViewModelProvider(this).get(ChatViewModel.class);
|
||||
chatViewModel.init(accountId, jid);
|
||||
|
@ -144,7 +146,7 @@ public class ChatActivity extends AppCompatActivity
|
|||
@Override
|
||||
protected void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
outState.putString(EXTRA_JID, jid.toString());
|
||||
outState.putLong(EXTRA_ACCOUNT, accountId);
|
||||
outState.putString(EXTRA_ACCOUNT, accountId.toString());
|
||||
super.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.mercury_im.messenger.entity.contact.Peer;
|
|||
import org.mercury_im.messenger.entity.message.Message;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -47,7 +48,7 @@ public class ChatViewModel extends ViewModel {
|
|||
MercuryImApplication.getApplication().getAppComponent().inject(this);
|
||||
}
|
||||
|
||||
public void init(long accountId, EntityBareJid jid) {
|
||||
public void init(UUID accountId, EntityBareJid jid) {
|
||||
disposable.add(contactRepository.getOrCreatePeer(accountId, jid.toString())
|
||||
.subscribe((Consumer<Peer>) this::init));
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ public class ContactListRecyclerViewAdapter
|
|||
|
||||
Intent intent = new Intent(context, ChatActivity.class);
|
||||
intent.putExtra(ChatActivity.EXTRA_JID, address);
|
||||
intent.putExtra(ChatActivity.EXTRA_ACCOUNT, contact.getAccount().getId());
|
||||
intent.putExtra(ChatActivity.EXTRA_ACCOUNT, contact.getAccount().getId().toString());
|
||||
|
||||
context.startActivity(intent);
|
||||
});
|
||||
|
|
|
@ -50,8 +50,9 @@ public class RepositoryModule {
|
|||
ReactiveEntityStore<Persistable> data,
|
||||
@Named(value = ThreadUtils.SCHEDULER_IO) Scheduler ioScheduler,
|
||||
@Named(value = ThreadUtils.SCHEDULER_UI) Scheduler uiScheduler,
|
||||
PeerMapping peerMapping) {
|
||||
return new XmppPeerRepository(data, ioScheduler, uiScheduler, peerMapping);
|
||||
PeerMapping peerMapping,
|
||||
AccountRepository accountRepository) {
|
||||
return new XmppPeerRepository(data, ioScheduler, uiScheduler, peerMapping, accountRepository);
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
|
|
@ -25,6 +25,7 @@ public class AccountMapping extends AbstractMapping<Account, AccountModel> {
|
|||
|
||||
@Override
|
||||
public AccountModel mapToModel(Account entity, AccountModel model) {
|
||||
model.setId(entity.getId());
|
||||
model.setAddress(entity.getAddress());
|
||||
model.setPassword(entity.getPassword());
|
||||
model.setHost(entity.getHost());
|
||||
|
|
|
@ -28,6 +28,7 @@ public class DirectChatMapping extends AbstractMapping<DirectChat, DirectChatMod
|
|||
|
||||
@Override
|
||||
public DirectChatModel mapToModel(DirectChat entity, DirectChatModel model) {
|
||||
model.setId(entity.getId());
|
||||
model.setPeer(peerMapping.toModel(entity.getPeer(), model.getPeer()));
|
||||
return model;
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ public class PeerMapping extends AbstractMapping<Peer, PeerModel> {
|
|||
|
||||
@Override
|
||||
public PeerModel mapToModel(Peer entity, PeerModel model) {
|
||||
model.setId(entity.getId());
|
||||
model.setAccount(accountMapping.toModel(entity.getAccount(), model.getAccount()));
|
||||
model.setAddress(entity.getAddress());
|
||||
model.setName(entity.getName());
|
||||
|
@ -40,9 +41,9 @@ public class PeerMapping extends AbstractMapping<Peer, PeerModel> {
|
|||
|
||||
@Override
|
||||
public Peer mapToEntity(PeerModel model, Peer entity) {
|
||||
entity.setId(model.getId());
|
||||
entity.setAccount(accountMapping.toEntity(model.getAccount(), entity.getAccount()));
|
||||
entity.setAddress(model.getAddress());
|
||||
entity.setId(model.getId());
|
||||
|
||||
entity.setSubscriptionDirection(model.getSubscriptionDirection());
|
||||
entity.setSubscriptionPending(model.isSubscriptionPending());
|
||||
|
|
|
@ -1,19 +1,23 @@
|
|||
package org.mercury_im.messenger.data.model;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import io.requery.Column;
|
||||
import io.requery.Convert;
|
||||
import io.requery.Entity;
|
||||
import io.requery.Generated;
|
||||
import io.requery.Key;
|
||||
import io.requery.Persistable;
|
||||
import io.requery.Table;
|
||||
import io.requery.converter.UUIDConverter;
|
||||
|
||||
@Table(name = "accounts")
|
||||
@Entity
|
||||
public abstract class AbstractAccountModel implements Persistable {
|
||||
|
||||
@Key
|
||||
@Generated
|
||||
long id;
|
||||
@Convert(UUIDConverter.class)
|
||||
UUID id;
|
||||
|
||||
@Column(nullable = false)
|
||||
String address;
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package org.mercury_im.messenger.data.model;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import io.requery.CascadeAction;
|
||||
import io.requery.Convert;
|
||||
import io.requery.Entity;
|
||||
import io.requery.ForeignKey;
|
||||
import io.requery.Generated;
|
||||
|
@ -7,15 +11,17 @@ import io.requery.Key;
|
|||
import io.requery.OneToOne;
|
||||
import io.requery.Persistable;
|
||||
import io.requery.Table;
|
||||
import io.requery.converter.UUIDConverter;
|
||||
|
||||
@Entity
|
||||
@Table(name = "chats")
|
||||
public abstract class AbstractDirectChatModel implements Persistable {
|
||||
|
||||
@Key @Generated
|
||||
long id;
|
||||
@Key
|
||||
@Convert(UUIDConverter.class)
|
||||
UUID id;
|
||||
|
||||
@OneToOne
|
||||
@OneToOne(cascade = CascadeAction.NONE)
|
||||
@ForeignKey(referencedColumn = "id")
|
||||
PeerModel peer;
|
||||
|
||||
|
|
|
@ -1,19 +1,24 @@
|
|||
package org.mercury_im.messenger.data.model;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import io.requery.Column;
|
||||
import io.requery.Convert;
|
||||
import io.requery.Entity;
|
||||
import io.requery.Generated;
|
||||
import io.requery.Key;
|
||||
import io.requery.ManyToOne;
|
||||
import io.requery.Persistable;
|
||||
import io.requery.Table;
|
||||
import io.requery.converter.UUIDConverter;
|
||||
|
||||
@Entity
|
||||
@Table(name = "groupchats")
|
||||
public abstract class AbstractGroupChatModel implements Persistable {
|
||||
|
||||
@Key @Generated
|
||||
long id;
|
||||
@Key
|
||||
@Convert(UUIDConverter.class)
|
||||
UUID id;
|
||||
|
||||
@Column(nullable = false)
|
||||
@ManyToOne
|
||||
|
|
|
@ -5,6 +5,7 @@ import org.mercury_im.messenger.entity.message.MessageDirection;
|
|||
|
||||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import io.requery.Column;
|
||||
import io.requery.Convert;
|
||||
|
@ -14,13 +15,15 @@ import io.requery.Key;
|
|||
import io.requery.OneToMany;
|
||||
import io.requery.Persistable;
|
||||
import io.requery.Table;
|
||||
import io.requery.converter.UUIDConverter;
|
||||
|
||||
@Entity
|
||||
@Table(name = "messages")
|
||||
public abstract class AbstractMessageModel implements Persistable {
|
||||
|
||||
@Key @Generated
|
||||
long id;
|
||||
@Key
|
||||
@Convert(UUIDConverter.class)
|
||||
UUID id;
|
||||
|
||||
@Column(nullable = false)
|
||||
String sender;
|
||||
|
|
|
@ -3,6 +3,9 @@ package org.mercury_im.messenger.data.model;
|
|||
import org.mercury_im.messenger.data.converter.SubscriptionDirectionConverter;
|
||||
import org.mercury_im.messenger.entity.contact.SubscriptionDirection;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import io.requery.CascadeAction;
|
||||
import io.requery.Column;
|
||||
import io.requery.Convert;
|
||||
import io.requery.Entity;
|
||||
|
@ -11,16 +14,19 @@ import io.requery.Generated;
|
|||
import io.requery.Key;
|
||||
import io.requery.ManyToOne;
|
||||
import io.requery.Persistable;
|
||||
import io.requery.ReferentialAction;
|
||||
import io.requery.Table;
|
||||
import io.requery.converter.UUIDConverter;
|
||||
|
||||
@Entity
|
||||
@Table(name = "contacts")
|
||||
public abstract class AbstractPeerModel implements Persistable {
|
||||
|
||||
@Key @Generated
|
||||
long id;
|
||||
@Key
|
||||
@Convert(UUIDConverter.class)
|
||||
UUID id;
|
||||
|
||||
@ManyToOne
|
||||
@ManyToOne(cascade = CascadeAction.NONE)
|
||||
@ForeignKey(referencedColumn = "id")
|
||||
AccountModel account;
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import org.mercury_im.messenger.util.ThreadUtils;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
@ -52,7 +53,7 @@ public class XmppAccountRepository
|
|||
}
|
||||
|
||||
@Override
|
||||
public Observable<Optional<Account>> observeAccount(long accountId) {
|
||||
public Observable<Optional<Account>> observeAccount(UUID accountId) {
|
||||
return dao.get(accountId).observableResult()
|
||||
.map(ResultDelegate::firstOrNull)
|
||||
.map(accountMapping::toEntity)
|
||||
|
@ -62,7 +63,7 @@ public class XmppAccountRepository
|
|||
}
|
||||
|
||||
@Override
|
||||
public Maybe<Account> getAccount(long accountId) {
|
||||
public Maybe<Account> getAccount(UUID accountId) {
|
||||
return dao.get(accountId).maybe()
|
||||
.map(accountMapping::toEntity)
|
||||
.subscribeOn(subscriberScheduler())
|
||||
|
|
|
@ -11,6 +11,7 @@ import org.mercury_im.messenger.util.ThreadUtils;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
@ -57,7 +58,7 @@ public class XmppDirectChatRepository
|
|||
}
|
||||
|
||||
@Override
|
||||
public Observable<Optional<DirectChat>> observeDirectChat(long chatId) {
|
||||
public Observable<Optional<DirectChat>> observeDirectChat(UUID chatId) {
|
||||
return dao.get(chatId).observableResult()
|
||||
.map(ResultDelegate::firstOrNull)
|
||||
.map(directChatMapping::toEntity)
|
||||
|
@ -67,7 +68,7 @@ public class XmppDirectChatRepository
|
|||
}
|
||||
|
||||
@Override
|
||||
public Maybe<DirectChat> getDirectChat(long chatId) {
|
||||
public Maybe<DirectChat> getDirectChat(UUID chatId) {
|
||||
return dao.get(chatId).maybe()
|
||||
.map(directChatMapping::toEntity)
|
||||
.subscribeOn(subscriberScheduler())
|
||||
|
@ -77,12 +78,13 @@ public class XmppDirectChatRepository
|
|||
@Override
|
||||
public Single<DirectChat> getOrCreateChatWithPeer(Peer peer) {
|
||||
return getDirectChatByPeer(peer)
|
||||
.switchIfEmpty(insertDirectChat(new IDirectChat(){
|
||||
{
|
||||
setAccount(peer.getAccount());
|
||||
setPeer(peer);
|
||||
}
|
||||
}))
|
||||
.switchIfEmpty(Single.just(new IDirectChat())
|
||||
.map(chat -> {
|
||||
chat.setAccount(peer.getAccount());
|
||||
chat.setPeer(peer);
|
||||
return chat;
|
||||
})
|
||||
.flatMap(this::insertDirectChat))
|
||||
.subscribeOn(subscriberScheduler())
|
||||
.observeOn(observerScheduler());
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import org.mercury_im.messenger.util.ThreadUtils;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
@ -54,7 +55,7 @@ public class XmppGroupChatRepository
|
|||
}
|
||||
|
||||
@Override
|
||||
public Observable<Optional<GroupChat>> observeGroupChat(long chatId) {
|
||||
public Observable<Optional<GroupChat>> observeGroupChat(UUID chatId) {
|
||||
return dao.get(chatId).observableResult()
|
||||
.map(ResultDelegate::firstOrNull)
|
||||
.map(groupChatMapping::toEntity)
|
||||
|
@ -64,7 +65,7 @@ public class XmppGroupChatRepository
|
|||
}
|
||||
|
||||
@Override
|
||||
public Maybe<GroupChat> getGroupChat(long chatId) {
|
||||
public Maybe<GroupChat> getGroupChat(UUID chatId) {
|
||||
return dao.get(chatId).maybe()
|
||||
.map(groupChatMapping::toEntity)
|
||||
.subscribeOn(subscriberScheduler())
|
||||
|
@ -87,7 +88,7 @@ public class XmppGroupChatRepository
|
|||
}
|
||||
|
||||
@Override
|
||||
public Observable<Optional<GroupChat>> observeGroupChatByRoomAddress(long accountId, String roomAddress) {
|
||||
public Observable<Optional<GroupChat>> observeGroupChatByRoomAddress(UUID accountId, String roomAddress) {
|
||||
return dao.get(accountId, roomAddress).observableResult()
|
||||
.map(ResultDelegate::firstOrNull)
|
||||
.map(groupChatMapping::toEntity)
|
||||
|
@ -97,7 +98,7 @@ public class XmppGroupChatRepository
|
|||
}
|
||||
|
||||
@Override
|
||||
public Maybe<GroupChat> getGroupChatByRoomAddress(long accountId, String roomAddress) {
|
||||
public Maybe<GroupChat> getGroupChatByRoomAddress(UUID accountId, String roomAddress) {
|
||||
return dao.get(accountId, roomAddress).maybe()
|
||||
.map(groupChatMapping::toEntity)
|
||||
.subscribeOn(subscriberScheduler())
|
||||
|
|
|
@ -13,6 +13,7 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
@ -30,8 +31,7 @@ public class XmppPeerRepository
|
|||
extends RequeryRepository
|
||||
implements PeerRepository {
|
||||
|
||||
@Inject
|
||||
AccountRepository accountRepository;
|
||||
private final AccountRepository accountRepository;
|
||||
|
||||
private final PeerMapping peerMapping;
|
||||
|
||||
|
@ -39,9 +39,10 @@ public class XmppPeerRepository
|
|||
public XmppPeerRepository(ReactiveEntityStore<Persistable> data,
|
||||
@Named(value = ThreadUtils.SCHEDULER_IO) Scheduler subscriberScheduler,
|
||||
@Named(value = ThreadUtils.SCHEDULER_UI) Scheduler observerScheduler,
|
||||
PeerMapping peerMapping) {
|
||||
PeerMapping peerMapping, AccountRepository accountRepository) {
|
||||
super(data, subscriberScheduler, observerScheduler);
|
||||
this.peerMapping = peerMapping;
|
||||
this.accountRepository = accountRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -53,7 +54,7 @@ public class XmppPeerRepository
|
|||
}
|
||||
|
||||
@Override
|
||||
public Observable<Optional<Peer>> observePeer(long peerId) {
|
||||
public Observable<Optional<Peer>> observePeer(UUID peerId) {
|
||||
return data().select(PeerModel.class)
|
||||
.where(PeerModel.ID.eq(peerId))
|
||||
.get().observableResult()
|
||||
|
@ -63,7 +64,7 @@ public class XmppPeerRepository
|
|||
}
|
||||
|
||||
@Override
|
||||
public Maybe<Peer> getPeer(long peerId) {
|
||||
public Maybe<Peer> getPeer(UUID peerId) {
|
||||
return data().select(PeerModel.class)
|
||||
.where(PeerModel.ID.eq(peerId))
|
||||
.get().maybe()
|
||||
|
@ -73,7 +74,7 @@ public class XmppPeerRepository
|
|||
}
|
||||
|
||||
@Override
|
||||
public Observable<Optional<Peer>> observePeerByAddress(long accountId, String address) {
|
||||
public Observable<Optional<Peer>> observePeerByAddress(UUID accountId, String address) {
|
||||
return data().select(PeerModel.class)
|
||||
.where(PeerModel.ACCOUNT_ID.eq(accountId))
|
||||
.and(PeerModel.ADDRESS.eq(address))
|
||||
|
@ -86,13 +87,13 @@ public class XmppPeerRepository
|
|||
}
|
||||
|
||||
@Override
|
||||
public Single<Peer> getOrCreatePeer(long accountId, String address) {
|
||||
public Single<Peer> getOrCreatePeer(UUID accountId, String address) {
|
||||
return accountRepository.getAccount(accountId).toSingle()
|
||||
.flatMap(account -> getOrCreatePeer(account, address));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Maybe<Peer> getPeerByAddress(long accountId, String address) {
|
||||
public Maybe<Peer> getPeerByAddress(UUID accountId, String address) {
|
||||
return data().select(PeerModel.class)
|
||||
.where(PeerModel.ACCOUNT_ID.eq(accountId))
|
||||
.and(PeerModel.ADDRESS.eq(address))
|
||||
|
@ -134,7 +135,7 @@ public class XmppPeerRepository
|
|||
}
|
||||
|
||||
@Override
|
||||
public Observable<List<Peer>> observeAllContactsOfAccount(long accountId) {
|
||||
public Observable<List<Peer>> observeAllContactsOfAccount(UUID accountId) {
|
||||
return data().select(PeerModel.class)
|
||||
.where(PeerModel.ACCOUNT_ID.eq(accountId))
|
||||
.and(PeerModel.SUBSCRIPTION_DIRECTION.in(
|
||||
|
@ -194,7 +195,7 @@ public class XmppPeerRepository
|
|||
}
|
||||
|
||||
@Override
|
||||
public Completable deletePeer(long accountId, String address) {
|
||||
public Completable deletePeer(UUID accountId, String address) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@ package org.mercury_im.messenger.data.repository.dao;
|
|||
|
||||
import org.mercury_im.messenger.data.model.AccountModel;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import io.reactivex.Single;
|
||||
|
@ -20,7 +22,7 @@ public class AccountDao extends RequeryDao {
|
|||
return data().insert(account);
|
||||
}
|
||||
|
||||
public ReactiveResult<AccountModel> get(long accountId) {
|
||||
public ReactiveResult<AccountModel> get(UUID accountId) {
|
||||
return data().select(AccountModel.class)
|
||||
.where(AccountModel.ID.eq(accountId))
|
||||
.get();
|
||||
|
@ -37,7 +39,7 @@ public class AccountDao extends RequeryDao {
|
|||
.get();
|
||||
}
|
||||
|
||||
public Single<Integer> delete(long accountId) {
|
||||
public Single<Integer> delete(UUID accountId) {
|
||||
return data().delete(AccountModel.class)
|
||||
.where(AccountModel.ID.eq(accountId))
|
||||
.get().single();
|
||||
|
|
|
@ -2,6 +2,8 @@ package org.mercury_im.messenger.data.repository.dao;
|
|||
|
||||
import org.mercury_im.messenger.data.model.DirectChatModel;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import io.reactivex.Single;
|
||||
|
@ -20,13 +22,13 @@ public class DirectChatDao extends RequeryDao {
|
|||
return data().insert(chat);
|
||||
}
|
||||
|
||||
public ReactiveResult<DirectChatModel> get(long chatId) {
|
||||
public ReactiveResult<DirectChatModel> get(UUID chatId) {
|
||||
return data().select(DirectChatModel.class)
|
||||
.where(DirectChatModel.ID.eq(chatId))
|
||||
.get();
|
||||
}
|
||||
|
||||
public ReactiveResult<DirectChatModel> getByPeer(long peerId) {
|
||||
public ReactiveResult<DirectChatModel> getByPeer(UUID peerId) {
|
||||
return data().select(DirectChatModel.class)
|
||||
.where(DirectChatModel.PEER_ID.eq(peerId))
|
||||
.get();
|
||||
|
@ -37,7 +39,7 @@ public class DirectChatDao extends RequeryDao {
|
|||
.get();
|
||||
}
|
||||
|
||||
public Single<Integer> delete(long chatId) {
|
||||
public Single<Integer> delete(UUID chatId) {
|
||||
return data().delete(DirectChatModel.class)
|
||||
.where(DirectChatModel.ID.eq(chatId))
|
||||
.get()
|
||||
|
|
|
@ -2,6 +2,8 @@ package org.mercury_im.messenger.data.repository.dao;
|
|||
|
||||
import org.mercury_im.messenger.data.model.GroupChatModel;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import io.reactivex.Single;
|
||||
|
@ -20,13 +22,13 @@ public class GroupChatDao extends RequeryDao {
|
|||
return data().insert(chat);
|
||||
}
|
||||
|
||||
public ReactiveResult<GroupChatModel> get(long chatId) {
|
||||
public ReactiveResult<GroupChatModel> get(UUID chatId) {
|
||||
return data().select(GroupChatModel.class)
|
||||
.where(GroupChatModel.ID.eq(chatId))
|
||||
.get();
|
||||
}
|
||||
|
||||
public ReactiveResult<GroupChatModel> get(long accountId, String address) {
|
||||
public ReactiveResult<GroupChatModel> get(UUID accountId, String address) {
|
||||
return data().select(GroupChatModel.class)
|
||||
.where(GroupChatModel.ACCOUNT_ID.eq(accountId))
|
||||
.and(GroupChatModel.ADDRESS.eq(address))
|
||||
|
@ -38,7 +40,7 @@ public class GroupChatDao extends RequeryDao {
|
|||
.get();
|
||||
}
|
||||
|
||||
public Single<Integer> delete(long chatId) {
|
||||
public Single<Integer> delete(UUID chatId) {
|
||||
return data().delete(GroupChatModel.class)
|
||||
.where(GroupChatModel.ID.eq(chatId))
|
||||
.get()
|
||||
|
|
|
@ -6,6 +6,8 @@ import org.mercury_im.messenger.data.model.GroupChatModel;
|
|||
import org.mercury_im.messenger.data.model.GroupMessagesRelation;
|
||||
import org.mercury_im.messenger.data.model.MessageModel;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import io.reactivex.Single;
|
||||
import io.requery.Persistable;
|
||||
import io.requery.reactivex.ReactiveEntityStore;
|
||||
|
@ -26,7 +28,7 @@ public class MessageDao extends RequeryDao {
|
|||
return data().insert(message);
|
||||
}
|
||||
|
||||
public ReactiveResult<MessageModel> get(long messageId) {
|
||||
public ReactiveResult<MessageModel> get(UUID messageId) {
|
||||
return data().select(MessageModel.class)
|
||||
.where(MessageModel.ID.eq(messageId))
|
||||
.get();
|
||||
|
|
|
@ -25,13 +25,11 @@ public class AccountMappingTest {
|
|||
|
||||
static {
|
||||
ACCOUNT_MISSION_CONTROL = new IAccount();
|
||||
ACCOUNT_MISSION_CONTROL.setId(1);
|
||||
ACCOUNT_MISSION_CONTROL.setAddress("mission-controll@planet.earth");
|
||||
ACCOUNT_MISSION_CONTROL.setEnabled(true);
|
||||
ACCOUNT_MISSION_CONTROL.setPassword("notBecauseTheyAreEasy");
|
||||
|
||||
ACCOUNT_LITTLE_JOE = new IAccount();
|
||||
ACCOUNT_LITTLE_JOE.setId(2);
|
||||
ACCOUNT_LITTLE_JOE.setAddress("little-joe@planet.earth");
|
||||
ACCOUNT_LITTLE_JOE.setEnabled(false);
|
||||
ACCOUNT_LITTLE_JOE.setPassword("butBecauseTheyAreHard");
|
||||
|
@ -47,7 +45,7 @@ public class AccountMappingTest {
|
|||
AccountModel model = accountMapping.toModel(ACCOUNT_MISSION_CONTROL);
|
||||
|
||||
assertEquals("Since we cannot set the id of the model in the mapper, it is still 0.",
|
||||
0, model.getId());
|
||||
ACCOUNT_MISSION_CONTROL.getId(), model.getId());
|
||||
assertNotSame(ACCOUNT_MISSION_CONTROL.getId(), model.getId());
|
||||
assertEquals(ACCOUNT_MISSION_CONTROL.getAddress(), model.getAddress());
|
||||
assertEquals(ACCOUNT_MISSION_CONTROL.getPassword(), model.getPassword());
|
||||
|
@ -62,22 +60,10 @@ public class AccountMappingTest {
|
|||
model.setEnabled(true);
|
||||
model.setPassword("12345");
|
||||
|
||||
// I hate reflections... Set ID to 12
|
||||
setIdUsingReflections(model, 12L);
|
||||
|
||||
assertEquals(12L, model.getId());
|
||||
|
||||
Account entity = accountMapping.toEntity(model);
|
||||
|
||||
assertEquals(model.getId(), entity.getId());
|
||||
assertEquals(model.getAddress(), entity.getAddress());
|
||||
assertEquals(model.getPassword(), entity.getPassword());
|
||||
}
|
||||
|
||||
private void setIdUsingReflections(AccountModel model, long id) throws NoSuchFieldException, IllegalAccessException {
|
||||
Field field = model.getClass().getDeclaredField("$proxy");
|
||||
field.setAccessible(true);
|
||||
EntityProxy<AccountModel> proxy = (EntityProxy<AccountModel>) field.get(model);
|
||||
proxy.set(AccountModel.ID, id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import org.mercury_im.messenger.data.model.AccountModel;
|
|||
import org.mercury_im.messenger.data.model.PeerModel;
|
||||
import org.mercury_im.messenger.entity.contact.IPeer;
|
||||
import org.mercury_im.messenger.entity.contact.Peer;
|
||||
import org.mercury_im.messenger.entity.contact.SubscriptionDirection;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -21,10 +22,9 @@ public class PeerMappingTest {
|
|||
static {
|
||||
PEER_GORDO = new IPeer();
|
||||
PEER_GORDO.setAccount(AccountMappingTest.ACCOUNT_MISSION_CONTROL);
|
||||
PEER_GORDO.setId(1);
|
||||
PEER_GORDO.setAddress("gordo@big.joe");
|
||||
PEER_GORDO.setName("Gordo");
|
||||
PEER_GORDO.setSubscriptionDirection(SubscriptionMode.TO_THEM_ACCEPTED_PREAPPROVED);
|
||||
PEER_GORDO.setSubscriptionDirection(SubscriptionDirection.both);
|
||||
}
|
||||
|
||||
public PeerMappingTest() {
|
||||
|
|
|
@ -53,7 +53,6 @@ public class AccountRepositoryTest {
|
|||
d.add(accountRepository.insertAccount(a1).subscribe());
|
||||
|
||||
Thread.sleep(100);
|
||||
a1.setId(1);
|
||||
|
||||
Account a2 = new IAccount();
|
||||
a2.setAddress("a2@example.com");
|
||||
|
|
|
@ -12,6 +12,7 @@ import org.mercury_im.messenger.xmpp.MercuryConnection;
|
|||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
@ -22,7 +23,7 @@ public class Messenger implements ClientStateListener {
|
|||
public static final String TAG = "MercuryIM";
|
||||
private static final Logger LOGGER = Logger.getLogger(Messenger.class.getName());
|
||||
|
||||
private final Map<Long, MercuryConnection> connections = new HashMap<>();
|
||||
private final Map<UUID, MercuryConnection> connections = new HashMap<>();
|
||||
private Repositories repositories;
|
||||
|
||||
@Inject
|
||||
|
|
|
@ -4,6 +4,7 @@ import org.mercury_im.messenger.entity.Account;
|
|||
import org.mercury_im.messenger.util.Optional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import io.reactivex.Completable;
|
||||
import io.reactivex.Maybe;
|
||||
|
@ -14,9 +15,9 @@ public interface AccountRepository {
|
|||
|
||||
Single<Account> insertAccount(Account account);
|
||||
|
||||
Observable<Optional<Account>> observeAccount(long accountId);
|
||||
Observable<Optional<Account>> observeAccount(UUID accountId);
|
||||
|
||||
Maybe<Account> getAccount(long accountId);
|
||||
Maybe<Account> getAccount(UUID accountId);
|
||||
|
||||
Observable<Optional<Account>> observeAccountByAddress(String address);
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import org.mercury_im.messenger.entity.chat.DirectChat;
|
|||
import org.mercury_im.messenger.entity.contact.Peer;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import io.reactivex.Completable;
|
||||
import io.reactivex.Maybe;
|
||||
|
@ -19,9 +20,9 @@ public interface DirectChatRepository {
|
|||
return observeDirectChat(chat.getId());
|
||||
}
|
||||
|
||||
Observable<Optional<DirectChat>> observeDirectChat(long chatId);
|
||||
Observable<Optional<DirectChat>> observeDirectChat(UUID chatId);
|
||||
|
||||
Maybe<DirectChat> getDirectChat(long chatId);
|
||||
Maybe<DirectChat> getDirectChat(UUID chatId);
|
||||
|
||||
Single<DirectChat> getOrCreateChatWithPeer(Peer peer);
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import org.mercury_im.messenger.entity.chat.GroupChat;
|
|||
import org.mercury_im.messenger.util.Optional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import io.reactivex.Completable;
|
||||
import io.reactivex.Maybe;
|
||||
|
@ -15,9 +16,9 @@ public interface GroupChatRepository {
|
|||
|
||||
Single<GroupChat> insertGroupChat(GroupChat chat);
|
||||
|
||||
Observable<Optional<GroupChat>> observeGroupChat(long chatId);
|
||||
Observable<Optional<GroupChat>> observeGroupChat(UUID chatId);
|
||||
|
||||
Maybe<GroupChat> getGroupChat(long chatId);
|
||||
Maybe<GroupChat> getGroupChat(UUID chatId);
|
||||
|
||||
Single<GroupChat> getOrCreateGroupChat(Account account, String roomAddress);
|
||||
|
||||
|
@ -25,13 +26,13 @@ public interface GroupChatRepository {
|
|||
return observeGroupChatByRoomAddress(account.getId(), roomAddress);
|
||||
}
|
||||
|
||||
Observable<Optional<GroupChat>> observeGroupChatByRoomAddress(long accountId, String roomAddress);
|
||||
Observable<Optional<GroupChat>> observeGroupChatByRoomAddress(UUID accountId, String roomAddress);
|
||||
|
||||
default Maybe<GroupChat> getGroupChatByRoomAddress(Account account, String roomAddress) {
|
||||
return getGroupChatByRoomAddress(account.getId(), roomAddress);
|
||||
}
|
||||
|
||||
Maybe<GroupChat> getGroupChatByRoomAddress(long accountId, String roomAddress);
|
||||
Maybe<GroupChat> getGroupChatByRoomAddress(UUID accountId, String roomAddress);
|
||||
|
||||
Observable<List<GroupChat>> observeAllGroupChats();
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import org.mercury_im.messenger.entity.Account;
|
|||
import org.mercury_im.messenger.entity.contact.Peer;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import io.reactivex.Completable;
|
||||
import io.reactivex.Maybe;
|
||||
|
@ -19,25 +20,25 @@ public interface PeerRepository {
|
|||
return observePeer(peer.getId());
|
||||
}
|
||||
|
||||
Observable<Optional<Peer>> observePeer(long PeerId);
|
||||
Observable<Optional<Peer>> observePeer(UUID PeerId);
|
||||
|
||||
Maybe<Peer> getPeer(long PeerId);
|
||||
Maybe<Peer> getPeer(UUID PeerId);
|
||||
|
||||
default Observable<Optional<Peer>> observePeerByAddress(Account account, String address) {
|
||||
return observePeerByAddress(account.getId(), address);
|
||||
}
|
||||
|
||||
Observable<Optional<Peer>> observePeerByAddress(long accountId, String address);
|
||||
Observable<Optional<Peer>> observePeerByAddress(UUID accountId, String address);
|
||||
|
||||
default Maybe<Peer> getPeerByAddress(Account account, String address) {
|
||||
return getPeerByAddress(account.getId(), address);
|
||||
}
|
||||
|
||||
Maybe<Peer> getPeerByAddress(long accountId, String address);
|
||||
Maybe<Peer> getPeerByAddress(UUID accountId, String address);
|
||||
|
||||
Single<Peer> getOrCreatePeer(Account account, String address);
|
||||
|
||||
Single<Peer> getOrCreatePeer(long accountId, String address);
|
||||
Single<Peer> getOrCreatePeer(UUID accountId, String address);
|
||||
|
||||
Observable<List<Peer>> observeAllPeers();
|
||||
|
||||
|
@ -45,7 +46,7 @@ public interface PeerRepository {
|
|||
return observeAllContactsOfAccount(account.getId());
|
||||
}
|
||||
|
||||
Observable<List<Peer>> observeAllContactsOfAccount(long accountId);
|
||||
Observable<List<Peer>> observeAllContactsOfAccount(UUID accountId);
|
||||
|
||||
Single<Peer> updatePeer(Peer Peer);
|
||||
|
||||
|
@ -53,5 +54,5 @@ public interface PeerRepository {
|
|||
|
||||
Completable deletePeer(Peer Peer);
|
||||
|
||||
Completable deletePeer(long accountId, String address);
|
||||
Completable deletePeer(UUID accountId, String address);
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ public class MercuryRosterStore implements RosterStore {
|
|||
this.account = account;
|
||||
this.peerRepository = rosterRepository;
|
||||
this.accountRepository = accountRepository;
|
||||
LOGGER.log(Level.INFO, "Construct Roster Store for " + account.getId());
|
||||
}
|
||||
|
||||
public void subscribe() {
|
||||
|
@ -93,6 +94,10 @@ public class MercuryRosterStore implements RosterStore {
|
|||
// Update database
|
||||
Peer contact = toEntity(item);
|
||||
disposable.add(peerRepository.upsertPeer(contact)
|
||||
.map(p -> {
|
||||
LOGGER.log(Level.INFO, "Unserted Peer for account " + p.getAccount().getId());
|
||||
return p;
|
||||
})
|
||||
.subscribe(
|
||||
success -> LOGGER.log(Level.FINE, "Upserted contact model " + success + " successfully"),
|
||||
error -> LOGGER.log(Level.WARNING, "An error occurred upserting contact " + contact, error)
|
||||
|
@ -116,6 +121,10 @@ public class MercuryRosterStore implements RosterStore {
|
|||
for (RosterPacket.Item item : items) {
|
||||
Peer model = toEntity(item);
|
||||
disposable.add(peerRepository.upsertPeer(model)
|
||||
.map(p -> {
|
||||
LOGGER.log(Level.INFO, "Unserted Peer for account " + p.getAccount().getId());
|
||||
return p;
|
||||
})
|
||||
.subscribe(
|
||||
success -> LOGGER.log(Level.FINE, "Upserted contact model " + success + " successfully"),
|
||||
error -> LOGGER.log(Level.WARNING, "An error occurred upserting contact " + model, error)
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.mercury_im.messenger.entity;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* User Account entity.
|
||||
*
|
||||
|
@ -7,9 +9,9 @@ package org.mercury_im.messenger.entity;
|
|||
*/
|
||||
public interface Account {
|
||||
|
||||
void setId(long id);
|
||||
void setId(UUID id);
|
||||
|
||||
long getId();
|
||||
UUID getId();
|
||||
|
||||
void setAddress(String address);
|
||||
|
||||
|
|
|
@ -1,22 +1,27 @@
|
|||
package org.mercury_im.messenger.entity;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class IAccount implements Account {
|
||||
|
||||
protected long id;
|
||||
protected UUID id;
|
||||
protected String address;
|
||||
protected String password;
|
||||
protected String host;
|
||||
protected int port;
|
||||
protected boolean enabled;
|
||||
|
||||
@Override
|
||||
public void setId(long id) {
|
||||
public IAccount() {
|
||||
this.id = UUID.randomUUID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getId() {
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@ package org.mercury_im.messenger.entity.chat;
|
|||
|
||||
import org.mercury_im.messenger.entity.Account;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Generic interface defining shared properties of chats.
|
||||
*
|
||||
|
@ -9,9 +11,9 @@ import org.mercury_im.messenger.entity.Account;
|
|||
*/
|
||||
public interface Chat {
|
||||
|
||||
long getId();
|
||||
UUID getId();
|
||||
|
||||
void setId(long id);
|
||||
void setId(UUID id);
|
||||
|
||||
Account getAccount();
|
||||
|
||||
|
|
|
@ -3,13 +3,19 @@ package org.mercury_im.messenger.entity.chat;
|
|||
import org.mercury_im.messenger.entity.Account;
|
||||
import org.mercury_im.messenger.entity.contact.Peer;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class IDirectChat implements DirectChat {
|
||||
|
||||
protected long id;
|
||||
protected UUID id;
|
||||
protected Peer peer;
|
||||
protected Account account;
|
||||
protected ChatPreferences preferences;
|
||||
|
||||
public IDirectChat() {
|
||||
this.id = UUID.randomUUID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Peer getPeer() {
|
||||
return peer;
|
||||
|
@ -21,12 +27,12 @@ public class IDirectChat implements DirectChat {
|
|||
}
|
||||
|
||||
@Override
|
||||
public long getId() {
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(long id) {
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,16 +4,21 @@ import org.mercury_im.messenger.entity.Account;
|
|||
import org.mercury_im.messenger.entity.contact.Peer;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public class IGroupChat implements GroupChat {
|
||||
|
||||
private long id;
|
||||
private UUID id;
|
||||
private Account account;
|
||||
private String roomAddress;
|
||||
private String roomName;
|
||||
protected ChatPreferences preferences;
|
||||
protected Set<Peer> participants;
|
||||
|
||||
public IGroupChat() {
|
||||
this.id = UUID.randomUUID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Peer> getParticipants() {
|
||||
return participants;
|
||||
|
@ -45,12 +50,12 @@ public class IGroupChat implements GroupChat {
|
|||
}
|
||||
|
||||
@Override
|
||||
public long getId() {
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(long id) {
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,9 +2,11 @@ package org.mercury_im.messenger.entity.contact;
|
|||
|
||||
import org.mercury_im.messenger.entity.Account;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class IPeer implements Peer {
|
||||
|
||||
protected long id;
|
||||
protected UUID id;
|
||||
protected Account account;
|
||||
protected String address;
|
||||
protected String name;
|
||||
|
@ -12,13 +14,17 @@ public class IPeer implements Peer {
|
|||
protected boolean pending;
|
||||
protected boolean approved;
|
||||
|
||||
public IPeer() {
|
||||
this.id = UUID.randomUUID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getId() {
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(long id) {
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@ package org.mercury_im.messenger.entity.contact;
|
|||
|
||||
import org.mercury_im.messenger.entity.Account;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Defines a user on the network (eg. a contact, chat partner, group chat member etc).
|
||||
* Basically anyone that may send you a message is a Peer.
|
||||
|
@ -10,9 +12,9 @@ import org.mercury_im.messenger.entity.Account;
|
|||
*/
|
||||
public interface Peer {
|
||||
|
||||
long getId();
|
||||
UUID getId();
|
||||
|
||||
void setId(long id);
|
||||
void setId(UUID id);
|
||||
|
||||
Account getAccount();
|
||||
|
||||
|
|
|
@ -2,10 +2,11 @@ package org.mercury_im.messenger.entity.message;
|
|||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public class IMessage implements Message {
|
||||
|
||||
protected long id;
|
||||
protected UUID id;
|
||||
protected String sender;
|
||||
protected String recipient;
|
||||
protected Date timestamp;
|
||||
|
@ -16,12 +17,12 @@ public class IMessage implements Message {
|
|||
|
||||
|
||||
@Override
|
||||
public long getId() {
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(long id) {
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,12 +2,13 @@ package org.mercury_im.messenger.entity.message;
|
|||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface Message {
|
||||
|
||||
long getId();
|
||||
UUID getId();
|
||||
|
||||
void setId(long id);
|
||||
void setId(UUID id);
|
||||
|
||||
String getSender();
|
||||
|
||||
|
|
Loading…
Reference in New Issue