Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "IdAS Registry and Configuration"

 
(Proposed Changes to IdAS)
 
(6 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
Notice that the configData returned by canConnect is ignored in this use case.
 
Notice that the configData returned by canConnect is ignored in this use case.
  
  List factories = idasregistry.getContextFactories(null);  
+
  Iterable<IContextFactory> factories = idasregistry.getContextFactories((String) null);  
 
  IContextFactory foundf = null;  
 
  IContextFactory foundf = null;  
  for (f = factories.getFirst(); f!=null; f = factories.getNext())
+
  for (Iterator<IContextFactory> itr = factories.iterator(); itr.hasNext(); ) {
 +
  IContextFactory f = itr.next();
 
   if (configData = f.canConnect(cref)) {
 
   if (configData = f.canConnect(cref)) {
 
     foundf = f;
 
     foundf = f;
Line 13: Line 14:
 
   }
 
   }
 
  }
 
  }
+
  if (foundf == null) return;
  if (foundf == null)
+
 
  return false;
+
+
 
  IContext c = f.connect(cref);
 
  IContext c = f.connect(cref);
 +
 
  Policy p = c.getOpenPolicy();
 
  Policy p = c.getOpenPolicy();
 
   
 
   
Line 23: Line 23:
 
   
 
   
 
  c.open(DI);
 
  c.open(DI);
 
return true;
 
  
 
===Use Case #2===
 
===Use Case #2===
Line 31: Line 29:
 
  ...consumer enumerates available IContextFactories and selects one by
 
  ...consumer enumerates available IContextFactories and selects one by
 
  ...inspecting the metadata of each and ultimately selects 'f'.
 
  ...inspecting the metadata of each and ultimately selects 'f'.
  ...or the consumer does f = getContextFactory(<some factory id>)
+
  ...or the consumer does f = idasregistry.getContextFactory(<some factory id>)
 
  List propNames = f.getConfigPropNames();
 
  List propNames = f.getConfigPropNames();
 
   
 
   
Line 43: Line 41:
 
  if (f.canCreate(cref, configData)) {
 
  if (f.canCreate(cref, configData)) {
 
   IContext c = f.createContext(cref, configData); }
 
   IContext c = f.createContext(cref, configData); }
+
 
 
===Proposed Changes to IdAS===
 
===Proposed Changes to IdAS===
  
Line 76: Line 74:
 
   // factory. May be null. May only contain a URI scheme. May contain more.
 
   // factory. May be null. May only contain a URI scheme. May contain more.
 
   URI getRootURI();
 
   URI getRootURI();
 
+
 
   // Returns a unique indentifier for this factory
 
   // Returns a unique indentifier for this factory
 
   string getID();
 
   string getID();
Line 95: Line 93:
 
   // Get persistent config file for a given factory
 
   // Get persistent config file for a given factory
 
   // Note: the name of the file is taken from the factory's id
 
   // Note: the name of the file is taken from the factory's id
   File IdASRegistry.getConfigFile(IContextFactory factory);  
+
   File getConfigFile(IContextFactory factory);  
 
   
 
   
 
   // Find and return a factory whose ID matches 'id' (else null)
 
   // Find and return a factory whose ID matches 'id' (else null)

Latest revision as of 15:10, 13 December 2006

IdAS is a service that enables consumers to access contexts (identity data stores) referenced by abstract identifiers called "contextRefs (URIs)" using a variety of data access methods.

Use Case #1

Description: opening ContextRef 'cref' when IdAS consumer doesn't specify a preferred IContextFactory. Notice that the configData returned by canConnect is ignored in this use case.

Iterable<IContextFactory> factories = idasregistry.getContextFactories((String) null); 
IContextFactory foundf = null; 
for (Iterator<IContextFactory> itr = factories.iterator(); itr.hasNext(); ) {
  IContextFactory f = itr.next();
  if (configData = f.canConnect(cref)) {
    foundf = f;
    break;
  }
}
if (foundf == null) return;
 
IContext c = f.connect(cref);

Policy p = c.getOpenPolicy();

...get a DI that satisfies policy p

c.open(DI);

Use Case #2

Description: The IdAS consumer creates a new Context. To do this, the consumer must choose an IContextFactory and is required to know how to configure a new context with this factory with factory-specific configuration data

...consumer enumerates available IContextFactories and selects one by
...inspecting the metadata of each and ultimately selects 'f'.
...or the consumer does f = idasregistry.getContextFactory(<some factory id>)
List propNames = f.getConfigPropNames();

Properties configData;
...set up configData

URI root = f.getRootURI();
URI cref;
...client uses 'root' (which may be null) to construct 'cref'--a presumably a globally unique URI

if (f.canCreate(cref, configData)) {
  IContext c = f.createContext(cref, configData); }

Proposed Changes to IdAS

interface IContextFactory {

  // Test to see if this factory can connect to the specified context
  // Returns discoverable metadata (e.g. if the URI is a WS-Addressing
  // EPR then it can return EPR metadata, or if the URI is believed to be
  // an OpenID URI it can attempt to GET XRDS mimetype service
  // description document)
  Properties canConnect(URI contextRef); // formerly called "canAttach" 

  // Connect to a pre-configured context
  IContext connect(URI contextRef);   // formerly called "attach"

  // Create a new context with given configuration data
  boolean canCreate(URI contextRef, Properties configData);
  IContext createContext(URI contextRef, Properties configData);

  // Destroy Context associated with contextRef. Unbinds contextRef.
  void destroyContext(URI contextRef);

  // Returns list of property's names required to create/configure new
  // context.
  List<String> getConfigPropNames();

  // This method is called when instance of context factory is
  // registered in IdASRegistry. 
  void onRegistration(File config); 

  // Returns a common root URI used by all URIs connectable by this
  // factory. May be null. May only contain a URI scheme. May contain more.
  URI getRootURI();

  // Returns a unique indentifier for this factory
  string getID();
  ...
}

class IdASRegistry {

  // Create IdAS registry with the specified path to configuration
  // area (path location where configuration files for context
  // factories are located)
  IdASRegistry(String configAreaPath);

  // Create IdAS registry with the default path to configuration
  // area (for example ${user.home}/.higgins/idas/)
  IdASRegistry();
 
  // Get persistent config file for a given factory
  // Note: the name of the file is taken from the factory's id
  File getConfigFile(IContextFactory factory); 

  // Find and return a factory whose ID matches 'id' (else null)
  IContextFactory getContextFactory(String id);
  ...
}

interface IContext {

  // Return this Context's authentication policy. Format is
  // identical to the "Higgins RP Security Policy" document
  Policy getOpenPolicy();
  ...
}

Back to the top