edu.internet2.middleware.grouper.ui.util
Class DefaultMembershipImporter

java.lang.Object
  extended by edu.internet2.middleware.grouper.ui.util.DefaultMembershipImporter
All Implemented Interfaces:
MembershipImporter

public class DefaultMembershipImporter
extends Object
implements MembershipImporter

Default implementation of the MembershipImporter interface. This class expects single line records e.g. tab/comma separated fields where one of the fields can be used to lookup a Subject by id or identifier.

This class expects to find the following attributes in the config Element:
separator e.g. ',' or '\t', used to determine fields
id-field - an integer used to determine which field position to use to lookup a Subject>br/> field-type - 'id' or 'identifier' specifies the type of lookup to do
ignore-existing - 'false' or 'true' determies whether trying to add an existing member is considered an error

Other implementations can be as complex as necessary

Version:
$Id: DefaultMembershipImporter.java,v 1.6 2009-08-12 04:52:14 mchyzer Exp $
Author:
Gary Brown.

Constructor Summary
DefaultMembershipImporter()
           
 
Method Summary
 int load(Group group, Reader input, PrintWriter output, Element config, Field field)
          Parses data to resolve to a Subject and attempts to add the Subject to the Group membership.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMembershipImporter

public DefaultMembershipImporter()
Method Detail

load

public int load(Group group,
                Reader input,
                PrintWriter output,
                Element config,
                Field field)
         throws IOException,
                SchemaException
Description copied from interface: MembershipImporter
Parses data to resolve to a Subject and attempts to add the Subject to the Group membership. If a Subject cannot be resolved and error count is incremented - and returned, and an error message is written to output. This method would normally be called indirectly from MembershipImportManager, which reads configuration information from an XML file. Implementation specific configuration is encoded as XML attributes

Specified by:
load in interface MembershipImporter
Returns:
count of errors encountered during load
Throws:
IOException
SchemaException