diff --git a/README.md b/README.md
index db29bd6..a85ca06 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
-# BlacklistStreams
-The **BlacklistStreams** server listener and HTTP Provider for [Wowza Streaming Engine™ media server software](https://www.wowza.com/products/streaming-engine) enables you to persistently blacklist streams published to your Wowza media server.
+# BlocklistStreams
+The **BlocklistStreams** server listener and HTTP Provider for [Wowza Streaming Engine™ media server software](https://www.wowza.com/products/streaming-engine) enables you to persistently blocklist streams published to your Wowza media server.
This repo includes a [compiled version](/lib/wse-plugin-blackliststreams.jar).
@@ -7,22 +7,22 @@ This repo includes a [compiled version](/lib/wse-plugin-blackliststreams.jar).
Wowza Streaming Engine 4.0.0 or later is required.
## Usage
-**BlacklistStreams** provides the following functionality:
+**BlocklistStreams** provides the following functionality:
-* Blacklist stream names using an HTTP Provider (allows selection of streams to blacklist).
-* Contents of blacklist persist through each Wowza Streaming Engine media server reboot.
-* Allows previously blacklisted stream names to be whitelisted again.
-* Supports blacklisting of both RTMP and RTSP sources.
+* Blocklist stream names using an HTTP Provider (allows selection of streams to blocklist).
+* Contents of blocklist persist through each Wowza Streaming Engine media server reboot.
+* Allows previously blocklisted stream names to be whitelisted again.
+* Supports blocklisting of both RTMP and RTSP sources.
-To blacklist a stream:
+To blocklist a stream:
-1. Start your Wowza Streaming Engine media server, and then open the following URL to the Stream Blacklists page in a web browser:
http://[wowza-ip-address]:8086/blacklist
+1. Start your Wowza Streaming Engine media server, and then open the following URL to the Stream Blocklists page in a web browser: http://[wowza-ip-address]:8086/blocklist
2. When prompted, enter the credentials that you use to sign in to Wowza Streaming Engine Manager.
-3. Publish your first stream, and then in the **Stream Blacklists** page, click **Check for new streams**. Your new stream will be displayed in the **Published Streams** list.
+3. Publish your first stream, and then in the **Stream Blocklists** page, click **Check for new streams**. Your new stream will be displayed in the **Published Streams** list.
-4. Click the **Blacklist** link next to the published stream to add that stream to the blacklist. This will also stop the stream. Any subsequent attempts to publish to that [app-name]/[app-instance]/[stream-name] sequence are rejected until you remove the stream from the blacklist.
+4. Click the **Blocklist** link next to the published stream to add that stream to the blocklist. This will also stop the stream. Any subsequent attempts to publish to that [app-name]/[app-instance]/[stream-name] sequence are rejected until you remove the stream from the blocklist.
## More resources
To use the compiled version of this module, see [Blacklist a stream in session with a Wowza Streaming Engine server listener and HTTP provider](https://www.wowza.com/docs/how-to-blacklist-a-stream-in-session-blackliststreams).
diff --git a/lib/wse-plugin-blackliststreams.jar b/lib/wse-plugin-blackliststreams.jar
index 596b84e..481e634 100644
Binary files a/lib/wse-plugin-blackliststreams.jar and b/lib/wse-plugin-blackliststreams.jar differ
diff --git a/src/com/wowza/wms/plugin/blocklist/.DS_Store b/src/com/wowza/wms/plugin/blocklist/.DS_Store
new file mode 100644
index 0000000..40f3d30
Binary files /dev/null and b/src/com/wowza/wms/plugin/blocklist/.DS_Store differ
diff --git a/src/com/wowza/wms/plugin/blacklist/BlackListUtils.java b/src/com/wowza/wms/plugin/blocklist/BlockListUtils.java
similarity index 51%
rename from src/com/wowza/wms/plugin/blacklist/BlackListUtils.java
rename to src/com/wowza/wms/plugin/blocklist/BlockListUtils.java
index 56bbb8e..bb7cb74 100644
--- a/src/com/wowza/wms/plugin/blacklist/BlackListUtils.java
+++ b/src/com/wowza/wms/plugin/blocklist/BlockListUtils.java
@@ -2,7 +2,7 @@
* This code and all components (c) Copyright 2006 - 2018, Wowza Media Systems, LLC. All rights reserved.
* This code is licensed pursuant to the Wowza Public License version 1.0, available at www.wowza.com/legal.
*/
-package com.wowza.wms.plugin.blacklist;
+package com.wowza.wms.plugin.blocklist;
import java.io.BufferedReader;
import java.io.File;
@@ -16,114 +16,114 @@
import com.wowza.wms.logging.WMSLogger;
import com.wowza.wms.logging.WMSLoggerFactory;
-public class BlackListUtils
+public class BlockListUtils
{
- private static ArrayList streamBlackList = new ArrayList();
- private static String blacklistConfigPath = Bootstrap.getServerHome(Bootstrap.CONFIGHOME) + "/conf/blacklist.txt";
+ private static ArrayList streamblockList = new ArrayList();
+ private static String blocklistConfigPath = Bootstrap.getServerHome(Bootstrap.CONFIGHOME) + "/conf/blocklist.txt";
static String separatorChar = ":";
- private static WMSLogger logger = WMSLoggerFactory.getLogger(BlackListUtils.class);
+ private static WMSLogger logger = WMSLoggerFactory.getLogger(BlockListUtils.class);
public static void setConfigPath(String config)
{
- BlackListUtils.blacklistConfigPath = config;
+ BlockListUtils.blocklistConfigPath = config;
}
public static void setSeparatorChar(String separatorChar)
{
- BlackListUtils.separatorChar = separatorChar;
+ BlockListUtils.separatorChar = separatorChar;
}
- public static void blackListStream(String application, String appInstance, String streamName)
+ public static void blockListStream(String application, String appInstance, String streamName)
{
- BlackListUtils.mergeData();
+ BlockListUtils.mergeData();
- synchronized(BlackListUtils.streamBlackList)
+ synchronized(BlockListUtils.streamblockList)
{
String streamKey = application + separatorChar + appInstance + separatorChar + streamName;
- if (!BlackListUtils.streamBlackList.contains(streamKey))
+ if (!BlockListUtils.streamblockList.contains(streamKey))
{
- BlackListUtils.streamBlackList.add(streamKey);
- BlackListUtils.printContents();
- BlackListUtils.saveFile();
+ BlockListUtils.streamblockList.add(streamKey);
+ BlockListUtils.printContents();
+ BlockListUtils.saveFile();
}
}
}
public static void removeStreamFromList(String application, String appInstance, String streamName)
{
- BlackListUtils.mergeData();
+ BlockListUtils.mergeData();
String streamKey = application + separatorChar + appInstance + separatorChar + streamName;
- if (ServerListenerBlacklistStreams.debug)
- logger.info(ServerListenerBlacklistStreams.MODULE_NAME + ".removeStreamFromList[" + streamKey + "] Stream is initiated ");
+ if (ServerListenerBlocklistStreams.debug)
+ logger.info(ServerListenerBlocklistStreams.MODULE_NAME + ".removeStreamFromList[" + streamKey + "] Stream is initiated ");
- synchronized(BlackListUtils.streamBlackList)
+ synchronized(BlockListUtils.streamblockList)
{
- if (BlackListUtils.streamBlackList.contains(streamKey))
+ if (BlockListUtils.streamblockList.contains(streamKey))
{
- if (BlackListUtils.streamBlackList.remove(streamKey))
+ if (BlockListUtils.streamblockList.remove(streamKey))
{
- BlackListUtils.saveFile();
- BlackListUtils.printContents();
+ BlockListUtils.saveFile();
+ BlockListUtils.printContents();
- logger.info(ServerListenerBlacklistStreams.MODULE_NAME + ".removeStreamFromList[" + streamKey + "] Completed ");
+ logger.info(ServerListenerBlocklistStreams.MODULE_NAME + ".removeStreamFromList[" + streamKey + "] Completed ");
}
else
{
- logger.info(ServerListenerBlacklistStreams.MODULE_NAME + ".removeStreamFromList[" + streamKey + "] Does not exist-2 ");
+ logger.info(ServerListenerBlocklistStreams.MODULE_NAME + ".removeStreamFromList[" + streamKey + "] Does not exist-2 ");
}
}
else
{
- logger.info(ServerListenerBlacklistStreams.MODULE_NAME + ".removeStreamFromList[" + streamKey + "] Does not exist ");
+ logger.info(ServerListenerBlocklistStreams.MODULE_NAME + ".removeStreamFromList[" + streamKey + "] Does not exist ");
}
}
}
- public static boolean isStreamBlackListed(String application, String appInstance, String streamName)
+ public static boolean isStreamblockListed(String application, String appInstance, String streamName)
{
- BlackListUtils.mergeData();
+ BlockListUtils.mergeData();
String streamKey = application + separatorChar + appInstance + separatorChar + streamName;
- return BlackListUtils.streamBlackList.contains(streamKey);
+ return BlockListUtils.streamblockList.contains(streamKey);
}
- public static ArrayList getBlackListedStreams()
+ public static ArrayList getblockListedStreams()
{
- BlackListUtils.mergeData();
- synchronized(BlackListUtils.streamBlackList)
+ BlockListUtils.mergeData();
+ synchronized(BlockListUtils.streamblockList)
{
- return BlackListUtils.streamBlackList;
+ return BlockListUtils.streamblockList;
}
}
public static void mergeData()
{
- synchronized(BlackListUtils.streamBlackList)
+ synchronized(BlockListUtils.streamblockList)
{
- ArrayList fileStored = BlackListUtils.getStoredBlacklistItems();
+ ArrayList fileStored = BlockListUtils.getStoredblocklistItems();
if (fileStored.size() > 0)
{
for (int i = 0; i < fileStored.size(); i++)
{
- if (!BlackListUtils.streamBlackList.contains(fileStored.get(i)))
+ if (!BlockListUtils.streamblockList.contains(fileStored.get(i)))
{
- BlackListUtils.streamBlackList.add(fileStored.get(i));
+ BlockListUtils.streamblockList.add(fileStored.get(i));
}
}
}
}
}
- private static ArrayList getStoredBlacklistItems()
+ private static ArrayList getStoredblocklistItems()
{
- ArrayList blackList = new ArrayList();
- File tmpFile = new File(BlackListUtils.blacklistConfigPath);
+ ArrayList blockList = new ArrayList();
+ File tmpFile = new File(BlockListUtils.blocklistConfigPath);
if (tmpFile.exists())
{
FileInputStream in = null;
BufferedReader br = null;
try
{
- in = new FileInputStream(BlackListUtils.blacklistConfigPath);
+ in = new FileInputStream(BlockListUtils.blocklistConfigPath);
br = new BufferedReader(new InputStreamReader(in));
String cacheItem;
@@ -132,13 +132,13 @@ private static ArrayList getStoredBlacklistItems()
cacheItem = cacheItem.trim();
if (!cacheItem.startsWith("#") && cacheItem.length() > 0)
{
- blackList.add(cacheItem);
+ blockList.add(cacheItem);
}
}
}
catch (Exception e)
{
- logger.error(ServerListenerBlacklistStreams.MODULE_NAME + ".getStoredBlacklistItems() ", e);
+ logger.error(ServerListenerBlocklistStreams.MODULE_NAME + ".getStoredblocklistItems() ", e);
}
finally
{
@@ -164,29 +164,29 @@ private static ArrayList getStoredBlacklistItems()
}
else
{
- logger.info(ServerListenerBlacklistStreams.MODULE_NAME + ".getStoredBlacklistItems could not find black list items list");
+ logger.info(ServerListenerBlocklistStreams.MODULE_NAME + ".getStoredblocklistItems could not find block list items list");
}
- return blackList;
+ return blockList;
}
private static void saveFile()
{
- synchronized(BlackListUtils.streamBlackList)
+ synchronized(BlockListUtils.streamblockList)
{
- ArrayList bli = BlackListUtils.streamBlackList;
+ ArrayList bli = BlockListUtils.streamblockList;
try
{
- File f = new File(blacklistConfigPath);
+ File f = new File(blocklistConfigPath);
if (!f.exists())
{
f.createNewFile();
}
- FileWriter tmpFile = new FileWriter(blacklistConfigPath, false);
+ FileWriter tmpFile = new FileWriter(blocklistConfigPath, false);
StringBuilder b = new StringBuilder();
for (int i = 0; i < bli.size(); i++)
{
- logger.info(ServerListenerBlacklistStreams.MODULE_NAME + ".saveFile " + "Line: " + bli.get(i));
+ logger.info(ServerListenerBlocklistStreams.MODULE_NAME + ".saveFile " + "Line: " + bli.get(i));
b.append(bli.get(i) + "\n");
}
tmpFile.write(b.toString());
@@ -194,17 +194,17 @@ private static void saveFile()
}
catch (IOException ioe)
{
- logger.error(ServerListenerBlacklistStreams.MODULE_NAME + ".saveFile " + "IOException: " + ioe.getMessage(), ioe);
+ logger.error(ServerListenerBlocklistStreams.MODULE_NAME + ".saveFile " + "IOException: " + ioe.getMessage(), ioe);
}
}
}
private static void printContents()
{
- ArrayList bli = BlackListUtils.getBlackListedStreams();
+ ArrayList bli = BlockListUtils.getblockListedStreams();
for (int i = 0; i < bli.size(); i++)
{
- logger.info(ServerListenerBlacklistStreams.MODULE_NAME + ".printContents " + "bli.get(i): " + bli.get(i));
+ logger.info(ServerListenerBlocklistStreams.MODULE_NAME + ".printContents " + "bli.get(i): " + bli.get(i));
}
}
diff --git a/src/com/wowza/wms/plugin/blacklist/HTTPProviderBlacklistStreams.java b/src/com/wowza/wms/plugin/blocklist/HTTPProviderBlocklistStreams.java
similarity index 84%
rename from src/com/wowza/wms/plugin/blacklist/HTTPProviderBlacklistStreams.java
rename to src/com/wowza/wms/plugin/blocklist/HTTPProviderBlocklistStreams.java
index f5a5833..130aa95 100644
--- a/src/com/wowza/wms/plugin/blacklist/HTTPProviderBlacklistStreams.java
+++ b/src/com/wowza/wms/plugin/blocklist/HTTPProviderBlocklistStreams.java
@@ -2,7 +2,7 @@
* This code and all components (c) Copyright 2006 - 2018, Wowza Media Systems, LLC. All rights reserved.
* This code is licensed pursuant to the Wowza Public License version 1.0, available at www.wowza.com/legal.
*/
-package com.wowza.wms.plugin.blacklist;
+package com.wowza.wms.plugin.blocklist;
import java.io.OutputStream;
import java.util.ArrayList;
@@ -29,9 +29,9 @@
import com.wowza.wms.stream.IMediaStream;
import com.wowza.wms.vhost.IVHost;
-public class HTTPProviderBlacklistStreams extends HTTProvider2Base
+public class HTTPProviderBlocklistStreams extends HTTProvider2Base
{
- public static final String MODULE_NAME = "HTTPProviderBlacklistStreams";
+ public static final String MODULE_NAME = "HTTPProviderblocklistStreams";
private WMSLogger logger = WMSLoggerFactory.getLogger(getClass());
@@ -44,8 +44,8 @@ public void onHTTPRequest(IVHost vhost, IHTTPRequest req, IHTTPResponse resp)
String html = "";
- // get blacklisted streams
- html += this.getBlackListedStreams();
+ // get blocklisted streams
+ html += this.getblockListedStreams();
// get published streams
html += this.getPublishedStreams(vhost);
@@ -78,18 +78,18 @@ private String getRefresh()
return html;
}
- private String getBlackListedStreams()
+ private String getblockListedStreams()
{
String html = "";
- ArrayList streams = BlackListUtils.getBlackListedStreams();
+ ArrayList streams = BlockListUtils.getblockListedStreams();
if (streams.size() > 0)
{
- html += this.divHeader("Blacklisted") + this.divSectionStart();
+ html += this.divHeader("blocklisted") + this.divSectionStart();
html += "";
for (int i = 0; i < streams.size(); i++)
{
- String[] parts = streams.get(i).split(BlackListUtils.separatorChar);
+ String[] parts = streams.get(i).split(BlockListUtils.separatorChar);
if (parts.length == 3)
{
String applicationName = parts[0];
@@ -152,7 +152,7 @@ private String getPublishedStreams(IVHost vhost)
}
for (String name : names)
{
- if (!BlackListUtils.isStreamBlackListed(applicationName, appInstanceName, name))
+ if (!BlockListUtils.isStreamblockListed(applicationName, appInstanceName, name))
{
html += this.addRow(applicationName, appInstanceName, name);
}
@@ -171,7 +171,7 @@ private String getPublishedStreams(IVHost vhost)
return html;
}
- private boolean blacklistStream(IVHost vhost, String applicationName, String appInstanceName, String streamName)
+ private boolean blocklistStream(IVHost vhost, String applicationName, String appInstanceName, String streamName)
{
try
{
@@ -202,7 +202,7 @@ private boolean blacklistStream(IVHost vhost, String applicationName, String app
}
catch (Exception e)
{
- logger.error(MODULE_NAME + ".blacklistStream()", e);
+ logger.error(MODULE_NAME + ".blocklistStream()", e);
}
}
@@ -244,7 +244,7 @@ private boolean blacklistStream(IVHost vhost, String applicationName, String app
}
catch (Exception e)
{
- logger.error(MODULE_NAME + ".blacklistStream()", e);
+ logger.error(MODULE_NAME + ".blocklistStream()", e);
}
}
@@ -266,7 +266,7 @@ private boolean blacklistStream(IVHost vhost, String applicationName, String app
}
catch (Exception e)
{
- logger.error(MODULE_NAME + ".blacklistStream()", e);
+ logger.error(MODULE_NAME + ".blocklistStream()", e);
}
}
}
@@ -293,7 +293,7 @@ private boolean blacklistStream(IVHost vhost, String applicationName, String app
}
catch (Exception ex)
{
- logger.error(MODULE_NAME + ".blacklistStream()", ex);
+ logger.error(MODULE_NAME + ".blocklistStream()", ex);
}
return false;
}
@@ -307,23 +307,23 @@ private String handlePost(IHTTPRequest req, IVHost vhost)
Map> params = req.getParameterMap();
System.out.println(params.toString());
- if (params.containsKey("blacklist"))
+ if (params.containsKey("blocklist"))
{
String appPath = params.get("application").get(0) + "/" + params.get("appInstance").get(0) + "/" + params.get("stream").get(0);
- if (params.get("blacklist").get(0).equalsIgnoreCase("1"))
+ if (params.get("blocklist").get(0).equalsIgnoreCase("1"))
{
- BlackListUtils.blackListStream(params.get("application").get(0), params.get("appInstance").get(0), params.get("stream").get(0));
- if (this.blacklistStream(vhost, params.get("application").get(0), params.get("appInstance").get(0), params.get("stream").get(0)))
+ BlockListUtils.blockListStream(params.get("application").get(0), params.get("appInstance").get(0), params.get("stream").get(0));
+ if (this.blocklistStream(vhost, params.get("application").get(0), params.get("appInstance").get(0), params.get("stream").get(0)))
{
-// BlackListed.removeStreamFromList(params.get("application").get(0), params.get("appInstance").get(0), params.get("stream").get(0));
- return appPath + " has been added to the blacklist";
+// blockListed.removeStreamFromList(params.get("application").get(0), params.get("appInstance").get(0), params.get("stream").get(0));
+ return appPath + " has been added to the blocklist";
}
- return appPath + " failed to add to blacklist.";
+ return appPath + " failed to add to blocklist.";
}
else
{
- BlackListUtils.removeStreamFromList(params.get("application").get(0), params.get("appInstance").get(0), params.get("stream").get(0));
- return appPath + " has been removed from the blacklist";
+ BlockListUtils.removeStreamFromList(params.get("application").get(0), params.get("appInstance").get(0), params.get("stream").get(0));
+ return appPath + " has been removed from the blocklist";
}
}
return null;
@@ -362,10 +362,10 @@ private String getMsgHeader(String msg, IHTTPRequest req)
private String getHtmlPage(String body, String msg)
{
- return "\n" + "\n" + "Blacklist Streams\n" + "\n" + " \n" + " \nStream Blacklists
" + " " + " " + msg + " " + body + " "
- + "