Search in sources :

Example 1 with UserProperties

use of org.onebusaway.users.model.UserProperties 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;
}
Also used : UserProperties(org.onebusaway.users.model.UserProperties) UserPropertiesV3(org.onebusaway.users.model.properties.UserPropertiesV3)

Example 2 with UserProperties

use of org.onebusaway.users.model.UserProperties in project onebusaway-application-modules by camsys.

the class UserPropertiesServiceV4Impl method getProperties.

/**
 **
 * Private Methods
 ***
 */
private UserPropertiesV4 getProperties(User user) {
    UserProperties props = user.getProperties();
    UserPropertiesV4 v4 = _userPropertiesMigration.migrate(props, UserPropertiesV4.class);
    if (props != v4)
        user.setProperties(v4);
    return v4;
}
Also used : UserProperties(org.onebusaway.users.model.UserProperties) UserPropertiesV4(org.onebusaway.users.model.properties.UserPropertiesV4)

Example 3 with UserProperties

use of org.onebusaway.users.model.UserProperties in project onebusaway-application-modules by camsys.

the class UserPropertiesServiceVersionedInvocationHandler method getPropertiesVersion.

private int getPropertiesVersion(User user) {
    UserProperties props = user.getProperties();
    if (props instanceof UserPropertiesV1)
        return 1;
    if (props instanceof UserPropertiesV2)
        return 2;
    if (props instanceof UserPropertiesV3)
        return 3;
    if (props instanceof UserPropertiesV4)
        return 4;
    _log.warn("unknown user properties version: " + props.getClass());
    return 0;
}
Also used : UserProperties(org.onebusaway.users.model.UserProperties) UserPropertiesV3(org.onebusaway.users.model.properties.UserPropertiesV3) UserPropertiesV2(org.onebusaway.users.model.properties.UserPropertiesV2) UserPropertiesV1(org.onebusaway.users.model.UserPropertiesV1) UserPropertiesV4(org.onebusaway.users.model.properties.UserPropertiesV4)

Example 4 with UserProperties

use of org.onebusaway.users.model.UserProperties in project onebusaway-application-modules by camsys.

the class UserPropertiesServiceV2Impl method getProperties.

/**
 **
 * Private Methods
 ***
 */
private UserPropertiesV2 getProperties(User user) {
    UserProperties props = user.getProperties();
    UserPropertiesV2 v2 = _userPropertiesMigration.migrate(props, UserPropertiesV2.class);
    if (props != v2)
        user.setProperties(v2);
    return v2;
}
Also used : UserProperties(org.onebusaway.users.model.UserProperties) UserPropertiesV2(org.onebusaway.users.model.properties.UserPropertiesV2)

Aggregations

UserProperties (org.onebusaway.users.model.UserProperties)4 UserPropertiesV2 (org.onebusaway.users.model.properties.UserPropertiesV2)2 UserPropertiesV3 (org.onebusaway.users.model.properties.UserPropertiesV3)2 UserPropertiesV4 (org.onebusaway.users.model.properties.UserPropertiesV4)2 UserPropertiesV1 (org.onebusaway.users.model.UserPropertiesV1)1