+ (domainMode ? "domain controller at " : "standalone controller at ") //$NON-NLS-1$ //$NON-NLS-2$ + host + ":" + port); //$NON-NLS-1$ return new AdminImpl(newClient);
private void createConnectionFactory(String deploymentName, String rarName, Properties properties) throws AdminException { if (!getInstalledResourceAdaptorNames().contains(rarName)) { addArchiveResourceAdapter(rarName); String moduleName = getResourceAdapterModuleName(rarName); addModuleResourceAdapter(deploymentName, moduleName); rarName = deploymentName; buildResourceAdpaterProperties(rarName, bpd); ArrayList<PropertyDefinition> jcaSpecific = bpd.getPropertyDefinitions(); parameters.add(addJavaContext(deploymentName)); parameters.add("enabled"); parameters.add("true"); cliCall("add", new String[] { "subsystem", "resource-adapters", "resource-adapter", rarName, "connection-definitions", deploymentName }, addConfigProperty(rarName, deploymentName, key, properties.getProperty(key)); activateConnectionFactory(rarName);
flush(); deploymentName = removeJavaContext(deploymentName); Map<String, String> connectionFactoryNames = getConnectionFactoryNames(); Collection<String> dsNames = getDataSourceNames(connectionFactoryNames); if (dsNames.contains(deploymentName)) { throw new AdminProcessingException(AdminPlugin.Event.TEIID70003, AdminPlugin.Util.gs(AdminPlugin.Event.TEIID70003, deploymentName)); Set<String> resourceAdapters = getResourceAdapterNames(connectionFactoryNames); if (resourceAdapters.contains(templateName)) { createConnectionFactory(deploymentName, templateName, properties); flush(); return; Set<String> drivers = getInstalledJDBCDrivers(); if (!drivers.contains(templateName)) { throw new AdminProcessingException(AdminPlugin.Event.TEIID70004, AdminPlugin.Util.gs(AdminPlugin.Event.TEIID70004, templateName)); Collection<PropertyDefinition> dsProperties = getTemplatePropertyDefinitions(templateName); ArrayList<String> parameters = new ArrayList<String>(); if (properties != null) { if (!isXA(templateName)) { parameters.add("connection-url"); parameters.add(properties.getProperty("connection-url")); if (getCustomDatasourceProperties().contains(prop.getName())) { continue; parameters.add(addJavaContext(deploymentName));
flush(); deploymentName = removeJavaContext(deploymentName); Map<String, String> connectionFactoryNames = getConnectionFactoryNames(); Collection<String> dsNames = getDataSourceNames(connectionFactoryNames); if (dsNames.contains(deploymentName)) { throw new AdminProcessingException(AdminPlugin.Event.TEIID70003, AdminPlugin.Util.gs(AdminPlugin.Event.TEIID70003, deploymentName)); Set<String> resourceAdapters = getResourceAdapterNames(connectionFactoryNames); if (resourceAdapters.contains(templateName)) { createConnectionFactory(deploymentName, templateName, properties); flush(); return; Set<String> drivers = getInstalledJDBCDrivers(); if (!drivers.contains(templateName)) { throw new AdminProcessingException(AdminPlugin.Event.TEIID70004, AdminPlugin.Util.gs(AdminPlugin.Event.TEIID70004, templateName)); Collection<PropertyDefinition> dsProperties = getTemplatePropertyDefinitions(templateName); ArrayList<String> parameters = new ArrayList<String>(); if (properties != null) { if (!isXA(templateName)) { parameters.add("connection-url"); parameters.add(properties.getProperty("connection-url")); if (getCustomDatasourceProperties().contains(prop.getName())) { continue; parameters.add(addJavaContext(deploymentName));
private void createConnectionFactory(String deploymentName, String rarName, Properties properties) throws AdminException { if (!getInstalledResourceAdaptorNames().contains(rarName)) { addArchiveResourceAdapter(rarName); String moduleName = getResourceAdapterModuleName(rarName); addModuleResourceAdapter(deploymentName, moduleName); rarName = deploymentName; buildResourceAdpaterProperties(rarName, bpd); ArrayList<PropertyDefinition> jcaSpecific = bpd.getPropertyDefinitions(); parameters.add(addJavaContext(deploymentName)); parameters.add("enabled"); parameters.add("true"); cliCall("add", new String[] { "subsystem", "resource-adapters", "resource-adapter", rarName, "connection-definitions", deploymentName }, addConfigProperty(rarName, deploymentName, key, properties.getProperty(key)); activateConnectionFactory(rarName);
+ (domainMode ? "domain controller at " : "standalone controller at ") //$NON-NLS-1$ //$NON-NLS-2$ + host + ":" + port); //$NON-NLS-1$ return new AdminImpl(newClient);
Set<String> resourceAdapters = getResourceAdapterNames(null); if (resourceAdapters.contains(templateName)) { cliCall("read-rar-description", new String[] {"subsystem", "teiid"}, new String[] {"rar-name", templateName}, builder); buildResourceAdpaterProperties(templateName, builder); return builder.getPropertyDefinitions(); if (isXA(templateName)) { cliCall("read-resource-description", new String[] {"subsystem", "datasources", "data-source", stripXA(templateName)}, null, builder); addXAProperties(props); } else { cliCall("read-resource-description", new String[] {"subsystem", "datasources", "data-source", templateName}, null, builder); addDriverproperties(props);
Set<String> resourceAdapters = getResourceAdapterNames(null); if (resourceAdapters.contains(templateName)) { cliCall("read-rar-description", new String[] {"subsystem", "teiid"}, new String[] {"rar-name", templateName}, builder); buildResourceAdpaterProperties(templateName, builder); return builder.getPropertyDefinitions(); if (isXA(templateName)) { cliCall("read-resource-description", new String[] {"subsystem", "datasources", "data-source", stripXA(templateName)}, null, builder); addXAProperties(props); } else { cliCall("read-resource-description", new String[] {"subsystem", "datasources", "data-source", templateName}, null, builder); addDriverproperties(props);
private boolean deleteDS(String deployedName, String... subsystem) throws AdminException { DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder(); final ModelNode request; try { addProfileNode(builder); builder.addNode("subsystem", subsystem[0]); //$NON-NLS-1$ builder.addNode(subsystem[1], deployedName); builder.setOperationName("remove"); request = builder.buildRequest(); } catch (OperationFormatException e) { throw new AdminComponentException(AdminPlugin.Event.TEIID70010, e, "Failed to build operation"); //$NON-NLS-1$ } try { ModelNode outcome = this.connection.execute(request); if (!Util.isSuccess(outcome)) { return false; } } catch (IOException e) { throw new AdminComponentException(AdminPlugin.Event.TEIID70009, e); } return true; }
private boolean deleteDS(String deployedName, String... subsystem) throws AdminException { DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder(); final ModelNode request; try { addProfileNode(builder); builder.addNode("subsystem", subsystem[0]); //$NON-NLS-1$ builder.addNode(subsystem[1], deployedName); builder.setOperationName("remove"); request = builder.buildRequest(); } catch (OperationFormatException e) { throw new AdminComponentException(AdminPlugin.Event.TEIID70010, e, "Failed to build operation"); //$NON-NLS-1$ } try { ModelNode outcome = this.connection.execute(request); if (!Util.isSuccess(outcome)) { return false; } } catch (IOException e) { throw new AdminComponentException(AdminPlugin.Event.TEIID70009, e); } return true; }
private ModelNode buildRequest(String subsystem, String operationName, String... params) throws AdminException { DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder(); final ModelNode request; try { if (subsystem != null) { addProfileNode(builder); builder.addNode("subsystem", subsystem); //$NON-NLS-1$ } builder.setOperationName(operationName); request = builder.buildRequest(); if (params != null && params.length % 2 == 0) { for (int i = 0; i < params.length; i+=2) { builder.addProperty(params[i], params[i+1]); } } } catch (OperationFormatException e) { throw new AdminComponentException(AdminPlugin.Event.TEIID70010, e, "Failed to build operation"); //$NON-NLS-1$ } return request; }
private ModelNode buildRequest(String operationName, String[] address, String[] params) throws AdminException, OperationFormatException { if (address.length % 2 != 0) { throw new IllegalArgumentException("Failed to build operation"); //$NON-NLS-1$ } DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder(); addProfileNode(builder); for (int i = 0; i < address.length; i+=2) { builder.addNode(address[i], address[i+1]); } builder.setOperationName(operationName); ModelNode request = builder.buildRequest(); if (params != null && params.length % 2 == 0) { for (int i = 0; i < params.length; i+=2) { builder.addProperty(params[i], params[i+1]); } } return request; }
private ModelNode buildRequest(String subsystem, String operationName, String... params) throws AdminException { DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder(); final ModelNode request; try { if (subsystem != null) { addProfileNode(builder); builder.addNode("subsystem", subsystem); //$NON-NLS-1$ } builder.setOperationName(operationName); request = builder.buildRequest(); if (params != null && params.length % 2 == 0) { for (int i = 0; i < params.length; i+=2) { builder.addProperty(params[i], params[i+1]); } } } catch (OperationFormatException e) { throw new AdminComponentException(AdminPlugin.Event.TEIID70010, e, "Failed to build operation"); //$NON-NLS-1$ } return request; }
private ModelNode buildRequest(String operationName, String[] address, String[] params) throws AdminException, OperationFormatException { if (address.length % 2 != 0) { throw new IllegalArgumentException("Failed to build operation"); //$NON-NLS-1$ } DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder(); addProfileNode(builder); for (int i = 0; i < address.length; i+=2) { builder.addNode(address[i], address[i+1]); } builder.setOperationName(operationName); ModelNode request = builder.buildRequest(); if (params != null && params.length % 2 == 0) { for (int i = 0; i < params.length; i+=2) { builder.addProperty(params[i], params[i+1]); } } return request; }
public Admin createAdmin(ModelControllerClient connection) { return new AdminImpl(connection); }
public Admin createAdmin(ModelControllerClient connection) { return new AdminImpl(connection); }
/** * Name of the domain mode profile. * @param connection * @param profileName * @return */ public Admin createAdmin(ModelControllerClient connection, String profileName) { AdminImpl admin = new AdminImpl(connection); admin.setProfileName(profileName); return admin; }
@Override public void addDataRoleMapping(String vdbName, int vdbVersion, String dataRole, String mappedRoleName) throws AdminException { addDataRoleMapping(vdbName, String.valueOf(vdbVersion), dataRole, mappedRoleName); }
/** * Name of the domain mode profile. * @param connection * @param profileName * @return */ public Admin createAdmin(ModelControllerClient connection, String profileName) { AdminImpl admin = new AdminImpl(connection); admin.setProfileName(profileName); return admin; }
@Override public void addDataRoleMapping(String vdbName, int vdbVersion, String dataRole, String mappedRoleName) throws AdminException { addDataRoleMapping(vdbName, String.valueOf(vdbVersion), dataRole, mappedRoleName); }