no.ubicollab.osgi
Class PositioningImpl

java.lang.Object
  extended by no.ubicollab.osgi.PositioningImpl
All Implemented Interfaces:
PositioningService

public class PositioningImpl
extends java.lang.Object
implements PositioningService


Constructor Summary
PositioningImpl(no.ubicollab.osgi.service.pocketdiscovery.PocketDiscoveryService discoveryService)
           
 
Method Summary
 double[] getPosition(java.lang.String username)
          Gets the position of the user by asking all registered plugins.
 void stop()
           
 void updatePluginReferences()
          Searches for new plugins and generates proxy classes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PositioningImpl

public PositioningImpl(no.ubicollab.osgi.service.pocketdiscovery.PocketDiscoveryService discoveryService)
Method Detail

getPosition

public double[] getPosition(java.lang.String username)
Description copied from interface: PositioningService
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.

Specified by:
getPosition in interface PositioningService
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

public void updatePluginReferences()
Description copied from interface: PositioningService
Searches for new plugins and generates proxy classes.

Specified by:
updatePluginReferences in interface PositioningService

stop

public void stop()