Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let one application uses one DB in Mongodb #4252

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public List<User> getUserList(){
List<User> users = new ArrayList<>();
try {
users = datastore.find(User.class).iterator().toList();

}
catch (Exception e) {
logger.error(ExceptionUtils.getStackTrace(e));
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/io/antmedia/datastore/db/DataStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,10 @@ public List<SubscriberStats> listAllSubscriberStats(String streamId, int offset,

/**
* adds subscriber to the datastore for this stream
* @param streamId
* @param subscriber - subscriber to be added
* @return- true if set, false if not
*/
public abstract boolean addSubscriber(String streamId, Subscriber subscriber);
public abstract boolean addSubscriber(Subscriber subscriber);

/**
* deletes subscriber from the datastore for this stream
Expand Down Expand Up @@ -289,7 +288,7 @@ public boolean addSubscriberConnectionEvent(String streamId, String subscriberId
if (subscriber != null) {
handleConnectionEvent(subscriber, event);

addSubscriber(streamId, subscriber);
addSubscriber(subscriber);
result = true;
}

Expand Down Expand Up @@ -320,7 +319,7 @@ public boolean updateSubscriberBitrateEvent(String streamId, String subscriberId
if (subscriber != null) {
subscriber.getStats().setAvgVideoBitrate(avgVideoBitrate);
subscriber.getStats().setAvgAudioBitrate(avgAudioBitrate);
addSubscriber(streamId, subscriber);
addSubscriber(subscriber);
result = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ public List<Subscriber> listAllSubscribers(String streamId, int offset, int size
}

@Override
public boolean addSubscriber(String streamId, Subscriber subscriber) {
public boolean addSubscriber(Subscriber subscriber) {
boolean result = false;

if (subscriber != null && subscriber.getStreamId() != null && subscriber.getSubscriberId() != null) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/antmedia/datastore/db/MapDBStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ public List<Subscriber> listAllSubscribers(String streamId, int offset, int size
}

@Override
public boolean addSubscriber(String streamId, Subscriber subscriber) {
public boolean addSubscriber(Subscriber subscriber) {
boolean result = false;

if (subscriber != null) {
Expand Down
Loading