no.ubicollab.osgi.service.positioning
Interface PositioningService

All Known Implementing Classes:
PositioningImpl

public interface PositioningService

Interface for the Positioning Service. The service retrieves positioning data by asking all its registered plugin services. This makes it possible for the Positioning Service to compare the data from several sources and pick the most accurate one. Currently GPS and GSM based plugins exist. There is a many to many relationship between Positioning Services and its plugins, meening that in addition to a Position Service having more than one plugin, the same plugin can be "plugged into" several Positioning Services.
The service generates proxy classes at runtime, so that theoretically any webservice implementing the method double[] getPosition(String username) can be used as a plugin.
The Positioning Service searches for plugins in the Discovery Service with type starting with "no.ubicollab.osgi.service.positioning." Note that the Positioning Service can not use other Positioning Services as plugins as this could cause the system to loop forever. The type of the Positioning Service is therefore "no.ubicollab.osgi.service.positioning" (no trailing ".") so that it will not be discovered by other Positioning Services.

Author:
Andreas Brustad
See Also:
no.ubicollab.osgi.service.positioning.gps.PositioningPluginService, no.ubicollab.osgi.service.positioning.gsm.PositioningPluginService

Method Summary
 double[] getPosition(java.lang.String username)
          Gets the position of the user by asking all registered plugins.
 void updatePluginReferences()
          Searches for new plugins and generates proxy classes.
 

Method Detail

getPosition

double[] getPosition(java.lang.String username)
Gets the position of the user by asking all registered plugins. The current version has a hardcoded priority list saying that GPS plugins should be checked first, followed by GSM plugins. Other plugins are only used if the position was not found in any of the above plugins.
Later versions should have more intelligent behaviour. For example calculating the average from several sources.

Parameters:
username - The username of the user to be located
Returns:
a double[] of length 3. Where [0] = longitude, [1] = latitude, [2] = altitude, or null if the position of this user is not found in any plugins.

updatePluginReferences

void updatePluginReferences()
Searches for new plugins and generates proxy classes.