@Override public String getConnectorId() { return getTarget().getConnectorId(); }
/** * Load a connector from the give connection or from the underlying storage * if the connector is referenced by id. */ default Optional<Connector> loadConnector(Connection connection) { final Optional<Connector> connector; if (connection.getConnector().isPresent()) { connector = connection.getConnector(); } else { connector = loadConnector(connection.getConnectorId()); } return connector; }
private Connection includeConnector(Connection connection) { if (connection == null) { return connection; } Optional<Connector> connectorOptional = connection.getConnector(); if (connectorOptional != null && connectorOptional.isPresent()) { return connection; } Connector connector = getDataManager().fetch(Connector.class, connection.getConnectorId()); if (connector == null) { return connection; } Connection.Builder builder = new Connection.Builder(); return builder.createFrom(connection) .connector(connector) .build(); }
Connector newConnector = dataManager.fetch(Connector.class, connection.getConnectorId()); if (newConnector == null) { messages.add(
public Connection apply(final Connection updatedConnection, final CredentialFlowState flowState) { final CredentialProvider credentialProvider = providerFrom(flowState); final Connection withDerivedFlag = new Connection.Builder().createFrom(updatedConnection).isDerived(true).build(); final Connection appliedConnection = credentialProvider.applyTo(withDerivedFlag, flowState); final Map<String, String> configuredProperties = appliedConnection.getConfiguredProperties(); final Map<String, ConfigurationProperty> properties = updatedConnection.getConnector() .orElseGet(() -> dataManager.fetch(Connector.class, updatedConnection.getConnectorId())).getProperties(); final Map<String, String> encryptedConfiguredProperties = encryptionComponent.encryptPropertyValues(configuredProperties, properties); return new Connection.Builder().createFrom(appliedConnection).configuredProperties(encryptedConfiguredProperties).build(); }
pair(one.getOrganization(), another.getOrganization(), "organization"), pair(one.getOrganizationId(), another.getOrganizationId(), "organization-id"), pair(one.getConnectorId(), another.getConnectorId(), "connector-id"), pair(one.getOptions(), another.getOptions(), "options"), pair(one.getIcon(), another.getIcon(), "icon"),