nl.toolforge.karma.core.location
Class LocationLoader

java.lang.Object
  extended bynl.toolforge.karma.core.location.LocationLoader

public final class LocationLoader
extends java.lang.Object

Loader class to load all gain access to Location instances. Location instances are created based on XML definitions in the location store. The location store is a directory on the user's local harddisk, which is a mandatory property in karma.properties.

A location can be of different types. Some locations require authenticator data, which is mapped from an XML file in the Karma configuration directory (uthenticator.xml). A location with id cvs-1 will be mapped to an authenticator with the same id.

Version:
$Id: LocationLoader.java,v 1.17 2004/11/02 23:57:06 asmedes Exp $
Author:
D.A. Smedes, W.M. Oosterom

Constructor Summary
LocationLoader(WorkingContext workingContext)
          Constructs a LocationLoader for the current workingContext.
 
Method Summary
 Location get(java.lang.String locationAlias)
          Gets a Location instance by its locationAlias.
 java.util.Map getLocations()
          Returns all locations that have been loaded by the loader.
 void load()
          Loads all location xml files from the path specified by the WorkingContext#getLocationStore() property.
 java.lang.String toString()
          String representation of all locations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocationLoader

public LocationLoader(WorkingContext workingContext)
Constructs a LocationLoader for the current workingContext.

Parameters:
workingContext -
Method Detail

load

public void load()
          throws LocationException
Loads all location xml files from the path specified by the WorkingContext#getLocationStore() property. Location objects are matched against authenticator objects, which should be available in the Karma configuration directory nl.toolforge.karma.core.boot.Karma#getConfigurationBaseDir() and should be named 'authenticators.xml'.

Throws:
LocationException

getLocations

public final java.util.Map getLocations()
Returns all locations that have been loaded by the loader.

Returns:
A map containing Location-objects, accessible by their id as a key.

get

public final Location get(java.lang.String locationAlias)
                   throws LocationException
Gets a Location instance by its locationAlias. This method checks the availability of the location as well throwing the corresponding errors when this did not succeed.

Parameters:
locationAlias - The location-attribute from the module-element in the manifest.
Returns:
A Location instance, representing e.g. a CVS repository or a Maven repository.
Throws:
LocationException - See LocationException.LOCATION_NOT_FOUND.
LocationException - See LocationException.CONNECTION_EXCEPTION.

toString

public java.lang.String toString()
String representation of all locations.

Returns:
null until implemented.


Copyright © 2002-2004 Toolforge. All Rights Reserved.