/** * Gets the property. * * @param propertyName the property name * * @return the property */ public String getProperty(String propertyName) { ParameterCheck.mandatory("propertyName", propertyName); return (String)getProperties().get(propertyName); }
/** * Creates a Scriptable Map for a given map of model objects * * @param context the context * @param objects a map of model objects (keyed by object id) * * @return the scriptable map */ public static ScriptableMap toScriptableMap(RequestContext context, Map<String, ModelObject> objects) { ScriptableMap<String, Serializable> map = new ScriptableLinkedHashMap<String, Serializable>(objects.size()); // convert to map of script model objects Iterator it = objects.keySet().iterator(); while (it.hasNext()) { String id = (String) it.next(); ModelObject modelObject = (ModelObject) objects.get(id); ScriptModelObject scriptModelObject = toScriptModelObject(context, modelObject); map.put(id, scriptModelObject); } return map; }
public void remove(String name) { if (modelObject instanceof ResourceProvider) { ResourceProvider provider = (ResourceProvider) modelObject; provider.removeResource(name); // update properties this.properties.remove(name); } }
Iterator it = getProperties().keySet().iterator(); while (it.hasNext()) ScriptCredentials scriptCredentials = (ScriptCredentials) getProperties().get(endpointId); Iterator it2 = scriptCredentials.getProperties().keySet().iterator(); while (it2.hasNext()) Object propertyValue = scriptCredentials.getProperties().get(propertyKey);
/** * Creates new credentials and binds them into this vault. * If the credentials already exist, the old ones will be returned * * @param endpointId String * @return ScriptCredentials */ public ScriptCredentials newCredentials(String endpointId) { ScriptCredentials scriptCredentials = (ScriptCredentials) getProperties().get(endpointId); if (scriptCredentials == null) { Credentials creds = this.vault.newCredentials(endpointId); // update our properties map scriptCredentials = new ScriptCredentials(this.vault, creds); getProperties().put(endpointId, scriptCredentials); } return scriptCredentials; }
/** * Returns whether the given endpoint credentials are stored on this vault * * @param endpointId String * @return boolean */ public boolean hasCredentials(String endpointId) { return getProperties().containsKey(endpointId); }
protected ScriptableMap buildProperties() { if (this.properties == null) { this.properties = new ScriptableWrappedMap(context.getValuesMap()); this.properties.putAll(context.getParameters()); } return this.properties; }
/** * Creates new credentials and binds them into this vault. * If the credentials already exist, the old ones will be returned * * @param endpointId String * @return ScriptCredentials */ public ScriptCredentials newCredentials(String endpointId) { ScriptCredentials scriptCredentials = (ScriptCredentials) getProperties().get(endpointId); if (scriptCredentials == null) { Credentials creds = this.vault.newCredentials(endpointId); // update our properties map scriptCredentials = new ScriptCredentials(this.vault, creds); getProperties().put(endpointId, scriptCredentials); } return scriptCredentials; }
/** * Returns whether the given endpoint credentials are stored on this vault * * @param endpointId String * @return boolean */ public boolean hasCredentials(String endpointId) { return getProperties().containsKey(endpointId); }
protected ScriptableMap buildProperties() { if (this.properties == null) { this.properties = new ScriptableWrappedMap(context.getValuesMap()); this.properties.putAll(context.getParameters()); } return this.properties; }
/** * Creates a Scriptable Map for a given map of model objects * * @param context the context * @param objects a map of model objects (keyed by object id) * * @return the scriptable map */ public static ScriptableMap toScriptableMap(RequestContext context, Map<String, ModelObject> objects) { ScriptableMap<String, Serializable> map = new ScriptableLinkedHashMap<String, Serializable>(objects.size()); // convert to map of script model objects Iterator it = objects.keySet().iterator(); while (it.hasNext()) { String id = (String) it.next(); ModelObject modelObject = (ModelObject) objects.get(id); ScriptModelObject scriptModelObject = toScriptModelObject(context, modelObject); map.put(id, scriptModelObject); } return map; }
Iterator it = getProperties().keySet().iterator(); while (it.hasNext()) ScriptCredentials scriptCredentials = (ScriptCredentials) getProperties().get(endpointId); Iterator it2 = scriptCredentials.getProperties().keySet().iterator(); while (it2.hasNext()) Object propertyValue = scriptCredentials.getProperties().get(propertyKey);
/** * Creates new credentials and binds them into this vault. * If the credentials already exist, the old ones will be returned * * @param endpointId * @return */ public ScriptCredentials newCredentials(String endpointId) { ScriptCredentials scriptCredentials = (ScriptCredentials) getProperties().get(endpointId); if (scriptCredentials == null) { Credentials creds = this.vault.newCredentials(endpointId); this.vault.save(); // update our properties map scriptCredentials = new ScriptCredentials(this.vault, creds); getProperties().put(endpointId, scriptCredentials); } return scriptCredentials; }
public void remove(String name) { if (modelObject instanceof ResourceProvider) { ResourceProvider provider = (ResourceProvider) modelObject; provider.removeResource(name); // update properties this.properties.remove(name); } }
/** * Gets the property. * * @param propertyName the property name * * @return the property */ public String getProperty(String propertyName) { ParameterCheck.mandatory("propertyName", propertyName); return (String)getProperties().get(propertyName); }
/** * Returns whether the given endpoint credentials are stored on this vault * * @param endpointId * @return */ public boolean hasCredentials(String endpointId) { return getProperties().containsKey(endpointId); }