com.hammurapi.config
Interface Profile

All Superinterfaces:
org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.notify.Notifier, PropertySource
All Known Implementing Classes:
ProfileImpl

public interface Profile
extends PropertySource

A representation of the model object 'Profile'. Collection of named things. The purpose of profiles to have a single component configuration for multiple environments where the component might be deployed. For example a single component configuration can be used on a local developer workstation, in a shared development environment, testing environment and production environment. In each deployment the client code supplies a different profile path, but the component configuration resource remains the same. It alleviates an often encountered problem when different environments have different configuration resources and as such problems in production environment can not be reproduced in development environment. An often used approach with substitution variables (tokens) quickly goes out of control as complexity of the system increases. Profiles can leverage substitution variables and provide additional level of flexibility. Profiles form a hierarchy (path). Named values on lower levels shadow/override values defined at higher levels. For example, let's say there is a data source definition. It has driver class, url, user and password. The driver class name (and a path to load the driver) can be defined at the root level, as well as the database user name. Connection URL can be defined at the environment profile level - different URL's for local environment, DEV and PROD. The password shall not be stored in the config file. So it shall come from a substitution token, e.g. $[db.password]. The password can be defined at the root level, or at environment level. In the latter case the token may contain environment name, e.g. $[db.password.DEV]. If, acciedentally, developer tries to load production profile in his local or DEV environment, then startup will fail because of unsuccessful expansion of $[db.password.PROD] token or because substituted password will be invalid. The first case - unsuccessfull expansion is easier to detect and troubleshoot. Profiles also allow to specify different qualities of service (e.g. performance, cost, distributes vs. local computation) for the same component with the same interface in different environments.

The following features are supported:

See Also:
ConfigPackage.getProfile()

Method Summary
 String getDescription()
          Returns the value of the 'Description' attribute.
 String getName()
          Returns the value of the 'Name' attribute.
 PropertySource getOwner()
          Returns the value of the 'Owner' container reference.
 void setDescription(String value)
          Sets the value of the 'Description' attribute.
 void setName(String value)
          Sets the value of the 'Name' attribute.
 void setOwner(PropertySource value)
          Sets the value of the 'Owner' container reference.
 
Methods inherited from interface com.hammurapi.config.PropertySource
getClassPath, getProfile, getProperty, injectProperties
 
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eIsProxy, eIsSet, eResource, eSet, eUnset
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 

Method Detail

getName

String getName()
Returns the value of the 'Name' attribute. Profile name.

Returns:
the value of the 'Name' attribute.
See Also:
setName(String), ConfigPackage.getProfile_Name()

setName

void setName(String value)
Sets the value of the 'Name' attribute.

Parameters:
value - the new value of the 'Name' attribute.
See Also:
getName()

getDescription

String getDescription()
Returns the value of the 'Description' attribute. Profile description.

Returns:
the value of the 'Description' attribute.
See Also:
setDescription(String), ConfigPackage.getProfile_Description()

setDescription

void setDescription(String value)
Sets the value of the 'Description' attribute.

Parameters:
value - the new value of the 'Description' attribute.
See Also:
getDescription()

getOwner

PropertySource getOwner()
Returns the value of the 'Owner' container reference. It is bidirectional and its opposite is 'Profile'. Parent profile or object definition.

Returns:
the value of the 'Owner' container reference.
See Also:
setOwner(PropertySource), ConfigPackage.getProfile_Owner(), PropertySource.getProfile()

setOwner

void setOwner(PropertySource value)
Sets the value of the 'Owner' container reference.

Parameters:
value - the new value of the 'Owner' container reference.
See Also:
getOwner()