Java Code Examples for org.apache.brooklyn.util.core.config.ConfigBag#putAll()

The following examples show how to use org.apache.brooklyn.util.core.config.ConfigBag#putAll() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JcloudsLocation.java    From brooklyn-server with Apache License 2.0 6 votes vote down vote up
protected ConfigBag extractWinrmConfig(ConfigBag setup, ConfigBag alt) {
    ConfigBag winrmConfig = new ConfigBag();
    
    for (HasConfigKey<?> key : WinRmMachineLocation.ALL_WINRM_CONFIG_KEYS) {
        String keyName = key.getConfigKey().getName();
        if (setup.containsKey(keyName)) {
            winrmConfig.putStringKey(keyName, setup.getStringKey(keyName));
        } else if (alt.containsKey(keyName)) {
            winrmConfig.putStringKey(keyName, setup.getStringKey(keyName));
        }
    }
    
    Map<String, Object> winrmToolClassProperties = Maps.filterKeys(setup.getAllConfig(), StringPredicates.startsWith(WinRmMachineLocation.WINRM_TOOL_CLASS_PROPERTIES_PREFIX));
    winrmConfig.putAll(winrmToolClassProperties);
    
    return winrmConfig;
}
 
Example 2
Source File: JcloudsPropertiesFromBrooklynProperties.java    From brooklyn-server with Apache License 2.0 6 votes vote down vote up
/**
 * @see LocationPropertiesFromBrooklynProperties#getLocationProperties(String, String, Map)
 */
public Map<String, Object> getJcloudsProperties(String providerOrApi, String regionOrEndpoint, String namedLocation, Map<String, ?> properties) {
    if(Strings.isNullOrEmpty(namedLocation) && Strings.isNullOrEmpty(providerOrApi)) {
        throw new IllegalArgumentException("Neither cloud provider/API nor location name have been specified correctly");
    }

    ConfigBag jcloudsProperties = ConfigBag.newInstance();
    String provider = getProviderName(providerOrApi, namedLocation, properties);
    
    // named properties are preferred over providerOrApi properties
    jcloudsProperties.put(LocationConfigKeys.CLOUD_PROVIDER, provider);
    jcloudsProperties.putAll(transformDeprecated(getGenericLocationSingleWordProperties(properties)));
    jcloudsProperties.putAll(transformDeprecated(getGenericLocationKnownProperties(properties)));
    jcloudsProperties.putAll(transformDeprecated(getGenericJcloudsSingleWordProperties(providerOrApi, properties)));
    jcloudsProperties.putAll(transformDeprecated(getGenericJcloudsKnownProperties(properties)));
    jcloudsProperties.putAll(transformDeprecated(getGenericJcloudsPropertiesPrefixedJclouds(providerOrApi, properties)));
    jcloudsProperties.putAll(transformDeprecated(getProviderOrApiJcloudsProperties(providerOrApi, properties)));
    jcloudsProperties.putAll(transformDeprecated(getRegionJcloudsProperties(providerOrApi, regionOrEndpoint, properties)));
    if (!Strings.isNullOrEmpty(namedLocation)) jcloudsProperties.putAll(transformDeprecated(getNamedJcloudsProperties(namedLocation, properties)));
    setLocalTempDir(properties, jcloudsProperties);

    return jcloudsProperties.getAllConfigRaw();
}
 
Example 3
Source File: LocalhostPropertiesFromBrooklynProperties.java    From brooklyn-server with Apache License 2.0 6 votes vote down vote up
@Override
public Map<String, Object> getLocationProperties(String provider, String namedLocation, Map<String, ?> properties) {
    if (Strings.isNullOrEmpty(namedLocation) && Strings.isNullOrEmpty(provider)) {
        throw new IllegalArgumentException("Neither cloud provider/API nor location name have been specified correctly");
    }

    ConfigBag result = ConfigBag.newInstance();
    
    result.putAll(transformDeprecated(getGenericLocationSingleWordProperties(properties)));
    result.putAll(transformDeprecated(getMatchingSingleWordProperties("brooklyn.location.", properties)));
    result.putAll(transformDeprecated(getMatchingProperties("brooklyn.location.localhost.", "brooklyn.localhost.", properties)));
    if (!Strings.isNullOrEmpty(namedLocation)) result.putAll(transformDeprecated(getNamedLocationProperties(namedLocation, properties)));
    setLocalTempDir(properties, result);
    
    return result.getAllConfigRaw();
}
 
Example 4
Source File: DefaultAzureArmNetworkCreatorTest.java    From brooklyn-server with Apache License 2.0 5 votes vote down vote up
protected ConfigBag runVanilla(Map<?, ?> additionalConfig) throws Exception {
    //Setup config bag
    ConfigBag configBag = ConfigBag.newInstance();
    configBag.putAll(additionalConfig);
    configBag.put(CLOUD_REGION_ID, TEST_LOCATION);

    //Setup mocks
    when(subnetApi.get(TEST_SUBNET_NAME)).thenReturn(null).thenReturn(subnet); //null first time, subnet next
    when(resourceGroupApi.get(TEST_RESOURCE_GROUP)).thenReturn(null);
    when(subnet.properties().provisioningState()).thenReturn("Updating").thenReturn("Succeeded");



    //Test
    DefaultAzureArmNetworkCreator.createDefaultNetworkAndAddToTemplateOptionsIfRequired(computeService, configBag);

    //verify calls made
    verify(subnet).id();
    verify(subnetApi, atLeast(2)).get(TEST_SUBNET_NAME);

    verify(resourceGroupApi).get(TEST_RESOURCE_GROUP);
    verify(resourceGroupApi).create(eq(TEST_RESOURCE_GROUP), eq(TEST_LOCATION), any());

    verify(virtualNetworkApi).createOrUpdate(eq(TEST_NETWORK_NAME), eq(TEST_LOCATION), any(), any());

    //verify templateOptions updated to include defaults
    Map<String, Object> templateOptions = configBag.get(TEMPLATE_OPTIONS);
    Map<String, Object> ipOptions = (Map<String, Object>) ((List)templateOptions.get("ipOptions")).iterator().next();
    assertEquals(ipOptions.get("subnet"), TEST_SUBNET_ID);
    assertEquals(ipOptions.get("allocateNewPublicIp"), true);
    
    return configBag;
}
 
Example 5
Source File: SoftwareProcessImpl.java    From brooklyn-server with Apache License 2.0 5 votes vote down vote up
protected Map<String,Object> obtainProvisioningFlags(MachineProvisioningLocation location) {
    ConfigBag result = ConfigBag.newInstance(location.getProvisioningFlags(ImmutableList.of(getClass().getName())));

    // copy provisioning properties raw in case they contain deferred values
    // normal case is to have provisioning.properties.xxx in the map, so this is how we get it
    Map<String, Object> raw1 = PROVISIONING_PROPERTIES.rawValue(config().getBag().getAllConfigRaw());
    // do this also, just in case a map is stored at the key itself (not sure this is needed, raw1 may include it already)
    Maybe<Object> raw2 = config().getRaw(PROVISIONING_PROPERTIES);
    if (raw2.isPresentAndNonNull()) {
        Object pp = raw2.get();
        if (!(pp instanceof Map)) {
            LOG.debug("When obtaining provisioning properties for "+this+" to deploy to "+location+", detected that coercion was needed, so coercing sooner than we would otherwise");
            pp = config().get(PROVISIONING_PROPERTIES);
        }
        result.putAll((Map<?,?>)pp);
    }
    // finally write raw1 on top
    result.putAll(raw1);

    if (result.get(CloudLocationConfig.INBOUND_PORTS) == null) {
        Collection<Integer> ports = getRequiredOpenPorts();
        Object requiredPorts = result.get(CloudLocationConfig.ADDITIONAL_INBOUND_PORTS);
        if (requiredPorts instanceof Integer) {
            ports.add((Integer) requiredPorts);
        } else if (requiredPorts instanceof Iterable) {
            for (Object o : (Iterable<?>) requiredPorts) {
                if (o instanceof Integer) ports.add((Integer) o);
            }
        }
        if (ports != null && ports.size() > 0) result.put(CloudLocationConfig.INBOUND_PORTS, ports);
    }
    result.put(LocationConfigKeys.CALLER_CONTEXT, this);
    return result.getAllConfigMutable();
}
 
Example 6
Source File: BrooklynClusterUpgradeEffectorBody.java    From brooklyn-server with Apache License 2.0 5 votes vote down vote up
@Override
public Void call(ConfigBag parameters) {
    if (!upgradeInProgress.compareAndSet(false, true)) {
        throw new IllegalStateException("An upgrade is already in progress.");
    }

    EntitySpec<?> origMemberSpec = entity().getConfig(BrooklynCluster.MEMBER_SPEC);
    Preconditions.checkNotNull(origMemberSpec, BrooklynCluster.MEMBER_SPEC.getName() + " is required for " + UpgradeClusterEffector.class.getName());

    log.debug("Upgrading "+entity()+", changing "+BrooklynCluster.MEMBER_SPEC+" from "+origMemberSpec+" / "+origMemberSpec.getConfig());

    boolean success = false;
    try {
        String newDownloadUrl = parameters.get(DOWNLOAD_URL);
        
        EntitySpec<?> newMemberSpec = EntitySpec.create(origMemberSpec);
        
        ConfigBag newConfig = ConfigBag.newInstance();
        newConfig.putIfNotNull(DOWNLOAD_URL, newDownloadUrl);
        newConfig.put(BrooklynNode.DISTRO_UPLOAD_URL, inferUploadUrl(newDownloadUrl));
        newConfig.putAll(ConfigBag.newInstance(parameters.get(EXTRA_CONFIG)).getAllConfigAsConfigKeyMap());
        newMemberSpec.configure(newConfig.getAllConfigAsConfigKeyMap());
        
        entity().config().set(BrooklynCluster.MEMBER_SPEC, newMemberSpec);
        
        log.debug("Upgrading "+entity()+", new "+BrooklynCluster.MEMBER_SPEC+": "+newMemberSpec+" / "+newMemberSpec.getConfig()+" (adding: "+newConfig+")");
        
        upgrade(parameters);

        success = true;
    } finally {
        if (!success) {
            log.debug("Upgrading "+entity()+" failed, will rethrow after restoring "+BrooklynCluster.MEMBER_SPEC+" to: "+origMemberSpec);
            entity().config().set(BrooklynCluster.MEMBER_SPEC, origMemberSpec);
        }
        
        upgradeInProgress.set(false);
    }
    return null;
}
 
Example 7
Source File: AbstractCloudMachineProvisioningLocation.java    From brooklyn-server with Apache License 2.0 5 votes vote down vote up
protected ConfigBag extractSshConfig(ConfigBag setup, ConfigBag alt) {
    ConfigBag sshConfig = new ConfigBag();
    
    for (HasConfigKey<?> key : SshMachineLocation.ALL_SSH_CONFIG_KEYS) {
        String keyName = key.getConfigKey().getName();
        if (setup.containsKey(keyName)) {
            sshConfig.putStringKey(keyName, setup.getStringKey(keyName));
        } else if (alt.containsKey(keyName)) {
            sshConfig.putStringKey(keyName, setup.getStringKey(keyName));
        }
    }
    
    Map<String, Object> sshToolClassProperties = Maps.filterKeys(setup.getAllConfig(), StringPredicates.startsWith(SshMachineLocation.SSH_TOOL_CLASS_PROPERTIES_PREFIX));
    sshConfig.putAll(sshToolClassProperties);

    // Special cases (preserving old code!)
    if (setup.containsKey(PASSWORD)) {
        sshConfig.copyKeyAs(setup, PASSWORD, SshTool.PROP_PASSWORD);
    } else if (alt.containsKey(PASSWORD)) {
        sshConfig.copyKeyAs(alt, PASSWORD, SshTool.PROP_PASSWORD);
    }
    
    if (setup.containsKey(PRIVATE_KEY_DATA)) {
        sshConfig.copyKeyAs(setup, PRIVATE_KEY_DATA, SshTool.PROP_PRIVATE_KEY_DATA);
    } else if (setup.containsKey(PRIVATE_KEY_FILE)) {
        sshConfig.copyKeyAs(setup, PRIVATE_KEY_FILE, SshTool.PROP_PRIVATE_KEY_FILE);
    } else if (alt.containsKey(PRIVATE_KEY_DATA)) {
        sshConfig.copyKeyAs(setup, PRIVATE_KEY_DATA, SshTool.PROP_PRIVATE_KEY_DATA);
    }
    
    if (setup.containsKey(PRIVATE_KEY_PASSPHRASE)) {
        // NB: not supported in jclouds (but it is by our ssh tool)
        sshConfig.copyKeyAs(setup, PRIVATE_KEY_PASSPHRASE, SshTool.PROP_PRIVATE_KEY_PASSPHRASE);
    }

    return sshConfig;
}
 
Example 8
Source File: LocationPropertiesFromBrooklynProperties.java    From brooklyn-server with Apache License 2.0 5 votes vote down vote up
/**
 * Finds the properties that apply to location, stripping off the prefixes.
 * 
 * Order of preference (in ascending order) is:
 * <ol>
 * <li>brooklyn.location.*
 * <li>brooklyn.location.provider.*
 * <li>brooklyn.location.named.namedlocation.*
 * </ol>
 * <p>
 * Converts deprecated hyphenated properties to the non-deprecated camelCase format. 
 */
public Map<String, Object> getLocationProperties(String provider, String namedLocation, Map<String, ?> properties) {
    ConfigBag result = ConfigBag.newInstance();
    
    if (!Strings.isNullOrEmpty(provider)) 
        result.put(LocationConfigKeys.CLOUD_PROVIDER, provider);
    // named properties are preferred over providerOrApi properties
    result.putAll(transformDeprecated(getGenericLocationSingleWordProperties(properties)));
    if (!Strings.isNullOrEmpty(provider)) result.putAll(transformDeprecated(getScopedLocationProperties(provider, properties)));
    if (!Strings.isNullOrEmpty(namedLocation)) result.putAll(transformDeprecated(getNamedLocationProperties(namedLocation, properties)));
    
    setLocalTempDir(properties, result);
    
    return result.getAllConfigRaw();
}
 
Example 9
Source File: BrooklynNodeUpgradeEffectorBody.java    From brooklyn-server with Apache License 2.0 4 votes vote down vote up
@Override
public Void call(ConfigBag parametersO) {
    if (!isPersistenceModeEnabled(entity())) {
        // would could try a `forcePersistNow`, but that's sloppy; 
        // for now, require HA/persistence for upgrading
        DynamicTasks.queue( Tasks.warning("Check persistence", 
            new IllegalStateException("Persistence does not appear to be enabled at this cluster. "
            + "In-place node upgrade will not succeed unless a custom launch script enables it.")) );
    }

    final ConfigBag parameters = ConfigBag.newInstanceCopying(parametersO);

    /*
     * all parameters are passed to children, apart from EXTRA_CONFIG
     * whose value (as a map) is so passed; it provides an easy way to set extra config in the gui.
     * (IOW a key-value mapping can be passed either inside EXTRA_CONFIG or as a sibling to EXTRA_CONFIG)  
     */
    if (parameters.containsKey(EXTRA_CONFIG)) {
        Map<String, Object> extra = parameters.get(EXTRA_CONFIG);
        parameters.remove(EXTRA_CONFIG);
        parameters.putAll(extra);
    }
    log.debug(this+" upgrading, using "+parameters);
    
    final String bkName;
    boolean doDryRunFirst = parameters.get(DO_DRY_RUN_FIRST);
    if(doDryRunFirst) {
        bkName = dryRunUpdate(parameters);
    } else {
        bkName = "direct-"+Identifiers.makeRandomId(4);
    }
    
    // Stop running instance
    DynamicTasks.queue(Tasks.builder().displayName("shutdown node")
            .add(Effectors.invocation(entity(), BrooklynNode.STOP_NODE_BUT_LEAVE_APPS, ImmutableMap.of(StopSoftwareParameters.STOP_MACHINE_MODE, StopMode.NEVER)))
            .build());

    // backup old files
    DynamicTasks.queue(Tasks.builder().displayName("backup old version").body(new Runnable() {
        @Override
        public void run() {
            String runDir = entity().getAttribute(SoftwareProcess.RUN_DIR);
            String bkDir = Urls.mergePaths(runDir, "..", Urls.getBasename(runDir)+"-backups", bkName);
            log.debug(this+" storing backup of previous version in "+bkDir);
            DynamicTasks.queue(SshEffectorTasks.ssh(
                "cd "+runDir,
                "mkdir -p "+bkDir,
                "mv * "+bkDir
                // By removing the run dir of the entity we force it to go through
                // the customize step again on start and re-generate local-brooklyn.properties.
                ).summary("move files"));
        }
    }).build());
    
    // Reconfigure entity
    DynamicTasks.queue(Tasks.builder().displayName("reconfigure").body(new Runnable() {
        @Override
        public void run() {
            DynamicTasks.waitForLast();
            entity().sensors().set(SoftwareProcess.INSTALL_DIR, (String)null);
            entity().config().set(SoftwareProcess.INSTALL_UNIQUE_LABEL, (String)null);
            entity().config().putAll(parameters.getAllConfig());
            entity().sensors().set(BrooklynNode.DOWNLOAD_URL, entity().getConfig(DOWNLOAD_URL));

            // Setting SUGGESTED_VERSION will result in an new empty INSTALL_FOLDER, but clear it
            // just in case the user specified already installed version.
            ((BrooklynNodeDriver)((DriverDependentEntity<?>)entity()).getDriver()).clearInstallDir();
        }
    }).build());
    
    // Start this entity, running the new version.
    // This will download and install the new dist (if not already done by the dry run node).
    DynamicTasks.queue(Effectors.invocation(entity(), BrooklynNode.START, ConfigBag.EMPTY));

    return null;
}
 
Example 10
Source File: WinRmMachineLocation.java    From brooklyn-server with Apache License 2.0 4 votes vote down vote up
protected WinRmTool newWinRmTool(Map<?,?> props) {
    // TODO See comments/TODOs in SshMachineLocation.connectSsh()
    try {
        ConfigBag args = new ConfigBag();

        for (Map.Entry<ConfigKey<?>, ?> entry: config().getBag().getAllConfigAsConfigKeyMap().entrySet()) {

            boolean include = false;
            String keyName = entry.getKey().getName();
            if (keyName.startsWith(WinRmTool.BROOKLYN_CONFIG_KEY_PREFIX)) {
                keyName = Strings.removeFromStart(keyName, WinRmTool.BROOKLYN_CONFIG_KEY_PREFIX);
                include = true;
            }
            
            if (keyName.startsWith(WINRM_TOOL_CLASS_PROPERTIES_PREFIX)) {
                keyName = Strings.removeFromStart(keyName, WINRM_TOOL_CLASS_PROPERTIES_PREFIX);
                include = true;
            }
            
            if (ALL_WINRM_CONFIG_KEY_NAMES.contains(keyName)) {
                // key should be included, and does not need to be changed

                // TODO make this config-setting mechanism more universal
                // currently e.g. it will not admit a tool-specific property.
                // thinking either we know about the tool here,
                // or we don't allow unadorned keys to be set
                // (require use of BROOKLYN_CONFIG_KEY_PREFIX)
                include = true;
            }

            if (include) {
                args.putStringKey(keyName, config().get(entry.getKey()));
            }
        }
        
        args.putAll(props);
        args.configure(SshTool.PROP_HOST, getAddress().getHostAddress());
        args.configure(WinRmTool.USE_NTLM, getConfig(WinRmMachineLocation.USE_NTLM));
        args.configure(WinRmTool.PROP_PORT, getPort());

        if (LOG.isTraceEnabled()) LOG.trace("creating WinRM session for "+Sanitizer.sanitize(args));

        // look up tool class
        String toolClass = args.get(WINRM_TOOL_CLASS);
        if (toolClass == null) toolClass = Winrm4jTool.class.getName();
        WinRmTool tool = (WinRmTool) new ClassLoaderUtils(this, getManagementContext()).loadClass(toolClass).getConstructor(Map.class).newInstance(args.getAllConfig());
        if (tool instanceof ManagementContextInjectable) {
            ((ManagementContextInjectable)tool).setManagementContext(getManagementContext());
        }

        if (LOG.isTraceEnabled()) LOG.trace("using ssh-tool {} (of type {}); props ", tool, toolClass);

        return tool;
    } catch (Exception e) {
        throw Exceptions.propagate(e);
    }
}
 
Example 11
Source File: SshMachineLocation.java    From brooklyn-server with Apache License 2.0 4 votes vote down vote up
protected SshTool connectSsh(Map<?,?> props) {
    try {
        if (!groovyTruth(user)) {
            String newUser = getUser();
            if (LOG.isTraceEnabled()) LOG.trace("For "+this+", setting user in connectSsh: oldUser="+user+"; newUser="+newUser);
            user = newUser;
        }

        ConfigBag args = new ConfigBag()
            .configure(SshTool.PROP_USER, user)
            // default value of host, overridden if SSH_HOST is supplied
            .configure(SshTool.PROP_HOST, address.getHostName());

        for (Map.Entry<ConfigKey<?>, ?> entry: config().getBag().getAllConfigAsConfigKeyMap().entrySet()) {
            boolean include = false;
            String keyName = entry.getKey().getName();
            if (keyName.startsWith(SshTool.BROOKLYN_CONFIG_KEY_PREFIX)) {
                keyName = Strings.removeFromStart(keyName, SshTool.BROOKLYN_CONFIG_KEY_PREFIX);
                include = true;
            }
            
            if (keyName.startsWith(SSH_TOOL_CLASS_PROPERTIES_PREFIX)) {
                keyName = Strings.removeFromStart(keyName, SSH_TOOL_CLASS_PROPERTIES_PREFIX);
                include = true;
            }
            
            if (ALL_SSH_CONFIG_KEY_NAMES.contains(keyName)) {
                // key should be included, and does not need to be changed

                // TODO make this config-setting mechanism more universal
                // currently e.g. it will not admit a tool-specific property.
                // thinking either we know about the tool here,
                // or we don't allow unadorned keys to be set
                // (require use of BROOKLYN_CONFIG_KEY_PREFIX)
                include = true;
            }
            
            if (include) {
                args.putStringKey(keyName, config().get(entry.getKey()));
            }
        }

        // Explicit props trump all.
        args.putAll(props);

        if (LOG.isTraceEnabled()) LOG.trace("creating ssh session for "+Sanitizer.sanitize(args));
        if (!user.equals(args.get(SshTool.PROP_USER))) {
            LOG.warn("User mismatch configuring ssh for "+this+": preferring user "+args.get(SshTool.PROP_USER)+" over "+user);
            user = args.get(SshTool.PROP_USER);
        }

        // look up tool class
        String sshToolClass = args.get(SSH_TOOL_CLASS);
        String legacySshToolClass = args.get(SshTool.PROP_TOOL_CLASS);
        if (Strings.isNonBlank(legacySshToolClass)) {
            String msg;
            if (Strings.isNonBlank(sshToolClass)) {
                msg = "Ignoring deprecated config "+SshTool.PROP_TOOL_CLASS.getName()+"="+legacySshToolClass
                        +", preferring "+SSH_TOOL_CLASS.getName()+"="+sshToolClass+" for "+SshMachineLocation.this;
                
            } else {
                sshToolClass = legacySshToolClass;
                msg = "Using deprecated config "+SshTool.PROP_TOOL_CLASS.getName()+"="+legacySshToolClass
                        +", preferring "+SSH_TOOL_CLASS.getName()+"="+sshToolClass+" for "+SshMachineLocation.this;
            }
            if (!loggedLegcySshToolClassConfig) {
                LOG.warn(msg);
                loggedLegcySshToolClassConfig = true;
            }
        }
        if (sshToolClass==null) sshToolClass = SshjTool.class.getName();
        SshTool ssh = (SshTool) new ClassLoaderUtils(this, getManagementContext()).loadClass(sshToolClass).getConstructor(Map.class).newInstance(args.getAllConfig());

        if (LOG.isTraceEnabled()) LOG.trace("using ssh-tool {} (of type {}); props ", ssh, sshToolClass);

        Tasks.setBlockingDetails("Opening ssh connection");
        try { ssh.connect(); } finally { Tasks.setBlockingDetails(null); }
        previouslyConnected = true;
        return ssh;
    } catch (Exception e) {
        if (previouslyConnected) throw Throwables.propagate(e);
        // subsequence connection (above) most likely network failure, our remarks below won't help
        // on first connection include additional information if we can't connect, to help with debugging
        String rootCause = Throwables.getRootCause(e).getMessage();
        throw new IllegalStateException("Cannot establish ssh connection to "+user+" @ "+this+
                (rootCause!=null && !rootCause.isEmpty() ? " ("+rootCause+")" : "")+". \n"+
                "Ensure that passwordless and passphraseless ssh access is enabled using standard keys from ~/.ssh or " +
                "as configured in brooklyn.properties. " +
                "Check that the target host is accessible, " +
                "that credentials are correct (location and permissions if using a key), " +
                "that the SFTP subsystem is available on the remote side, " +
                "and that there is sufficient random noise in /dev/random on both ends. " +
                "To debug less common causes, see the original error in the trace or log, and/or enable 'net.schmizz' (sshj) logging."
                , e);
    }
}
 
Example 12
Source File: AbstractConfigMapImpl.java    From brooklyn-server with Apache License 2.0 4 votes vote down vote up
protected ConfigBag putAllOwnConfigIntoSafely(ConfigBag bag) {
    synchronized (ownConfig) {
        return bag.putAll(ownConfig);
    }
}