private void deploySecurityFromConfiguration() { for (Map.Entry<String, Set<Role>> entry : configuration.getSecurityRoles().entrySet()) { securityRepository.addMatch(entry.getKey(), entry.getValue(), true); } }
@Override public void onChange() { AddressSettings settings = addressSettingsRepository.getMatch(address.toString()); configureExpiry(settings); configureSlowConsumerReaper(settings); } }
public PagingManagerImpl(final PagingStoreFactory pagingSPI, final HierarchicalRepository<AddressSettings> addressSettingsRepository) { pagingStoreFactory = pagingSPI; this.addressSettingsRepository = addressSettingsRepository; addressSettingsRepository.registerListener(this); }
public void setExpiryAddress(final String expiryAddress) throws Exception { checkStarted(); clearIO(); try { AddressSettings addressSettings = addressSettingsRepository.getMatch(address); if (addressSettings != null && expiryAddress != null) { addressSettings = new AddressSettings(addressSettings); addressSettings.setExpiryAddress(SimpleString.toSimpleString(expiryAddress)); addressSettingsRepository.addMatch(address, addressSettings); } } finally { blockOnIO(); } }
/** * undeploys an element * @param node the element to undeploy * @throws Exception . */ @Override public void undeploy(final Node node) throws Exception { String match = node.getAttributes().getNamedItem(getKeyAttribute()).getNodeValue(); addressSettingsRepository.removeMatch(match); }
addressSettingsRepository.clearListeners(); addressSettingsRepository.clearCache(); if (identity != null)
public HornetQServerImpl(Configuration configuration, MBeanServer mbeanServer, final HornetQSecurityManager securityManager) { if (configuration == null) { configuration = new ConfigurationImpl(); } if (mbeanServer == null) { // Just use JVM mbean server mbeanServer = ManagementFactory.getPlatformMBeanServer(); } // We need to hard code the version information into a source file version = VersionLoader.getVersion(); this.configuration = configuration; this.mbeanServer = mbeanServer; this.securityManager = securityManager; addressSettingsRepository = new HierarchicalObjectRepository<AddressSettings>(); addressSettingsRepository.setDefault(new AddressSettings()); securityRepository = new HierarchicalObjectRepository<Set<Role>>(); securityRepository.setDefault(new HashSet<Role>()); }
public void destroyQueue(final SimpleString queueName, final ServerSession session, final boolean checkConsumerCount, final boolean removeConsumers) throws Exception { addressSettingsRepository.clearCache(); Binding binding = postOffice.getBinding(queueName); if (binding == null) { throw HornetQMessageBundle.BUNDLE.noSuchQueue(queueName); } Queue queue = (Queue) binding.getBindable(); // This check is only valid if checkConsumerCount == true if (checkConsumerCount && queue.getConsumerCount() != 0) { throw HornetQMessageBundle.BUNDLE.cannotDeleteQueue(queue.getName(), queueName, binding.getClass().getName()); } if (session != null) { if (queue.isDurable()) { // make sure the user has privileges to delete this queue securityStore.check(binding.getAddress(), CheckType.DELETE_DURABLE_QUEUE, session); } else { securityStore.check(binding.getAddress(), CheckType.DELETE_NON_DURABLE_QUEUE, session); } } queue.deleteQueue(removeConsumers); }
public void stop() { securityRepository.unRegisterListener(this); }
public void setDeadLetterAddress(final String deadLetterAddress) throws Exception { checkStarted(); clearIO(); try { AddressSettings addressSettings = addressSettingsRepository.getMatch(address); if (addressSettings != null && deadLetterAddress != null) { addressSettings = new AddressSettings(addressSettings); addressSettings.setDeadLetterAddress(SimpleString.toSimpleString(deadLetterAddress)); addressSettingsRepository.addMatch(address, addressSettings); } } finally { blockOnIO(); } }
/** * Undeploys an element. * * @param node the element to undeploy * @throws Exception */ @Override public void undeploy(final Node node) throws Exception { String match = node.getAttributes().getNamedItem(getKeyAttribute()).getNodeValue(); addressSettingsRepository.removeMatch(match); }
addressSettingsRepository.clearListeners(); addressSettingsRepository.clearCache();
public HornetQServerImpl(Configuration configuration, MBeanServer mbeanServer, final HornetQSecurityManager securityManager, final HornetQServer parentServer) { if (configuration == null) { configuration = new ConfigurationImpl(); } if (mbeanServer == null) { // Just use JVM mbean server mbeanServer = ManagementFactory.getPlatformMBeanServer(); } // We need to hard code the version information into a source file version = VersionLoader.getVersion(); this.configuration = configuration; this.mbeanServer = mbeanServer; this.securityManager = securityManager; addressSettingsRepository = new HierarchicalObjectRepository<AddressSettings>(); addressSettingsRepository.setDefault(new AddressSettings()); securityRepository = new HierarchicalObjectRepository<Set<Role>>(); securityRepository.setDefault(new HashSet<Role>()); this.parentServer = parentServer; }
public void destroyQueue(final SimpleString queueName, final ServerSession session) throws Exception addressSettingsRepository.clearCache();
public void stop() { securityRepository.unRegisterListener(this); }
public Set<Role> getSecurity(final String addressMatch) { return server.getSecurityRepository().getMatch(addressMatch); }
public void addSecurity(final String addressMatch, final Set<Role> roles) { server.getSecurityRepository().addMatch(addressMatch, roles); }
/** * undeploys an element * * @param node the element to undeploy * @throws Exception */ @Override public void undeploy(final Node node) throws Exception { String match = node.getAttributes().getNamedItem(getKeyAttribute()).getNodeValue(); securityRepository.removeMatch(match); }
public PagingManagerImpl(final PagingStoreFactory pagingSPI, final StorageManager storageManager, final HierarchicalRepository<AddressSettings> addressSettingsRepository) { pagingStoreFactory = pagingSPI; this.addressSettingsRepository = addressSettingsRepository; addressSettingsRepository.registerListener(this); this.storageManager = storageManager; }
PagingStoreFactory pageStoreFactory = new PagingStoreFactoryNIO(arg[0], 1000l, scheduled, execfactory, false, null); HierarchicalRepository<AddressSettings> addressSettingsRepository = new HierarchicalObjectRepository<AddressSettings>(); addressSettingsRepository.setDefault(new AddressSettings()); StorageManager sm = new NullStorageManager(); PagingManager manager = new PagingManagerImpl(pageStoreFactory, sm, addressSettingsRepository);