本文整理汇总了Java中org.jivesoftware.openfire.http.HttpBindManager类的典型用法代码示例。如果您正苦于以下问题:Java HttpBindManager类的具体用法?Java HttpBindManager怎么用?Java HttpBindManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HttpBindManager类属于org.jivesoftware.openfire.http包,在下文中一共展示了HttpBindManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getWebappURL
import org.jivesoftware.openfire.http.HttpBindManager; //导入依赖的package包/类
public URL getWebappURL()
{
try
{
final String protocol = "https"; // No point in providing the non-SSL protocol, as webRTC won't work there.
final String host = XMPPServer.getInstance().getServerInfo().getHostname();
final int port = HttpBindManager.getInstance().getHttpBindSecurePort();
final String path;
if ( publicWebApp != null )
{
path = publicWebApp.getContextPath();
}
else
{
path = new OFMeetConfig().getWebappContextPath();
}
return new URL( protocol, host, port, path );
}
catch ( MalformedURLException e )
{
Log.error( "Unable to compose the webapp URL", e );
return null;
}
}
示例2: initializePlugin
import org.jivesoftware.openfire.http.HttpBindManager; //导入依赖的package包/类
@Override
public void initializePlugin( PluginManager manager, File pluginDirectory )
{
for ( final String publicResource : publicResources )
{
AuthCheckFilter.addExclude( publicResource );
}
// Add the Webchat sources to the same context as the one that's providing the BOSH interface.
context = new WebAppContext( null, pluginDirectory.getPath() + File.separator + "classes/", "/inverse" );
context.setClassLoader( this.getClass().getClassLoader() );
// Ensure the JSP engine is initialized correctly (in order to be able to cope with Tomcat/Jasper precompiled JSPs).
final List<ContainerInitializer> initializers = new ArrayList<>();
initializers.add( new ContainerInitializer( new JettyJasperInitializer(), null ) );
context.setAttribute("org.eclipse.jetty.containerInitializers", initializers);
context.setAttribute( InstanceManager.class.getName(), new SimpleInstanceManager());
HttpBindManager.getInstance().addJettyHandler( context );
}
示例3: service
import org.jivesoftware.openfire.http.HttpBindManager; //导入依赖的package包/类
@Override
protected void service( HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
final HttpBindManager boshManager = HttpBindManager.getInstance();
// add CORS headers for all HTTP responses (errors, etc.)
if (boshManager.isCORSEnabled())
{
if (boshManager.isAllOriginsAllowed()) {
// Set the Access-Control-Allow-Origin header to * to allow all Origin to do the CORS
response.setHeader( "Access-Control-Allow-Origin", HttpBindManager.HTTP_BIND_CORS_ALLOW_ORIGIN_DEFAULT);
} else {
// Get the Origin header from the request and check if it is in the allowed Origin Map.
// If it is allowed write it back to the Access-Control-Allow-Origin header of the respond.
final String origin = request.getHeader("Origin");
if (boshManager.isThisOriginAllowed(origin)) {
response.setHeader("Access-Control-Allow-Origin", origin);
}
}
response.setHeader("Access-Control-Allow-Methods", HttpBindManager.HTTP_BIND_CORS_ALLOW_METHODS_DEFAULT);
response.setHeader("Access-Control-Allow-Headers", HttpBindManager.HTTP_BIND_CORS_ALLOW_HEADERS_DEFAULT);
response.setHeader("Access-Control-Max-Age", HttpBindManager.HTTP_BIND_CORS_MAX_AGE_DEFAULT);
}
super.service(request, response);
}
示例4: destroyPlugin
import org.jivesoftware.openfire.http.HttpBindManager; //导入依赖的package包/类
@Override
public void destroyPlugin()
{
for ( final String publicResource : publicResources )
{
AuthCheckFilter.removeExclude( publicResource );
}
if ( context != null )
{
HttpBindManager.getInstance().removeJettyHandler( context );
context.destroy();
context = null;
}
if ( component != null )
{
InternalComponentManager.getInstance().removeComponent( "httpfileupload" );
}
}
示例5: initializePlugin
import org.jivesoftware.openfire.http.HttpBindManager; //导入依赖的package包/类
@Override
public void initializePlugin( PluginManager manager, File pluginDirectory )
{
for ( final String publicResource : publicResources )
{
AuthCheckFilter.addExclude( publicResource );
}
// Add the Webchat sources to the same context as the one that's providing the BOSH interface.
context = new WebAppContext( null, pluginDirectory.getPath() + File.separator + "classes", "/candy" );
context.setClassLoader( this.getClass().getClassLoader() );
// Ensure the JSP engine is initialized correctly (in order to be able to cope with Tomcat/Jasper precompiled JSPs).
final List<ContainerInitializer> initializers = new ArrayList<>();
initializers.add( new ContainerInitializer( new JettyJasperInitializer(), null ) );
context.setAttribute("org.eclipse.jetty.containerInitializers", initializers);
context.setAttribute( InstanceManager.class.getName(), new SimpleInstanceManager());
HttpBindManager.getInstance().addJettyHandler( context );
}
示例6: sendMessage
import org.jivesoftware.openfire.http.HttpBindManager; //导入依赖的package包/类
private void sendMessage(JID from, JID to, String body, String fileName, String type)
{
Log.info( "RayoComponent sendMessage " + from + " " + to + " " + body + " " + fileName);
int port = HttpBindManager.getInstance().getHttpBindUnsecurePort();
Message packet = new Message();
packet.setTo(to);
packet.setFrom(from);
packet.setType("chat".equals(type) ? Message.Type.chat : Message.Type.groupchat);
if (fileName != null)
{
String url = "http://" + getDomain() + ":" + port + "/rayo/recordings/" + fileName;
packet.setThread(url);
body = body + " " + url;
}
packet.setBody(body);
sendPacket(packet);
}
示例7: sendMessage
import org.jivesoftware.openfire.http.HttpBindManager; //导入依赖的package包/类
private void sendMessage(JID from, JID to, String body, String fileName, String type)
{
Log.info( "RayoComponent sendMessage " + from + " " + to + " " + body + " " + fileName);
int port = HttpBindManager.getInstance().getHttpBindUnsecurePort();
Message packet = new Message();
packet.setTo(to);
packet.setFrom(from);
packet.setType("chat".equals(type) ? Message.Type.chat : Message.Type.groupchat);
if (fileName != null)
{
String url = "http://" + getDomain() + ":" + port + "/rayo/recordings/" + fileName;
packet.setThread(url);
body = body + " " + url;
}
packet.setBody(body);
sendPacket(packet);
}
示例8: unloadPublicWebApp
import org.jivesoftware.openfire.http.HttpBindManager; //导入依赖的package包/类
public void unloadPublicWebApp() throws Exception
{
if ( publicWebApp != null )
{
try
{
HttpBindManager.getInstance().removeJettyHandler( publicWebApp );
publicWebApp.destroy();
}
finally
{
publicWebApp = null;
}
}
}
示例9: execute
import org.jivesoftware.openfire.http.HttpBindManager; //导入依赖的package包/类
@Override
public void execute(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.result);
FormField field = form.addField();
field.setType(FormField.Type.hidden);
field.setVariable("FORM_TYPE");
field.addValue("http://jabber.org/protocol/admin");
HttpBindManager manager = HttpBindManager.getInstance();
boolean isEnabled = manager.isHttpBindEnabled();
field = form.addField();
field.setLabel("Http Bind Enabled");
field.setVariable("httpbindenabled");
field.addValue(String.valueOf(isEnabled));
if (isEnabled) {
field = form.addField();
field.setLabel("Http Bind Address");
field.setVariable("httpbindaddress");
field.addValue(manager.getHttpBindUnsecureAddress());
field = form.addField();
field.setLabel("Http Bind Secure Address");
field.setVariable("httpbindsecureaddress");
field.addValue(manager.getHttpBindSecureAddress());
String jsUrl = manager.getJavaScriptUrl();
if (jsUrl != null) {
field = form.addField();
field.setLabel("Http Bind JavaScript Address");
field.setVariable("javascriptaddress");
field.addValue(jsUrl);
}
}
command.add(form.getElement());
}
示例10: destroyPlugin
import org.jivesoftware.openfire.http.HttpBindManager; //导入依赖的package包/类
@Override
public void destroyPlugin()
{
if ( context != null )
{
HttpBindManager.getInstance().removeJettyHandler( context );
context.destroy();
context = null;
}
for ( final String publicResource : publicResources )
{
AuthCheckFilter.removeExclude( publicResource );
}
}
示例11: destroyPlugin
import org.jivesoftware.openfire.http.HttpBindManager; //导入依赖的package包/类
public void destroyPlugin() {
Log.info( "["+ NAME + "] destroy " + NAME + " plugin resources");
if (database != null) {
database.stop();
JmxHelper.unregister(OBJECTNAME_DATABASEPOOL);
}
if (client != null) {
client.stop();
JmxHelper.unregister(OBJECTNAME_CORE_CLIENT_THREADPOOL);
}
if (packetCounter != null) {
packetCounter.stop();
JmxHelper.unregister(OBJECTNAME_PACKET_COUNTER);
}
if (openfire != null) {
openfire.stop();
JmxHelper.unregister(OBJECTNAME_OPENFIRE);
}
if (emailScheduler != null)
{
emailScheduler.stopMonitoring();
}
HttpBindManager.getInstance().removeJettyHandler( context );
HttpBindManager.getInstance().removeJettyHandler( context2 );
Log.info("["+ NAME + "] plugin fully destroyed.");
}
示例12: execute
import org.jivesoftware.openfire.http.HttpBindManager; //导入依赖的package包/类
@Override
public void execute(SessionData data, Element command) {
DataForm form = new DataForm(DataForm.Type.result);
FormField field = form.addField();
field.setType(FormField.Type.hidden);
field.setVariable("FORM_TYPE");
field.addValue("http://jabber.org/protocol/admin");
HttpBindManager manager = HttpBindManager.getInstance();
boolean isEnabled = manager.isHttpBindEnabled();
field = form.addField();
field.setLabel("Http Bind Enabled");
field.setVariable("httpbindenabled");
field.addValue(String.valueOf(isEnabled));
if (isEnabled) {
field = form.addField();
field.setLabel("Http Bind Address");
field.setVariable("httpbindaddress");
field.addValue(manager.getHttpBindUnsecureAddress());
field = form.addField();
field.setLabel("Http Bind Secure Address");
field.setVariable("httpbindsecureaddress");
field.addValue(manager.getHttpBindSecureAddress());
String jsUrl = manager.getJavaScriptUrl();
if (jsUrl != null) {
field = form.addField();
field.setLabel("Http Bind JavaScript Address");
field.setVariable("javascriptaddress");
field.addValue(jsUrl);
}
}
command.add(form.getElement());
}
示例13: stop
import org.jivesoftware.openfire.http.HttpBindManager; //导入依赖的package包/类
@Override
public void stop() {
super.stop();
stopClientListeners();
stopClientSSLListeners();
stopComponentListener();
stopConnectionManagerListener();
stopServerListener();
HttpBindManager.getInstance().stop();
SocketSendingTracker.getInstance().shutdown();
CertificateManager.removeListener(this);
serverName = null;
}
示例14: propertySet
import org.jivesoftware.openfire.http.HttpBindManager; //导入依赖的package包/类
public void propertySet(String property, Map params) {
if (property.equalsIgnoreCase(HttpBindManager.HTTP_BIND_ENABLED) ||
property.equalsIgnoreCase(HttpBindManager.HTTP_BIND_PORT) ||
property.equalsIgnoreCase(HttpBindManager.HTTP_BIND_SECURE_PORT) ||
property.equalsIgnoreCase("xmpp.socket.plain.port")) {
updateClearspaceClientSettings();
}
}
示例15: propertyDeleted
import org.jivesoftware.openfire.http.HttpBindManager; //导入依赖的package包/类
public void propertyDeleted(String property, Map params) {
if (property.equalsIgnoreCase(HttpBindManager.HTTP_BIND_ENABLED) ||
property.equalsIgnoreCase(HttpBindManager.HTTP_BIND_PORT) ||
property.equalsIgnoreCase(HttpBindManager.HTTP_BIND_SECURE_PORT) ||
property.equalsIgnoreCase("xmpp.socket.plain.port")) {
updateClearspaceClientSettings();
}
}