public static APIConfiguration getDefaultConfigurationProperties(DataProvider dataProvider, ConnectorInfoManager manager) throws ObjectNotFoundException { String bundleName = (String) dataProvider.getTestSuiteAttribute("bundleName"); String bundleVersion = (String) dataProvider.getTestSuiteAttribute("bundleVersion"); String connectorName = (String) dataProvider.getTestSuiteAttribute("connectorName"); ConnectorKey key = new ConnectorKey(bundleName, bundleVersion, connectorName); ConnectorInfo info = manager.findConnectorInfo(key); final String MSG = "Connector info wasn't found. Check values of bundleName, bundleVersion and connectorName properties." + "\nbundleName:%s\nbundleVersion:%s\nconnectorName:%s"; Assert.assertNotNull(String.format(MSG, bundleName, bundleVersion, connectorName), info); APIConfiguration apiConfig = info.createDefaultAPIConfiguration(); return apiConfig; }
public static APIConfiguration getDefaultConfigurationProperties(DataProvider dataProvider, ConnectorInfoManager manager) throws ObjectNotFoundException { String bundleName = (String) dataProvider.getTestSuiteAttribute("bundleName"); String bundleVersion = (String) dataProvider.getTestSuiteAttribute("bundleVersion"); String connectorName = (String) dataProvider.getTestSuiteAttribute("connectorName"); ConnectorKey key = new ConnectorKey(bundleName, bundleVersion, connectorName); ConnectorInfo info = manager.findConnectorInfo(key); final String MSG = "Connector info wasn't found. Check values of bundleName, bundleVersion and connectorName properties." + "\nbundleName:%s\nbundleVersion:%s\nconnectorName:%s"; assertNotNull(info, String.format(MSG, bundleName, bundleVersion, connectorName)); APIConfiguration apiConfig = info.createDefaultAPIConfiguration(); return apiConfig; }
public static APIConfiguration getDefaultConfigurationProperties(DataProvider dataProvider, ConnectorInfoManager manager) throws ObjectNotFoundException { String bundleName = (String) dataProvider.getTestSuiteAttribute("bundleName"); String bundleVersion = (String) dataProvider.getTestSuiteAttribute("bundleVersion"); String connectorName = (String) dataProvider.getTestSuiteAttribute("connectorName"); ConnectorKey key = new ConnectorKey(bundleName, bundleVersion, connectorName); ConnectorInfo info = manager.findConnectorInfo(key); final String MSG = "Connector info wasn't found. Check values of bundleName, bundleVersion and connectorName properties." + "\nbundleName:%s\nbundleVersion:%s\nconnectorName:%s"; assertNotNull(String.format(MSG, bundleName, bundleVersion, connectorName), info); APIConfiguration apiConfig = info.createDefaultAPIConfiguration(); return apiConfig; }
/** * Get contect informations * * @param connectorType * @return * @throws ObjectNotFoundException */ private ConnectorInfo getConnectorInfo(ConnectorType connectorType) throws ObjectNotFoundException { if (!SchemaConstants.ICF_FRAMEWORK_URI.equals(connectorType.getFramework())) { throw new ObjectNotFoundException("Requested connector for framework " + connectorType.getFramework() + " cannot be found in framework " + SchemaConstants.ICF_FRAMEWORK_URI); } ConnectorKey key = getConnectorKey(connectorType); if (connectorType.getConnectorHost() == null && connectorType.getConnectorHostRef() == null) { // Local connector return getLocalConnectorInfoManager().findConnectorInfo(key); } ConnectorHostType host = connectorType.getConnectorHost(); if (host == null) { throw new ObjectNotFoundException( "Attempt to use remote connector without ConnectorHostType resolved (there is only ConnectorHostRef"); } return getRemoteConnectorInfoManager(host).findConnectorInfo(key); }
@Override public Pair<URI, ConnectorInfo> getConnectorInfo(final ConnInstance connInstance) { // check ConnIdLocation URI uriLocation = null; try { uriLocation = URIUtils.buildForConnId(connInstance.getLocation()); } catch (Exception e) { throw new IllegalArgumentException("Invalid ConnId location " + connInstance.getLocation(), e); } // create key for search all properties ConnectorKey key = new ConnectorKey( connInstance.getBundleName(), connInstance.getVersion(), connInstance.getConnectorName()); if (LOG.isDebugEnabled()) { LOG.debug("\nBundle name: " + key.getBundleName() + "\nBundle version: " + key.getBundleVersion() + "\nBundle class: " + key.getConnectorName()); } // get the specified connector ConnectorInfo info = null; if (getConnManagers().containsKey(uriLocation)) { info = getConnManagers().get(uriLocation).findConnectorInfo(key); } if (info == null) { throw new NotFoundException("ConnectorInfo for location " + connInstance.getLocation() + " and key " + key); } return Pair.of(uriLocation, info); }
private APIOperation getAPIOperation(OperationRequest request) throws Exception { ConnectorInfoManager manager = getConnectorInfoManager(); ConnectorInfo info = manager.findConnectorInfo(request.getConnectorKey()); if (info == null) { throw new ConnectorException("No such connector: " + request.getConnectorKey() + " "); } String connectorFacadeKey = request.getConnectorFacadeKey(); ConnectorFacade facade = ConnectorFacadeFactory.getManagedInstance().newInstance(info, connectorFacadeKey); return facade.getOperation(request.getOperation()); }
private APIOperation getAPIOperation(OperationRequest request) throws Exception { ConnectorInfoManager manager = getConnectorInfoManager(); ConnectorInfo info = manager.findConnectorInfo(request.getConnectorKey()); if (info == null) { throw new ConnectorException("No such connector: " + request.getConnectorKey() + " "); } String connectorFacadeKey = request.getConnectorFacadeKey(); ConnectorFacade facade = ConnectorFacadeFactory.getManagedInstance().newInstance(info, connectorFacadeKey); return facade.getOperation(request.getOperation()); }
private APIOperation getAPIOperation(OperationRequest request) throws Exception { ConnectorInfoManager manager = getConnectorInfoManager(); ConnectorInfo info = manager.findConnectorInfo( request.getConnectorKey()); if ( info == null ) { throw new ConnectorException("No such connector: " +request.getConnectorKey()+" "); } APIConfigurationImpl config = request.getConfiguration(); //re-wire the configuration with its connector info config.setConnectorInfo((AbstractConnectorInfo)info); ConnectorFacade facade = ConnectorFacadeFactory.getInstance().newInstance(config); return facade.getOperation(request.getOperation()); }