@Override public final String getConnectorDisplayName() { return messages.format(connectorDisplayNameKey, connectorKey.getConnectorName()); }
@Override public final String getConnectorDisplayName() { return messages.format(connectorDisplayNameKey, connectorKey.getConnectorName()); }
private String getConnctorDesc(ConnectorInfo connectorInfo) { return connectorInfo.getConnectorKey().getConnectorName(); }
public final String getConnectorDisplayName() { return _messages.format(_connectorDisplayNameKey, _connectorKey.getConnectorName()); }
/** * Converts ICF connector key to a simple string. * * The string may be used as an OID. */ private String keyToNamespaceSuffix(ConnectorKey key) { StringBuilder sb = new StringBuilder(); sb.append(key.getBundleName()); sb.append(CONNECTOR_IDENTIFIER_SEPARATOR); // Don't include version. It is lesser evil. // sb.append(key.getBundleVersion()); // sb.append(CONNECTOR_IDENTIFIER_SEPARATOR); sb.append(key.getConnectorName()); return sb.toString(); }
/** * Constructs a prototypical Event. * * @param source The object on which the Event initially occurred. * @throws IllegalArgumentException if source is null. */ public ConnectorEvent(String topic, ConnectorKey source) { super(source); this.topic = topic; properties = new HashMap<>(2); properties.put(ConnectorEvent.CONNECTOR_BUNDLE_NAME, source.getBundleName()); properties.put(ConnectorEvent.CONNECTOR_VERSION, source.getBundleVersion()); properties.put(ConnectorEvent.CONNECTOR_NAME, source.getConnectorName()); }
/** * Constructs a prototypical Event. * * @param source The object on which the Event initially occurred. * @throws IllegalArgumentException if source is null. */ public ConnectorEvent(String topic, ConnectorKey source) { super(source); this.topic = topic; properties = new HashMap<>(2); properties.put(ConnectorEvent.CONNECTOR_BUNDLE_NAME, source.getBundleName()); properties.put(ConnectorEvent.CONNECTOR_VERSION, source.getBundleVersion()); properties.put(ConnectorEvent.CONNECTOR_NAME, source.getConnectorName()); }
@PreAuthorize("hasRole('" + StandardEntitlement.CONNECTOR_READ + "')") @Transactional(readOnly = true) public List<ConnBundleTO> getBundles(final String lang) { if (StringUtils.isBlank(lang)) { CurrentLocale.set(Locale.ENGLISH); } else { CurrentLocale.set(new Locale(lang)); } List<ConnBundleTO> connectorBundleTOs = new ArrayList<>(); connIdBundleManager.getConnInfoManagers().forEach((uri, cim) -> { connectorBundleTOs.addAll(cim.getConnectorInfos().stream().map(bundle -> { ConnBundleTO connBundleTO = new ConnBundleTO(); connBundleTO.setDisplayName(bundle.getConnectorDisplayName()); connBundleTO.setLocation(uri.toString()); ConnectorKey key = bundle.getConnectorKey(); connBundleTO.setBundleName(key.getBundleName()); connBundleTO.setConnectorName(key.getConnectorName()); connBundleTO.setVersion(key.getBundleVersion()); ConfigurationProperties properties = connIdBundleManager.getConfigurationProperties(bundle); connBundleTO.getProperties().addAll(properties.getPropertyNames().stream(). map(propName -> binder.build(properties.getProperty(propName))).collect(Collectors.toList())); return connBundleTO; }).collect(Collectors.toList())); }); return connectorBundleTOs; }
@Override public void serialize(final Object object, final ObjectEncoder encoder) { final ConnectorKey val = (ConnectorKey) object; encoder.writeStringField("bundleName", val.getBundleName()); encoder.writeStringField("bundleVersion", val.getBundleVersion()); encoder.writeStringField("connectorName", val.getConnectorName()); } });
@Override public void serialize(final Object object, final ObjectEncoder encoder) { final ConnectorKey val = (ConnectorKey) object; encoder.writeStringField("bundleName", val.getBundleName()); encoder.writeStringField("bundleVersion", val.getBundleVersion()); encoder.writeStringField("connectorName", val.getConnectorName()); } });
@Override public void serialize(final Object object, final ObjectEncoder encoder) { final ConnectorKey val = (ConnectorKey) object; encoder.writeStringField("bundleName", val.getBundleName()); encoder.writeStringField("bundleVersion", val.getBundleVersion()); encoder.writeStringField("connectorName", val.getConnectorName()); } });
@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); }
ConnectorType connectorType = new ConnectorType(); ConnectorKey key = cinfo.getConnectorKey(); UcfUtil.addConnectorNames(connectorType, "ConnId", key.getBundleName(), key.getConnectorName(), key.getBundleVersion(), hostType); String stringID = keyToNamespaceSuffix(key); connectorType.setFramework(SchemaConstants.ICF_FRAMEWORK_URI); connectorType.setConnectorType(key.getConnectorName()); connectorType.setNamespace(ICF_CONFIGURATION_NAMESPACE_PREFIX + stringID); connectorType.setConnectorVersion(key.getBundleVersion());