当前位置: 首页>>代码示例>>Java>>正文


Java ConfigurationImpl.setSecurityEnabled方法代码示例

本文整理汇总了Java中org.apache.activemq.artemis.core.config.impl.ConfigurationImpl.setSecurityEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationImpl.setSecurityEnabled方法的具体用法?Java ConfigurationImpl.setSecurityEnabled怎么用?Java ConfigurationImpl.setSecurityEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.activemq.artemis.core.config.impl.ConfigurationImpl的用法示例。


在下文中一共展示了ConfigurationImpl.setSecurityEnabled方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createConfiguration

import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; //导入方法依赖的package包/类
public Configuration createConfiguration() {
	ConfigurationImpl configuration = new ConfigurationImpl();
	configuration.setSecurityEnabled(false);
	configuration.setPersistenceEnabled(this.properties.isPersistent());
	String dataDir = getDataDir();
	configuration.setJournalDirectory(dataDir + "/journal");
	if (this.properties.isPersistent()) {
		configuration.setJournalType(JournalType.NIO);
		configuration.setLargeMessagesDirectory(dataDir + "/largemessages");
		configuration.setBindingsDirectory(dataDir + "/bindings");
		configuration.setPagingDirectory(dataDir + "/paging");
	}
	TransportConfiguration transportConfiguration = new TransportConfiguration(
			InVMAcceptorFactory.class.getName(),
			this.properties.generateTransportParameters());
	configuration.getAcceptorConfigurations().add(transportConfiguration);
	if (this.properties.isDefaultClusterPassword()) {
		logger.debug("Using default Artemis cluster password: "
				+ this.properties.getClusterPassword());
	}
	configuration.setClusterPassword(this.properties.getClusterPassword());
	return configuration;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:24,代码来源:ArtemisEmbeddedConfigurationFactory.java

示例2: createConfiguration

import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; //导入方法依赖的package包/类
public Configuration createConfiguration() {
	ConfigurationImpl configuration = new ConfigurationImpl();
	configuration.setSecurityEnabled(false);
	configuration.setPersistenceEnabled(this.properties.isPersistent());
	String dataDir = getDataDir();
	configuration.setJournalDirectory(dataDir + "/journal");
	if (this.properties.isPersistent()) {
		configuration.setJournalType(JournalType.NIO);
		configuration.setLargeMessagesDirectory(dataDir + "/largemessages");
		configuration.setBindingsDirectory(dataDir + "/bindings");
		configuration.setPagingDirectory(dataDir + "/paging");
	}
	TransportConfiguration transportConfiguration = new TransportConfiguration(
			InVMAcceptorFactory.class.getName(),
			this.properties.generateTransportParameters());
	configuration.getAcceptorConfigurations().add(transportConfiguration);
	if (this.properties.isDefaultClusterPassword()) {
		this.logger.debug("Using default Artemis cluster password: "
				+ this.properties.getClusterPassword());
	}
	configuration.setClusterPassword(this.properties.getClusterPassword());
	return configuration;
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:24,代码来源:ArtemisEmbeddedConfigurationFactory.java

示例3: createCustomSslServer

import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; //导入方法依赖的package包/类
private void createCustomSslServer() throws Exception {
   Map<String, Object> params = new HashMap<>();

   params.put(TransportConstants.SSL_ENABLED_PROP_NAME, true);
   params.put(TransportConstants.ENABLED_CIPHER_SUITES_PROP_NAME, getSuitableCipherSuite());
   params.put(TransportConstants.SSL_KRB5_CONFIG_PROP_NAME, "core-tls-krb5-server");

   ConfigurationImpl config = createBasicConfig().addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, params, "nettySSL"));
   config.setPopulateValidatedUser(true); // so we can verify the kerb5 id is present
   config.setSecurityEnabled(true);

   config.addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY));

   ActiveMQSecurityManager securityManager = new ActiveMQJAASSecurityManager("Krb5Plus");
   server = addServer(ActiveMQServers.newActiveMQServer(config, ManagementFactory.getPlatformMBeanServer(), securityManager, false));
   HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();


   final String roleName = "ALLOW_ALL";
   Role role = new Role(roleName, true, true, true, true, true, true, true, true, true, true);
   Set<Role> roles = new HashSet<>();
   roles.add(role);
   securityRepository.addMatch(QUEUE.toString(), roles);

   server.start();
   waitForServerToStart(server);

   // note kerberos user does not exist on the broker save as a role member in dual-authentication-roles.properties
   userPrincipal = CLIENT_PRINCIPAL + "@" + kdc.getRealm();

   tc = new TransportConfiguration(NETTY_CONNECTOR_FACTORY);
   inVMTc = new TransportConfiguration(INVM_CONNECTOR_FACTORY);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:34,代码来源:CoreClientOverOneWaySSLKerb5Test.java

示例4: setUp

import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; //导入方法依赖的package包/类
@Override
@Before
public void setUp() throws Exception {
   super.setUp();
   Map<String, Object> params = new HashMap<>();
   params.put(TransportConstants.SSL_ENABLED_PROP_NAME, true);
   params.put(TransportConstants.KEYSTORE_PATH_PROP_NAME, SERVER_SIDE_KEYSTORE);
   params.put(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME, PASSWORD);
   params.put(TransportConstants.TRUSTSTORE_PATH_PROP_NAME, SERVER_SIDE_TRUSTSTORE);
   params.put(TransportConstants.TRUSTSTORE_PASSWORD_PROP_NAME, PASSWORD);
   params.put(TransportConstants.NEED_CLIENT_AUTH_PROP_NAME, true);
   params.put(TransportConstants.PORT_PROP_NAME, "61617");
   ConfigurationImpl config = createBasicConfig();
   config.addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, params));
   config.addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY));
   config.setSecurityEnabled(true);

   ActiveMQSecurityManager securityManager = new ActiveMQJAASSecurityManager("DualAuthenticationPropertiesLogin", "DualAuthenticationCertLogin");
   server = addServer(ActiveMQServers.newActiveMQServer(config, ManagementFactory.getPlatformMBeanServer(), securityManager, false));

   HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository();
   Role sendRole = new Role("producers", true, false, true, false, true, false, false, false, false, false);
   Role receiveRole = new Role("consumers", false, true, false, false, false, false, false, false, false, false);
   Set<Role> roles = new HashSet<>();
   roles.add(sendRole);
   roles.add(receiveRole);
   securityRepository.addMatch(DualAuthenticationTest.QUEUE.toString(), roles);

   server.start();
   waitForServerToStart(server);
   tc = new TransportConfiguration(NETTY_CONNECTOR_FACTORY);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:33,代码来源:DualAuthenticationTest.java

示例5: activeMqArtemisServer

import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; //导入方法依赖的package包/类
/**
 * Embedded Artemis broker.
 * 
 * @return the created broker.
 * @throws Exception
 */
@Bean(initMethod = "start")
public ActiveMQServer activeMqArtemisServer() throws Exception {
	ConfigurationImpl config = new ConfigurationImpl();
	Set<TransportConfiguration> transports = new HashSet<>();
	// TODO figure out if external access is necessary.
	transports.add(new TransportConfiguration(NettyAcceptorFactory.class.getName()));
	transports.add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
	config.setAcceptorConfigurations(transports);
	config.setSecurityEnabled(false);
	ActiveMQServer server = new ActiveMQServerImpl(config);
	server.start();
	return server;
}
 
开发者ID:northlander,项目名称:activemft,代码行数:20,代码来源:BrokerConfig.java


注:本文中的org.apache.activemq.artemis.core.config.impl.ConfigurationImpl.setSecurityEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。