mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: KmsManager#generateKmsId
parent
d1aa03354e
commit
668c879462
|
@ -61,8 +61,7 @@ public class FixedOneKmsManager extends KmsManager {
|
||||||
try {
|
try {
|
||||||
List<KmsProperties> kmsProps = new ArrayList<>();
|
List<KmsProperties> kmsProps = new ArrayList<>();
|
||||||
for (String kmsUri : this.openviduConfig.getKmsUris()) {
|
for (String kmsUri : this.openviduConfig.getKmsUris()) {
|
||||||
String kmsId = IdentifierPrefixes.KMS_ID + RandomStringUtils.randomAlphabetic(1).toUpperCase()
|
String kmsId = KmsManager.generateKmsId();
|
||||||
+ RandomStringUtils.randomAlphanumeric(7);
|
|
||||||
kmsProps.add(new KmsProperties(kmsId, kmsUri));
|
kmsProps.add(new KmsProperties(kmsId, kmsUri));
|
||||||
}
|
}
|
||||||
this.initializeKurentoClients(kmsProps, true);
|
this.initializeKurentoClients(kmsProps, true);
|
||||||
|
|
|
@ -34,6 +34,7 @@ import java.util.stream.Collectors;
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import javax.annotation.PreDestroy;
|
import javax.annotation.PreDestroy;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.RandomStringUtils;
|
||||||
import org.kurento.client.KurentoConnectionListener;
|
import org.kurento.client.KurentoConnectionListener;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -42,6 +43,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
import io.openvidu.server.config.OpenviduConfig;
|
import io.openvidu.server.config.OpenviduConfig;
|
||||||
|
import io.openvidu.server.core.IdentifierPrefixes;
|
||||||
import io.openvidu.server.utils.MediaNodeStatusManager;
|
import io.openvidu.server.utils.MediaNodeStatusManager;
|
||||||
|
|
||||||
public abstract class KmsManager {
|
public abstract class KmsManager {
|
||||||
|
@ -309,4 +311,9 @@ public abstract class KmsManager {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String generateKmsId() {
|
||||||
|
return IdentifierPrefixes.KMS_ID + RandomStringUtils.randomAlphabetic(1).toUpperCase()
|
||||||
|
+ RandomStringUtils.randomAlphanumeric(7);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue