Package tigase.mongodb.muc
Class MongoMucDAO
java.lang.Object
tigase.muc.repository.AbstractMucDAO<MongoDataSource,byte[]>
tigase.mongodb.muc.MongoMucDAO
- All Implemented Interfaces:
tigase.db.DataSourceAware<MongoDataSource>,tigase.muc.repository.IMucDAO<MongoDataSource,byte[]>
Created by andrzej on 20.10.2016.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.mongodb.client.MongoCollection<org.bson.Document>protected com.mongodb.client.MongoCollection<org.bson.Document> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]calculateHash(String user) byte[]createRoom(tigase.muc.RoomWithId<byte[]> room) voiddestroyRoom(tigase.xmpp.jid.BareJID roomJID) protected byte[]generateId(tigase.xmpp.jid.BareJID user) Map<tigase.xmpp.jid.BareJID,tigase.muc.RoomAffiliation> getAffiliations(tigase.muc.RoomWithId<byte[]> room) tigase.muc.RoomWithId<byte[]>getRoom(tigase.xmpp.jid.BareJID roomJID) getRoomAvatar(tigase.muc.RoomWithId<byte[]> room) ArrayList<tigase.xmpp.jid.BareJID>voidsetAffiliation(tigase.muc.RoomWithId<byte[]> room, tigase.xmpp.jid.BareJID jid, tigase.muc.RoomAffiliation affiliation) voidsetDataSource(MongoDataSource dataSource) voidsetSubject(tigase.muc.RoomWithId<byte[]> room, String subject, String creatorNickname, Date changeDate) voidupdateRoomAvatar(tigase.muc.RoomWithId<byte[]> room, String encodedAvatar, String hash) voidupdateRoomConfig(tigase.muc.RoomConfig roomConfig) Methods inherited from class tigase.muc.repository.AbstractMucDAO
parseConfigElement
-
Field Details
-
roomAffilaitionsCollection
protected com.mongodb.client.MongoCollection<org.bson.Document> roomAffilaitionsCollection -
roomsCollection
protected com.mongodb.client.MongoCollection<org.bson.Document> roomsCollection
-
-
Constructor Details
-
MongoMucDAO
public MongoMucDAO()
-
-
Method Details
-
calculateHash
- Throws:
tigase.db.TigaseDBException
-
createRoom
public byte[] createRoom(tigase.muc.RoomWithId<byte[]> room) throws tigase.component.exceptions.RepositoryException - Throws:
tigase.component.exceptions.RepositoryException
-
destroyRoom
public void destroyRoom(tigase.xmpp.jid.BareJID roomJID) throws tigase.component.exceptions.RepositoryException - Throws:
tigase.component.exceptions.RepositoryException
-
generateId
protected byte[] generateId(tigase.xmpp.jid.BareJID user) throws tigase.db.TigaseDBException - Throws:
tigase.db.TigaseDBException
-
getAffiliations
public Map<tigase.xmpp.jid.BareJID,tigase.muc.RoomAffiliation> getAffiliations(tigase.muc.RoomWithId<byte[]> room) throws tigase.component.exceptions.RepositoryException - Throws:
tigase.component.exceptions.RepositoryException
-
getRoom
public tigase.muc.RoomWithId<byte[]> getRoom(tigase.xmpp.jid.BareJID roomJID) throws tigase.component.exceptions.RepositoryException - Throws:
tigase.component.exceptions.RepositoryException
-
getRoomsJIDList
public ArrayList<tigase.xmpp.jid.BareJID> getRoomsJIDList() throws tigase.component.exceptions.RepositoryException- Throws:
tigase.component.exceptions.RepositoryException
-
setAffiliation
public void setAffiliation(tigase.muc.RoomWithId<byte[]> room, tigase.xmpp.jid.BareJID jid, tigase.muc.RoomAffiliation affiliation) throws tigase.component.exceptions.RepositoryException - Throws:
tigase.component.exceptions.RepositoryException
-
setDataSource
-
getRoomAvatar
public String getRoomAvatar(tigase.muc.RoomWithId<byte[]> room) throws tigase.component.exceptions.RepositoryException - Throws:
tigase.component.exceptions.RepositoryException
-
updateRoomAvatar
public void updateRoomAvatar(tigase.muc.RoomWithId<byte[]> room, String encodedAvatar, String hash) throws tigase.component.exceptions.RepositoryException - Throws:
tigase.component.exceptions.RepositoryException
-
setSubject
public void setSubject(tigase.muc.RoomWithId<byte[]> room, String subject, String creatorNickname, Date changeDate) throws tigase.component.exceptions.RepositoryException - Throws:
tigase.component.exceptions.RepositoryException
-
updateRoomConfig
public void updateRoomConfig(tigase.muc.RoomConfig roomConfig) throws tigase.component.exceptions.RepositoryException - Throws:
tigase.component.exceptions.RepositoryException
-