/** creates a {@link Navigator} backed by a newly created map; * the map can be accessed by {@link Navigator#getMap()} */ public static Navigator<MutableMap<Object,Object>> newInstance() { return new Navigator<MutableMap<Object,Object>>(new MutableMap<Object,Object>(), MutableMap.class); } /** convenience for {@link Navigator#at(Object, Object...)} on a {@link #newInstance()} */
@Override public FixedListMachineProvisioningLocation<SshMachineLocation> newLocationFromString(Map properties, String spec) { return newLocationFromString(spec, null, properties, new MutableMap()); }
public static <K,V> MutableMap<K,V> of(K k1, V v1) { MutableMap<K,V> result = new MutableMap<K,V>(); result.put(k1, v1); return result; }
@SuppressWarnings("rawtypes") @Override public Location newLocationFromString(Map properties, String spec) { return newLocationFromString(spec, null, properties, new MutableMap()); }
public static <K,V> MutableMap<K,V> copyOf(@Nullable Map<? extends K, ? extends V> orig) { MutableMap<K,V> result = new MutableMap<K,V>(); if (orig!=null) result.putAll(orig); return result; }
@Override public Location newLocationFromString(Map properties, String spec) { return newLocationFromString(spec, null, properties, new MutableMap()); }
@Override public final Location resolve(String spec) { return resolve(spec, new MutableMap()); }
@Override public Location newLocationFromString(Map properties, String spec) { return newLocationFromString(spec, null, properties, new MutableMap()); }
@Override public JcloudsLocation newLocationFromString(Map properties, String spec) { return newLocationFromString(spec, null, properties, new MutableMap()); }
@Override public FixedListMachineProvisioningLocation<JcloudsSshMachineLocation> newLocationFromString(Map properties, String spec) { return newLocationFromString(spec, null, properties, new MutableMap()); }
@Override public Location newLocationFromString(Map properties, String spec) { return newLocationFromString(spec, null, properties, new MutableMap()); }
@Override public int execCommands(Map<String,?> props, List<String> commands, Map<String,?> env) { Map<String,Object> props2 = new MutableMap<String,Object>(); if (props!=null) props2.putAll(props); props2.put(SshTool.PROP_NO_EXTRA_OUTPUT.getName(), true); return execScript(props2, commands, env); }
public static <K,V> MutableMap<K,V> of(K k1, V v1, K k2, V v2) { MutableMap<K,V> result = new MutableMap<K,V>(); result.put(k1, v1); result.put(k2, v2); return result; }
public static <K,V> MutableMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3) { MutableMap<K,V> result = new MutableMap<K,V>(); result.put(k1, v1); result.put(k2, v2); result.put(k3, v3); return result; }
public static <K,V> MutableMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3,K k4, V v4) { MutableMap<K,V> result = new MutableMap<K,V>(); result.put(k1, v1); result.put(k2, v2); result.put(k3, v3); result.put(k4, v4); return result; }
public static <K,V> MutableMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3,K k4, V v4,K k5, V v5) { MutableMap<K,V> result = new MutableMap<K,V>(); result.put(k1, v1); result.put(k2, v2); result.put(k3, v3); result.put(k4, v4); result.put(k5, v5); return result; }
public static <K,V> MutableMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3,K k4, V v4,K k5, V v5,K k6,V v6) { MutableMap<K,V> result = new MutableMap<K,V>(); result.put(k1, v1); result.put(k2, v2); result.put(k3, v3); result.put(k4, v4); result.put(k5, v5); result.put(k6, v6); return result; }
public Location resolveLocationDefinition(LocationDefinition ld, Map locationFlags, String optionalName) { MutableMap newLocationFlags = new MutableMap().add(locationFlags).add(ld.getConfig()); if (optionalName==null && ld.getName()!=null) optionalName = ld.getName(); if (optionalName!=null) newLocationFlags.add("named", optionalName); try { return resolve(ld.getSpec(), newLocationFlags); } catch (Exception e) { throw new IllegalStateException("Cannot instantiate named location '"+optionalName+"' pointing at "+ld.getSpec()+": "+e, e); } }
public static <K,V> MutableMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3,K k4, V v4,K k5, V v5,K k6,V v6,K k7,V v7) { MutableMap<K,V> result = new MutableMap<K,V>(); result.put(k1, v1); result.put(k2, v2); result.put(k3, v3); result.put(k4, v4); result.put(k5, v5); result.put(k6, v6); result.put(k7, v7); return result; }
public static LinkWithMetadata asLink(Task<?> t) { if (t==null) return null; MutableMap<String,Object> data = new MutableMap<String,Object>(); data.put("id", t.getId()); if (t.getDisplayName()!=null) data.put("taskName", t.getDisplayName()); Entity entity = BrooklynTasks.getContextEntity(t); if (entity!=null) { data.put("entityId", entity.getId()); if (entity.getDisplayName()!=null) data.put("entityDisplayName", entity.getDisplayName()); } return new LinkWithMetadata("/v1/activities/"+t.getId(), data); }