I'm looking to extend the server and having two types of user authentication in the same application.
Code:public abstract class Authentication extends ModuleBase { public final void onAppStart(IApplicationInstance appInstance) { try { DatabaseConnection.getInstance().getConnection().close(); } catch (Exception e) { getLogger().fatal("Unable to create Database Pool " + e.toString()); } } public abstract void onConnect(IClient client, RequestFunction function, AMFDataList params); } public class HostAuthentication extends Authentication { public void onConnect(IClient client, RequestFunction function, AMFDataList params) { //Concrete implementation to ensure host is valid and able to stream } } public class ViewerAuthentication extends Authentication { public void onConnect(IClient client, RequestFunction function, AMFDataList params) { //Concrete implementation to ensure viewer is valid and host created //the stream } } }
The problem I am running into is that regardless of which location I set the modules up in the application.xml, I am receiving logs that each of the onConnect methods is running. Is there any way to prevent this from occurring?
I had hoped that it was like the custom methods which implicitly require you to call this.invokePrevious, but that doesn't seem to be the case. Is there any way around this?Code:<Module> <Name>host_authentication</Name> <Description>Verifies host able to create stream</Description> <Class>com.testing.HostAuthentication</Class> </Module> <Module> <Name>viewer_authentication</Name> <Description>Verifies viewer</Description> <Class>com.testing.ViewerAuthentication</Class> </Module>
I want to have a host authenticate to the server to create their live webstream, and once they have created the stream, then I can run my logic for the viewers of the stream to ensure they are from a valid location.
Feasible?


Reply With Quote
