Package org.osid.configuration

The Open Service Interface Definitions for the org.osid.configuration service.

See: Description

Package org.osid.configuration Description

The Open Service Interface Definitions for the org.osid.configuration service.

The Configuration OSID defines a set of interfaces for configuration retrieval and management. The Configuration service may be used to store user profiles or as a means to assist OSID implementors modularize configuration data.

Parameters

Configuration data is expressed through a set of Parameters and Values. A Parameter is an OsidRule with a unique Id and a syntax that indicates a primitive type. A Parameter may map to zero or more Values of the same syntax. An application requesting a configuration looks up Values given a Parameter Id through a ValueLookupSession.

As an OsidRule , Parameters may resolve to implicitly created Values based on external rule evaluations.

Values

Values represent primitive types that are assigned to Parameters and constrained by the syntax specified in its Parameter. In the most basic case, a single Value is created for a Parameter and returned when the Parameter is resolved. Parameters can have multiple Values where the Configuration OSID Consumer can request all Values, or a single Value selected by the OSID Provider.

Values are Operable such that Values in multi-valued Parameter may be enabled or disabled manually or based on a rule. For example, the configuration of a service may change based on time of day or may change based on some out-of-band context. Value retrievals in the ValueRetrievalSession support passing of a ValueCondition to supply contextual information to feed the rule evaluation.

Configuration Cataloging

To create a configuration for an application, a Configuration object is created. The Configuration maps a set of Parameters and their Values. A Configuration may be positioned as a child of another Configuration to inherit its Parameters and Values. The desired Parameters are then mapped to the Configuration and Values assigned.

Parameters may be stored without values in separate Configurations for reuse or standardization.

OSID Provider implementations should get their configurations via the OsidRuntimeManager.

Sub Packages

The Configuration OSID includes a rules subpackage for governing the available Values for a Parameter based on a set of rules and an Configuration Batch OSID for managing parameters and values in bulk.

Example

      
      
      Id parameterId = what I'm looking for;
      
      ValueLookupSession valueSession = mgr.getValueLookupSession();
      valueSession.federateParameterView();
      
      if (valueSession.parameterExists(parameterId)) {
          Parameter param = valueSession.getParameter(parameterId);
          ValueList values = valueSession.getValues(param.getId());
          while (values.hasNext()) {
              Value value = values.getNextValue();
              if (param.implementsType(typeString)
                  String value = (String) param.getValue();
              else 
                  print "unexpected type";
          }
      }
      
              
      
 




Copyright © 2009-2010 Ingenescus. All Rights Reserved.

This Work is being provided by the copyright holder(s) subject to the following license. By obtaining, using and/or copying this Work, you agree that you have read, understand, and will comply with the following terms and conditions.

Permission to use, copy and distribute unmodified versions of this Work, for any purpose, without fee or royalty is hereby granted, provided that you include the above copyright notices and the terms of this license on ALL copies of the Work or portions thereof.

You may nodify or create Derivatives of this Work only for your internal purposes. You shall not distribute or transfer any such Derivative of this Work to any location or to any third party. For the purposes of this license, "Derivative" shall mean any derivative of the Work as defined in the United States Copyright Act of 1976, such as a translation or modification.

This Work and the information contained herein is provided on an "AS IS" basis WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE WORK OR THE USE OR OTHER DEALINGS IN THE WORK.

The export of software employing encryption technology may require a specific license from the United States Government. It is the responsibility of any person or organization contemplating export to obtain such a license before exporting this Work.