use of org.onebusaway.users.model.properties.UserPropertiesV3 in project onebusaway-application-modules by camsys.
the class UserPropertiesMigrationImpl method getV3PropertiesFromV4.
private UserPropertiesV3 getV3PropertiesFromV4(UserPropertiesV4 v4) {
UserPropertiesV3 v3 = new UserPropertiesV3();
v3.setRememberPreferencesEnabled(v4.isRememberPreferencesEnabled());
v3.setDefaultLocationLat(v4.getDefaultLocationLat());
v3.setDefaultLocationLon(v4.getDefaultLocationLon());
v3.setDefaultLocationName(v4.getDefaultLocationName());
v3.setBookmarks(v4.getBookmarks());
v3.setMinApiRequestInterval(v4.getMinApiRequestInterval());
v3.setReadSituationIdsWithReadTime(v4.getReadSituationIdsWithReadTime());
return v3;
}
use of org.onebusaway.users.model.properties.UserPropertiesV3 in project onebusaway-application-modules by camsys.
the class UserPropertiesMigrationImpl method getV3Properties.
private UserPropertiesV3 getV3Properties(UserPropertiesV2 v2) {
UserPropertiesV3 v3 = new UserPropertiesV3();
v3.setRememberPreferencesEnabled(v2.isRememberPreferencesEnabled());
v3.setDefaultLocationLat(v2.getDefaultLocationLat());
v3.setDefaultLocationLon(v2.getDefaultLocationLon());
v3.setDefaultLocationName(v2.getDefaultLocationName());
v3.setBookmarks(v2.getBookmarks());
v3.setMinApiRequestInterval(v2.getMinApiRequestInterval());
v3.setReadSituationIdsWithReadTime(v2.getReadSituationIdsWithReadTime());
return v3;
}
use of org.onebusaway.users.model.properties.UserPropertiesV3 in project onebusaway-application-modules by camsys.
the class UserPropertiesServiceV3Impl method setDefaultLocation.
@Override
public void setDefaultLocation(User user, String locationName, double lat, double lon) {
UserPropertiesV3 properties = getProperties(user);
if (!properties.isRememberPreferencesEnabled())
return;
properties.setDefaultLocationName(locationName);
properties.setDefaultLocationLat(lat);
properties.setDefaultLocationLon(lon);
_userDao.saveOrUpdateUser(user);
}
use of org.onebusaway.users.model.properties.UserPropertiesV3 in project onebusaway-application-modules by camsys.
the class UserPropertiesServiceV3Impl method getProperties.
/**
**
* Private Methods
***
*/
private UserPropertiesV3 getProperties(User user) {
UserProperties props = user.getProperties();
UserPropertiesV3 v3 = _userPropertiesMigration.migrate(props, UserPropertiesV3.class);
if (props != v3)
user.setProperties(v3);
return v3;
}
use of org.onebusaway.users.model.properties.UserPropertiesV3 in project onebusaway-application-modules by camsys.
the class UserPropertiesServiceV3Impl method authorizeApi.
@Override
public void authorizeApi(User user, long minApiRequestInterval) {
UserPropertiesV3 properties = getProperties(user);
properties.setMinApiRequestInterval(minApiRequestInterval);
_userDao.saveOrUpdateUser(user);
}
Aggregations