/******************************************************************************* * Copyright 2014 Federal Chancellery Austria * MOA-ID has been developed in a cooperation between BRZ, the Federal * Chancellery Austria - ICT staff unit, and Graz University of Technology. * * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by * the European Commission - subsequent versions of the EUPL (the "Licence"); * You may not use this work except in compliance with the Licence. * You may obtain a copy of the Licence at: * http://www.osor.eu/eupl/ * * Unless required by applicable law or agreed to in writing, software * distributed under the Licence is distributed on an "AS IS" basis, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the Licence for the specific language governing permissions and * limitations under the Licence. * * This product combines work with different licenses. See the "NOTICE" text * file for details on the various modules and licenses. * The "NOTICE" text file is part of the distribution. Any derivative works * that you distribute must include a readable copy of the "NOTICE" text file. *******************************************************************************/ package at.gv.egovernment.moa.id.configuration.data; import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; import at.gv.egovernment.moa.util.MiscUtil; public class UserDatabaseFrom { private String bpk; private String familyName; private String givenName; private String institut; private String mail; private String phone; private String username; private String password; private String password_second; private boolean active = false; private boolean admin = false; private boolean passwordActive; private boolean isusernamepasswordallowed = false; private boolean isadminrequest = true; private boolean ismandateuser = false; private boolean isPVPGenerated; private String userID = null; public UserDatabaseFrom() { } public UserDatabaseFrom(UserDatabase db) { bpk = db.getBpk(); familyName = db.getFamilyname(); givenName = db.getGivenname(); institut = db.getInstitut(); mail = db.getMail(); phone = db.getPhone(); username = db.getUsername(); if (MiscUtil.isNotEmpty(db.getPassword())) { passwordActive = true; } else { passwordActive = false; } active = db.isIsActive(); admin = db.isIsAdmin(); if (db.isIsUsernamePasswordAllowed() != null) { isusernamepasswordallowed = db.isIsUsernamePasswordAllowed(); } else { isusernamepasswordallowed = true; } if (db.isIsAdminRequest() != null) { isadminrequest = db.isIsAdminRequest(); } else { isadminrequest = false; } if (db.isIsMandateUser() != null) { ismandateuser = db.isIsMandateUser(); } else { ismandateuser = false; } if (db.isIsPVP2Generated() != null) { isPVPGenerated = db.isIsPVP2Generated(); } else { isPVPGenerated = false; } userID = String.valueOf(db.getHjid()); } /** * @return the bpk */ public String getBpk() { return bpk; } /** * @param bpk the bpk to set */ public void setBpk(String bpk) { this.bpk = bpk; } /** * @return the familyName */ public String getFamilyName() { return familyName; } /** * @param familyName the familyName to set */ public void setFamilyName(String familyName) { this.familyName = familyName; } /** * @return the givenName */ public String getGivenName() { return givenName; } /** * @param givenName the givenName to set */ public void setGivenName(String givenName) { this.givenName = givenName; } /** * @return the institut */ public String getInstitut() { return institut; } /** * @param institut the institut to set */ public void setInstitut(String institut) { this.institut = institut; } /** * @return the mail */ public String getMail() { return mail; } /** * @param mail the mail to set */ public void setMail(String mail) { this.mail = mail; } /** * @return the phone */ public String getPhone() { return phone; } /** * @param phone the phone to set */ public void setPhone(String phone) { this.phone = phone; } /** * @return the username */ public String getUsername() { return username; } /** * @param username the username to set */ public void setUsername(String username) { this.username = username; } /** * @return the password */ public String getPassword() { return password; } /** * @param password the password to set */ public void setPassword(String password) { this.password = password; } /** * @return the active */ public boolean isActive() { return active; } /** * @param active the active to set */ public void setActive(boolean active) { this.active = active; } /** * @return the admin */ public boolean isAdmin() { return admin; } /** * @param admin the admin to set */ public void setAdmin(boolean admin) { this.admin = admin; } /** * @return the passwordActive */ public boolean isPasswordActive() { return passwordActive; } /** * @param passwordActive the passwordActive to set */ public void setPasswordActive(boolean passwordActive) { this.passwordActive = passwordActive; } /** * @return the userID */ public String getUserID() { return userID; } /** * @param userID the userID to set */ public void setUserID(String userID) { this.userID = userID; } /** * @return the password_second */ public String getPassword_second() { return password_second; } /** * @param password_second the password_second to set */ public void setPassword_second(String password_second) { this.password_second = password_second; } /** * @return the isusernamepasswordallowed */ public boolean isIsusernamepasswordallowed() { return isusernamepasswordallowed; } /** * @param isusernamepasswordallowed the isusernamepasswordallowed to set */ public void setIsusernamepasswordallowed(boolean isusernamepasswordallowed) { this.isusernamepasswordallowed = isusernamepasswordallowed; } /** * @return the ismandateuser */ public boolean isIsmandateuser() { return ismandateuser; } /** * @param ismandateuser the ismandateuser to set */ public void setIsmandateuser(boolean ismandateuser) { this.ismandateuser = ismandateuser; } /** * @return the isadminrequest */ public boolean isIsadminrequest() { return isadminrequest; } /** * @param isadminrequest the isadminrequest to set */ public void setIsadminrequest(boolean isadminrequest) { this.isadminrequest = isadminrequest; } /** * @return the isPVPGenerated */ public boolean isPVPGenerated() { return isPVPGenerated; } /** * @param isPVPGenerated the isPVPGenerated to set */ public void setPVPGenerated(boolean isPVPGenerated) { this.isPVPGenerated = isPVPGenerated; } }