*
* @param scenarioId
* the scenario id
- * @param username
- * the username of the user performing the check out
+ * @param userId
+ * the id of the user performing the check out
* @throws InvalidPropertyException
* if the user or the scenario is not found in the database
* @throws NotApplicableException
* if the given user can not check out the scenario
*/
- public void checkout(final long scenarioId, final String username)
+ public void checkout(final long scenarioId, final long userId)
throws InvalidPropertyException, NotApplicableException;
/**
*
* @param scenarioId
* the scenario id
- * @param username
- * the username of the user performing the check out
+ * @param userId
+ * the id of the user performing the check out
* @throws InvalidPropertyException
* if the user or the scenario is not found in the database
* @throws NotApplicableException
* if the given user can not check out the scenario
*/
@Transactional
- public void checkout(final long scenarioId, final String username)
+ public void checkout(final long scenarioId, final long userId)
throws InvalidPropertyException, NotApplicableException {
- User aUser = getUserService().selectUser(username);
+ User aUser = getUserService().selectUser(userId);
if (aUser == null) {
// User not found
throw new InvalidPropertyException(MessageKeyEnum.USR_000001
- .toString(), username);
+ .toString(), userId);
}
Scenario aScenario = getScenarioDAO().get(scenarioId);
if (aScenario == null) {
aUser);
if (res) {
if (aScenario.isCheckedout()
- && (!aScenario.getUser().getUsername().equals(username))) {
+ && (!aScenario.getUser().getUsername().equals(aUser.getUsername()))) {
throw new NotApplicableException(MessageKeyEnum.SCN_000008
.toString(), scenarioId, aScenario.getUser()
.getUsername());
} else {
// User doesn't participate in the scenario
throw new NotApplicableException(MessageKeyEnum.SCN_000007
- .toString(), username, scenarioId);
+ .toString(), aUser.getUsername(), scenarioId);
}
}
/**
* User login name action parameter. Defines the user who performs check out.
*/
- private String _user;
+ private long _user;
/**
* Injected scenario service.
*/
*
* @return the user
*/
- public String getUser() {
+ public long getUser() {
return _user;
}
* @param user
* the user to set
*/
- public void setUser(final String user) {
+ public void setUser(final long user) {
_user = user;
}
}