public ScriptResource add(String name, String resourceId) { ScriptResource scriptResource = null; if (modelObject instanceof ResourceProvider) { ResourceProvider provider = (ResourceProvider) modelObject; // now add Resource resource = provider.addResource(name, resourceId); if (resource != null) { scriptResource = new ScriptResource(context, resource); this.properties.put(name, scriptResource); } } return scriptResource; }
public ScriptResource add(String name, String protocolId, String endpointId, String objectId) { ScriptResource scriptResource = null; if (modelObject instanceof ResourceProvider) { ResourceProvider provider = (ResourceProvider) modelObject; // now add Resource resource = provider.addResource(name, protocolId, endpointId, objectId); if (resource != null) { scriptResource = new ScriptResource(context, resource); this.properties.put(name, scriptResource); } } return scriptResource; }
public ScriptResource add(String name, String resourceId) { ScriptResource scriptResource = null; if (modelObject instanceof ResourceProvider) { ResourceProvider provider = (ResourceProvider) modelObject; // now add Resource resource = provider.addResource(name, resourceId); if (resource != null) { scriptResource = new ScriptResource(context, resource); this.properties.put(name, scriptResource); } } return scriptResource; }
public ScriptResource add(String name, String protocolId, String endpointId, String objectId) { ScriptResource scriptResource = null; if (modelObject instanceof ResourceProvider) { ResourceProvider provider = (ResourceProvider) modelObject; // now add Resource resource = provider.addResource(name, protocolId, endpointId, objectId); if (resource != null) { scriptResource = new ScriptResource(context, resource); this.properties.put(name, scriptResource); } } return scriptResource; }
protected ScriptableMap buildProperties() { if (this.properties == null) { // construct and add in all of our model object properties this.properties = new ScriptableLinkedHashMap<String, Serializable>() { // For now, leave this as a read-only map }; // populate the scriptable map String[] resourceNames = this.getNames(); for (int i = 0; i < resourceNames.length; i++) { ScriptResource scriptResource = this.get(resourceNames[i]); this.properties.put(resourceNames[i], scriptResource); } } return this.properties; }
protected ScriptableMap buildProperties() { if (this.properties == null) { // construct and add in all of our model object properties this.properties = new ScriptableLinkedHashMap<String, Serializable>() { // For now, leave this as a read-only map }; // populate the scriptable map String[] resourceNames = this.getNames(); for (int i = 0; i < resourceNames.length; i++) { ScriptResource scriptResource = this.get(resourceNames[i]); this.properties.put(resourceNames[i], scriptResource); } } return this.properties; }
/** * Sets the property. * * @param propertyName the property name * @param propertyValue the property value */ public void setProperty(String propertyName, String propertyValue) { ParameterCheck.mandatory("propertyName", propertyName); ParameterCheck.mandatory("propertyValue", propertyValue); getProperties().put(propertyName, propertyValue); }
/** * Sets the property. * * @param propertyName the property name * @param propertyValue the property value */ public void setProperty(String propertyName, String propertyValue) { ParameterCheck.mandatory("propertyName", propertyName); ParameterCheck.mandatory("propertyValue", propertyValue); getProperties().put(propertyName, propertyValue); }
/** * Sets the description id. * * @param value the new description id */ public void setDescriptionId(Serializable value) { if (value != null) { getProperties().put("descriptionId", value); } else { getProperties().delete("descriptionId"); } }
/** * Sets the title id. * * @param value the new title id */ public void setTitleId(Serializable value) { if (value != null) { getProperties().put("titleId", value); } else { getProperties().delete("titleId"); } }
/** * Sets the title id. * * @param value the new title id */ public void setTitleId(Serializable value) { if (value != null) { getProperties().put("titleId", value); } else { getProperties().delete("titleId"); } }
/** * Sets the title. * * @param value the new title */ public void setTitle(Serializable value) { if (value != null) { getProperties().put("title", value); } else { getProperties().delete("title"); } }
/** * Sets the description id. * * @param value the new description id */ public void setDescriptionId(Serializable value) { if (value != null) { getProperties().put("descriptionId", value); } else { getProperties().delete("descriptionId"); } }
/** * Sets the description. * * @param value the new description */ public void setDescription(Serializable value) { if (value != null) { getProperties().put("description", value); } else { getProperties().delete("description"); } }
/** * Sets the title. * * @param value the new title */ public void setTitle(Serializable value) { if (value != null) { getProperties().put("title", value); } else { getProperties().delete("title"); } }
/** * Sets the description. * * @param value the new description */ public void setDescription(Serializable value) { if (value != null) { getProperties().put("description", value); } else { getProperties().delete("description"); } }
/** * Returns the properties of the credential vault */ public ScriptableMap<String, Serializable> getProperties() { if (this.properties == null) { this.properties = new ScriptableLinkedHashMap<String, Serializable>(); // put credentials onto the map String[] ids = this.vault.getStoredIds(); for(int i = 0; i < ids.length; i++) { Credentials credentials = this.vault.retrieve(ids[i]); ScriptCredentials scriptCredentials = new ScriptCredentials(this.vault, credentials, true); this.properties.put(ids[i], scriptCredentials); } } return this.properties; }
/** * Returns the properties of the credential vault */ public ScriptableMap<String, Serializable> getProperties() { if (this.properties == null) { this.properties = new ScriptableLinkedHashMap<String, Serializable>(); // put credentials onto the map String[] ids = this.vault.getStoredIds(); for(int i = 0; i < ids.length; i++) { Credentials credentials = this.vault.retrieve(ids[i]); ScriptCredentials scriptCredentials = new ScriptCredentials(this.vault, credentials, true); this.properties.put(ids[i], scriptCredentials); } } 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; }
/** * 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; }