com.mymed.controller.core.manager.geolocation
Class GeoLocationManager

java.lang.Object
  extended by com.mymed.controller.core.manager.AbstractManager
      extended by com.mymed.controller.core.manager.geolocation.GeoLocationManager

public class GeoLocationManager
extends AbstractManager

Manages the geo-localization.

Author:
iacopo

Constructor Summary
GeoLocationManager()
           
GeoLocationManager(MyJamStorageManager storageManager)
           
 
Method Summary
 MSearchBean create(java.lang.String applicationId, java.lang.String itemType, java.lang.String userLogin, int latitude, int longitude, java.lang.String value, int permTime)
          Insert a new located item into the database.
 void delete(java.lang.String applicationId, java.lang.String itemType, long locationId, java.lang.String itemId)
          Deletes one located item.
 java.util.List<MSearchBean> read(java.lang.String applicationId, java.lang.String itemType, int latitude, int longitude, int radius)
          Search located items in a circular region specified by latitude, longitude and radius.
 MSearchBean read(java.lang.String applicationId, java.lang.String itemType, long locationId, java.lang.String itemId)
          Returns the MSearchBean or throws an exception if it is not present.
 
Methods inherited from class com.mymed.controller.core.manager.AbstractManager
introspection
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeoLocationManager

public GeoLocationManager()
                   throws InternalBackEndException
Throws:
InternalBackEndException

GeoLocationManager

public GeoLocationManager(MyJamStorageManager storageManager)
                   throws InternalBackEndException
Throws:
InternalBackEndException
Method Detail

create

public MSearchBean create(java.lang.String applicationId,
                          java.lang.String itemType,
                          java.lang.String userLogin,
                          int latitude,
                          int longitude,
                          java.lang.String value,
                          int permTime)
                   throws InternalBackEndException,
                          IOBackEndException
Insert a new located item into the database.

Parameters:
applicationId - Id of the application.
itemType - Id of the located object. Its scope is the application which it belongs to.
latitude - Latitude in micro-degrees.
longitude - Longitude in micro-degrees.
value - String value (Can be null.)
permTime - Permanence time in seconds (if 0 the item doesn't expire).
Returns:
Throws:
InternalBackEndException
IOBackEndException

read

public java.util.List<MSearchBean> read(java.lang.String applicationId,
                                        java.lang.String itemType,
                                        int latitude,
                                        int longitude,
                                        int radius)
                                 throws InternalBackEndException,
                                        IOBackEndException
Search located items in a circular region specified by latitude, longitude and radius.

Parameters:
applicationId - Identifier of the application.
latitude - Latitude in micro-degrees.
longitude - Longitude in micro-degrees.
radius - Radius of the search in meters.
Returns:
Throws:
InternalBackEndException
IOBackEndException

read

public MSearchBean read(java.lang.String applicationId,
                        java.lang.String itemType,
                        long locationId,
                        java.lang.String itemId)
                 throws InternalBackEndException,
                        IOBackEndException
Returns the MSearchBean or throws an exception if it is not present.

Parameters:
applicationId - Identifier of the application.
itemType -
locationId -
itemId -
Returns:
Throws:
InternalBackEndException
IOBackEndException

delete

public void delete(java.lang.String applicationId,
                   java.lang.String itemType,
                   long locationId,
                   java.lang.String itemId)
            throws InternalBackEndException,
                   IOBackEndException
Deletes one located item.

Parameters:
applicationId - Identifier of the application.
itemType - Type of localized item.
locationId - Identifier of the location.
itemId - Identifier of the item.
Throws:
InternalBackEndException
IOBackEndException