public static <T> T decode(Class<T> clazz, File configuration) throws Exception { return decode(clazz, configuration, null, null, null); }
public String getTrustStorePassword() throws Exception { return getPassword(trustStorePassword); }
public String getKeyStorePassword() throws Exception { return getPassword(this.keyStorePassword); }
if (config.getAuthorisation() != null) { AuthorisationDTO authorisation = config.getAuthorisation(); JMXAccessControlList accessControlList = new JMXAccessControlList(); List<EntryDTO> entries = authorisation.getWhiteList().getEntries(); for (EntryDTO entry : entries) { accessControlList.addToWhiteList(entry.domain, entry.key); List<AccessDTO> accessList = authorisation.getDefaultAccess().getAccess(); for (AccessDTO access : accessList) { String[] split = access.roles.split(","); List<MatchDTO> matches = authorisation.getRoleAccess().getMatch(); for (MatchDTO match : matches) { List<AccessDTO> accesses = match.getAccess(); for (AccessDTO access : accesses) { String[] split = access.roles.split(","); accessControlList.addToRoleAccess(match.getDomain(), match.getKey(), access.method, split); if (config.getJmxConnector() != null) { JMXConnectorDTO jmxConnector = config.getJmxConnector(); JMXConnectorConfiguration jmxConnectorConfiguration = new JMXConnectorConfiguration(); jmxConnectorConfiguration.setConnectorPort(jmxConnector.getConnectorPort()); if (jmxConnector.getConnectorHost() != null) { jmxConnectorConfiguration.setConnectorHost(jmxConnector.getConnectorHost()); if (jmxConnector.getJmxRealm() != null) { jmxConnectorConfiguration.setJmxRealm(jmxConnector.getJmxRealm());
public File getConfigurationFile() throws Exception { if (configurationFile == null) { configurationFile = new File(getConfigurationURI()); } return configurationFile; }
@Override public Object execute(ActionContext context) throws Exception { super.execute(context); BrokerDTO broker = getBrokerDTO(); File file = broker.server.getConfigurationFile().getParentFile(); File killFile = new File(file, "KILL_ME"); killFile.createNewFile(); return null; } }
@Override public String getAttributeValue(int index) { return filter(super.getAttributeValue(index)); }
if (config.getAuthorisation() != null) { AuthorisationDTO authorisation = config.getAuthorisation(); JMXAccessControlList accessControlList = new JMXAccessControlList(); List<EntryDTO> entries = authorisation.getWhiteList().getEntries(); for (EntryDTO entry : entries) { accessControlList.addToWhiteList(entry.domain, entry.key); List<AccessDTO> accessList = authorisation.getDefaultAccess().getAccess(); for (AccessDTO access : accessList) { String[] split = access.roles.split(","); List<MatchDTO> matches = authorisation.getRoleAccess().getMatch(); for (MatchDTO match : matches) { List<AccessDTO> accesses = match.getAccess(); for (AccessDTO access : accesses) { String[] split = access.roles.split(","); accessControlList.addToRoleAccess(match.getDomain(), match.getKey(), access.method, split); if (config.getJmxConnector() != null) { JMXConnectorDTO jmxConnector = config.getJmxConnector(); JMXConnectorConfiguration jmxConnectorConfiguration = new JMXConnectorConfiguration(); jmxConnectorConfiguration.setConnectorPort(jmxConnector.getConnectorPort()); if (jmxConnector.getConnectorHost() != null) { jmxConnectorConfiguration.setConnectorHost(jmxConnector.getConnectorHost()); if (jmxConnector.getRmiRegistryPort() != null) { jmxConnectorConfiguration.setRmiRegistryPort(jmxConnector.getRmiRegistryPort());
@Override public BrokerDTO createBroker(URI brokerURI, String artemisHome, String artemisInstance, URI artemisURIInstance) throws Exception { File file = new File(brokerURI.getSchemeSpecificPart()); if (!file.exists()) { throw new ConfigurationException("Invalid configuration URI, can't find file: " + file.getName()); } return XmlUtil.decode(BrokerDTO.class, file, artemisHome, artemisInstance, artemisURIInstance); } }
public static Broker createServer(ServerDTO brokerDTO, ActiveMQSecurityManager security) throws Exception { if (brokerDTO.configuration != null) { BrokerHandler handler; URI configURI = brokerDTO.getConfigurationURI(); try { FactoryFinder finder = new FactoryFinder("META-INF/services/org/apache/activemq/artemis/broker/server/"); handler = (BrokerHandler) finder.newInstance(configURI.getScheme()); } catch (IOException ioe) { throw new ConfigurationException("Invalid configuration URI, can't find configuration scheme: " + configURI.getScheme()); } return handler.createServer(brokerDTO, security); } return null; }
@Override public Object execute(ActionContext context) throws Exception { super.execute(context); BrokerDTO broker = getBrokerDTO(); File file = broker.server.getConfigurationFile().getParentFile(); File stopFile = new File(file, "STOP_ME"); stopFile.createNewFile(); return null; } }
public String getKeyStorePassword() throws Exception { return getPassword(keyStorePassword); }
public String getTrustStorePassword() throws Exception { return getPassword(this.trustStorePassword); }
@Override public ManagementContextDTO createJmxAcl(URI configURI, String artemisHome, String artemisInstance, URI artemisURIInstance) throws Exception { File file = new File(configURI.getSchemeSpecificPart()); if (!file.exists()) { throw new ConfigurationException("Invalid configuration URI, can't find file: " + file.getName()); } return XmlUtil.decode(ManagementContextDTO.class, file, artemisHome, artemisInstance, artemisURIInstance); } }
public static Broker createServer(ServerDTO brokerDTO, ActiveMQSecurityManager security) throws Exception { if (brokerDTO.configuration != null) { BrokerHandler handler; URI configURI = brokerDTO.getConfigurationURI(); try { FactoryFinder finder = new FactoryFinder("META-INF/services/org/apache/activemq/artemis/broker/server/"); handler = (BrokerHandler) finder.newInstance(configURI.getScheme()); } catch (IOException ioe) { throw new ConfigurationException("Invalid configuration URI, can't find configuration scheme: " + configURI.getScheme()); } return handler.createServer(brokerDTO, security); } return null; }
@Override public Object execute(ActionContext context) throws Exception { super.execute(context); BrokerDTO broker = getBrokerDTO(); File file = broker.server.getConfigurationFile().getParentFile(); File stopFile = new File(file, "STOP_ME"); stopFile.createNewFile(); return null; } }
@Override public ManagementContextDTO createJmxAcl(URI configURI, String artemisHome, String artemisInstance, URI artemisURIInstance) throws Exception { File file = new File(configURI.getSchemeSpecificPart()); if (!file.exists()) { throw new ConfigurationException("Invalid configuration URI, can't find file: " + file.getName()); } return XmlUtil.decode(ManagementContextDTO.class, file, artemisHome, artemisInstance, artemisURIInstance); } }
protected FileConfiguration readConfiguration() throws Exception { FileConfiguration fileConfiguration = new FileConfiguration(); if (getBrokerInstance() == null) { final String defaultLocation = "./data"; fileConfiguration = new FileConfiguration(); // These will be the default places in case the file can't be loaded fileConfiguration.setBindingsDirectory(defaultLocation + "/bindings"); fileConfiguration.setJournalDirectory(defaultLocation + "/journal"); fileConfiguration.setLargeMessagesDirectory(defaultLocation + "/largemessages"); fileConfiguration.setPagingDirectory(defaultLocation + "/paging"); fileConfiguration.setBrokerInstance(new File(".")); } else { FileJMSConfiguration jmsConfiguration = new FileJMSConfiguration(); String serverConfiguration = getBrokerDTO().server.getConfigurationURI().toASCIIString(); FileDeploymentManager fileDeploymentManager = new FileDeploymentManager(serverConfiguration); fileDeploymentManager.addDeployable(fileConfiguration).addDeployable(jmsConfiguration); fileDeploymentManager.readConfiguration(); fileConfiguration.setBrokerInstance(new File(getBrokerInstance())); } return fileConfiguration; }
@Override public Object execute(ActionContext context) throws Exception { super.execute(context); BrokerDTO broker = getBrokerDTO(); File file = broker.server.getConfigurationFile().getParentFile(); File killFile = new File(file, "KILL_ME"); killFile.createNewFile(); return null; } }
@Override public BrokerDTO createBroker(URI brokerURI, String artemisHome, String artemisInstance, URI artemisURIInstance) throws Exception { File file = new File(brokerURI.getSchemeSpecificPart()); if (!file.exists()) { throw new ConfigurationException("Invalid configuration URI, can't find file: " + file.getName()); } return XmlUtil.decode(BrokerDTO.class, file, artemisHome, artemisInstance, artemisURIInstance); } }