Changeset 7405


Ignore:
Timestamp:
Oct 4, 2017, 12:59:03 PM (5 years ago)
Author:
Nicklas Nordborg
Message:

References #2097: Implement support for device verification

Added UserDeviceData class for storing information about a verified device. Links are created to/from user, client and session.

Location:
trunk/src/core/net/sf/basedb/core
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/core/Install.java

    r7392 r7405  
    119119    method.
    120120  */
    121   public static final int NEW_SCHEMA_VERSION = Integer.valueOf(138).intValue();
     121  public static final int NEW_SCHEMA_VERSION = Integer.valueOf(139).intValue();
    122122 
    123123  public static synchronized int createTables(SchemaGenerator.Mode mode, ProgressReporter progress,
  • trunk/src/core/net/sf/basedb/core/Update.java

    r7403 r7405  
    4747import net.sf.basedb.core.data.BioPlateTypeData;
    4848import net.sf.basedb.core.data.ChangeHistoryDetailData;
     49import net.sf.basedb.core.data.ClientData;
    4950import net.sf.basedb.core.data.ContextData;
    5051import net.sf.basedb.core.data.DerivedBioAssayData;
     
    6970import net.sf.basedb.core.data.ShareableData;
    7071import net.sf.basedb.core.data.UnitData;
     72import net.sf.basedb.core.data.UserData;
     73import net.sf.basedb.core.data.UserDeviceData;
    7174import net.sf.basedb.core.dbengine.DbEngine;
    7275import net.sf.basedb.core.dbengine.TableInfo;
     
    370373      Added {@link NewsData#isSticky()}. The update should set
    371374      the value for all existing news items to false.
     375    </td>
     376  </tr>
     377  <tr>
     378    <td>139</td>
     379    <td>
     380      Added {@link UserDeviceData} and related changes in {@link UserData},
     381      {@link ClientData} and {@link SessionData} classes.
    372382    </td>
    373383  </tr>
     
    605615        if (progress != null) progress.display((int)(progress_current), "--Updating schema version: " + schemaVersion + " -> 138...");
    606616        schemaVersion = setSchemaVersionInTransaction(session, 138);
     617        progress_current += progress_step;
     618      }
     619     
     620      if (schemaVersion < 139)
     621      {
     622        if (progress != null) progress.display((int)(progress_current), "--Updating schema version: " + schemaVersion + " -> 139...");
     623        schemaVersion = setSchemaVersionInTransaction(session, 139);
    607624        progress_current += progress_step;
    608625      }
  • trunk/src/core/net/sf/basedb/core/data/ClientData.java

    r7403 r7405  
    110110  }
    111111
     112  private Set<UserDeviceData> devices;
     113  /**
     114    This is the inverse end.
     115    @see UserDeviceData#getClient()
     116    @since 3.12
     117    @hibernate.set lazy="true" inverse="true" cascade="delete"
     118    @hibernate.collection-key column="`client_id`"
     119    @hibernate.collection-one-to-many class="net.sf.basedb.core.data.UserDeviceData"
     120  */
     121  Set<UserDeviceData> getDevices()
     122  {
     123    return devices;
     124  }
     125  void setDevices(Set<UserDeviceData> devices)
     126  {
     127    this.devices = devices;
     128  }
     129 
    112130  private Set<SessionData> sessions;
    113131  /**
  • trunk/src/core/net/sf/basedb/core/data/SessionData.java

    r7165 r7405  
    135135  }
    136136 
     137  private UserDeviceData device;
     138  /**
     139    Get the device the user was using.
     140    @since 3.12
     141    @hibernate.many-to-one column="`device_id`" not-null="false" update="false" outer-join="false"
     142  */
     143  public UserDeviceData getDevice()
     144  {
     145    return device;
     146  }
     147 
     148  public void setDevice(UserDeviceData device)
     149  {
     150    this.device = device;
     151  }
     152
     153 
    137154  /**
    138155    The maximum length of the remote ID that can be stored in the database.
  • trunk/src/core/net/sf/basedb/core/data/UserData.java

    r7404 r7405  
    533533  }
    534534
     535  private Set<UserDeviceData> devices;
     536  /**
     537    This is the inverse end.
     538    @see UserDeviceData#getUser()
     539    @since 3.12
     540    @hibernate.set lazy="true" inverse="true" cascade="delete"
     541    @hibernate.collection-key column="`user_id`"
     542    @hibernate.collection-one-to-many class="net.sf.basedb.core.data.UserDeviceData"
     543  */
     544  Set<UserDeviceData> getDevices()
     545  {
     546    return devices;
     547  }
     548  void setDevices(Set<UserDeviceData> devices)
     549  {
     550    this.devices = devices;
     551  }
     552
    535553  private Set<SessionData> sessions;
    536554  /**
Note: See TracChangeset for help on using the changeset viewer.