Operations performed using the API can be thought of conceptually as running within a specific context. The context defines the bounds upon which the operation occurs. Currently the API supports a context defined uniquely by three components. These components are the Data Source ID, Portfolio ID and Facility ID.
A context can be defined for any operation performed within the API. For example say we wanted to change the description on the Springfield portfolio located in the ManagingEnergy_Template data source. The context for that operation would then be defined by the Data Source “ManagingEnergy_Template” and the Portfolio “Springfield”.
Applying this concept to the other API operations one can envision many contexts at various levels as shown below. In this diagram the circles represent a context. The color and size denotes the scope of the context. The smaller the circle the more defined the scope.
Within the API these contexts are represented by the ManagingEnergy.Security.SecurityContext class.
All objects which derive from ManagingEnergy.ManagingEnergyElement contain the GetSecurityContext method which returns the SecurityContext defined by the objects physical location within ManagingEnergy. The usefulness of the SecurityContext concept will be apparent in the next section, however now let’s see a simple example.