diff --git a/hsarback/src/de/hsadmin/remote/AbstractRemote.java b/hsarback/src/de/hsadmin/remote/AbstractRemote.java index 9511c3e..1138bca 100644 --- a/hsarback/src/de/hsadmin/remote/AbstractRemote.java +++ b/hsarback/src/de/hsadmin/remote/AbstractRemote.java @@ -28,13 +28,13 @@ public abstract class AbstractRemote implements IRemote { protected abstract Class getEntityClass(); - protected abstract void entity2map(AbstractEntity entity, Map resultMap); + protected abstract void entity2map(AbstractEntity entity, Map resultMap); - protected abstract void map2entity(Map setParams, AbstractEntity entity); + protected abstract void map2entity(Map setParams, AbstractEntity entity); protected abstract void regularizeKeys(Map whereParams); - public List> search(String runAsUser, String ticket, + public List> search(String runAsUser, String ticket, Map whereParams) throws HSAdminException { String user = runAsUser; Transaction transaction = new Transaction(user); @@ -47,9 +47,9 @@ public abstract class AbstractRemote implements IRemote { if (list == null) { throw new HSAdminException("result list is null, runtime-error?"); } - ArrayList> result = new ArrayList>(); + ArrayList> result = new ArrayList>(); for (AbstractEntity e : list) { - HashMap entry = new HashMap(); + HashMap entry = new HashMap(); entity2map(e, entry); if (e.isReadAllowedFor(unixUser)) { result.add(entry); @@ -68,8 +68,8 @@ public abstract class AbstractRemote implements IRemote { } } - public Map add(String runAsUser, String ticket, - Map setParams) throws HSAdminException { + public Map add(String runAsUser, String ticket, + Map setParams) throws HSAdminException { String user = runAsUser; Transaction transaction = new Transaction(user); try { @@ -82,7 +82,7 @@ public abstract class AbstractRemote implements IRemote { transaction.beginTransaction(); AbstractEntity insertedEntity = module.add(entity); transaction.commitTransaction(); - HashMap entry = new HashMap(); + HashMap entry = new HashMap(); entity2map(insertedEntity, entry); return entry; } else { @@ -131,8 +131,8 @@ public abstract class AbstractRemote implements IRemote { } } - public List> update(String runAsUser, String ticket, - Map setParams, Map whereParams) + public List> update(String runAsUser, String ticket, + Map setParams, Map whereParams) throws HSAdminException { String user = runAsUser; Transaction transaction = new Transaction(user); @@ -140,7 +140,7 @@ public abstract class AbstractRemote implements IRemote { if (authentication.login(user, ticket)) { ModuleInterface module = new GenericModuleImpl(transaction); UnixUser unixUser = transaction.getLoginUser(); - ArrayList> result = new ArrayList>(); + ArrayList> result = new ArrayList>(); String queryCondition = buildQueryCondition(whereParams); if (queryCondition == null || queryCondition.length() == 0) { throw new HSAdminException( @@ -154,7 +154,7 @@ public abstract class AbstractRemote implements IRemote { transaction.detach(update); map2entity(setParams, update); update = module.update(update); - HashMap entry = new HashMap(); + HashMap entry = new HashMap(); entity2map(update, entry); result.add(entry); } else { diff --git a/hsarback/src/de/hsadmin/remote/CustomerRemote.java b/hsarback/src/de/hsadmin/remote/CustomerRemote.java index bce4ad8..404639c 100644 --- a/hsarback/src/de/hsadmin/remote/CustomerRemote.java +++ b/hsarback/src/de/hsadmin/remote/CustomerRemote.java @@ -23,7 +23,7 @@ public class CustomerRemote extends AbstractRemote { @Override protected void entity2map(AbstractEntity entity, - Map resultMap) { + Map resultMap) { Customer cust = (Customer) entity; resultMap.put("id", Long.toString(cust.getId())); resultMap.put("membercode", cust.getName()); @@ -83,26 +83,26 @@ public class CustomerRemote extends AbstractRemote { } @Override - protected void map2entity(Map setParams, + protected void map2entity(Map setParams, AbstractEntity entity) { Customer cust = (Customer) entity; - String idStr = setParams.get("id"); + String idStr = (String) setParams.get("id"); if (assertNotNull(idStr)) { cust.setId(Long.parseLong(idStr)); } - String memberCode = setParams.get("membercode"); + String memberCode = (String) setParams.get("membercode"); if (assertNotNull(memberCode)) { cust.setName(memberCode); } - String password = setParams.get("password"); + String password = (String) setParams.get("password"); if (assertNotNull(password)) { cust.setPassword(password); } - String memberNo = setParams.get("memberno"); + String memberNo = (String) setParams.get("memberno"); if (assertNotNull(memberNo)) { cust.setMemberNo(Integer.parseInt(memberNo)); } - String memberSince = setParams.get("membersince"); + String memberSince = (String) setParams.get("membersince"); if (assertNotNull(memberSince)) { try { cust.setMemberSince(df.parse(memberSince)); @@ -110,7 +110,7 @@ public class CustomerRemote extends AbstractRemote { // don't care } } - String memberUntil = setParams.get("memberuntil"); + String memberUntil = (String) setParams.get("memberuntil"); if (assertNotNull(memberUntil)) { try { cust.setMemberUntil(df.parse(memberUntil)); @@ -118,11 +118,11 @@ public class CustomerRemote extends AbstractRemote { // don't care } } - String memberRole = setParams.get("memberrole"); + String memberRole = (String) setParams.get("memberrole"); if (assertNotNull(memberRole)) { cust.setMemberRole(memberRole); } - String authorContract = setParams.get("authorcontract"); + String authorContract = (String) setParams.get("authorcontract"); if (assertNotNull(authorContract)) { try { cust.setAuthorContract(df.parse(authorContract)); @@ -130,7 +130,7 @@ public class CustomerRemote extends AbstractRemote { // don't care } } - String nonDiscContract = setParams.get("nondisccontract"); + String nonDiscContract = (String) setParams.get("nondisccontract"); if (assertNotNull(nonDiscContract)) { try { cust.setNonDiscContract(df.parse(nonDiscContract)); @@ -138,7 +138,7 @@ public class CustomerRemote extends AbstractRemote { // don't care } } - String sharesUpdated = setParams.get("sharesupdated"); + String sharesUpdated = (String) setParams.get("sharesupdated"); if (assertNotNull(sharesUpdated)) { try { cust.setSharesUpdated(df.parse(sharesUpdated)); @@ -146,11 +146,11 @@ public class CustomerRemote extends AbstractRemote { // don't care } } - String sharesSigned = setParams.get("sharessigned"); + String sharesSigned = (String) setParams.get("sharessigned"); if (assertNotNull(sharesSigned)) { cust.setId(Integer.parseInt(sharesSigned)); } - String uidVat = setParams.get("uidvat"); + String uidVat = (String) setParams.get("uidvat"); if (assertNotNull(uidVat)) { cust.setUidVAT(uidVat); } @@ -160,34 +160,34 @@ public class CustomerRemote extends AbstractRemote { bank.setCustomer(cust); cust.setBankAccount(bank); } - String autoDebitGA = setParams.get("autodebit_ga"); + String autoDebitGA = (String) setParams.get("autodebit_ga"); if (assertNotNull(autoDebitGA)) { autoDebitGA = autoDebitGA.toUpperCase(); bank.setAutoDebitGA(new Boolean(autoDebitGA.startsWith("T") || autoDebitGA.startsWith("Y"))); } - String autoDebitAR = setParams.get("autodebit_ar"); + String autoDebitAR = (String) setParams.get("autodebit_ar"); if (assertNotNull(autoDebitAR)) { autoDebitAR = autoDebitAR.toUpperCase(); bank.setAutoDebitAR(new Boolean(autoDebitAR.startsWith("T") || autoDebitAR.startsWith("Y"))); } - String autoDebitOP = setParams.get("autodebit_op"); + String autoDebitOP = (String) setParams.get("autodebit_op"); if (assertNotNull(autoDebitOP)) { autoDebitOP = autoDebitOP.toUpperCase(); bank.setAutoDebitOP(new Boolean(autoDebitOP.startsWith("T") || autoDebitOP.startsWith("Y"))); } - String bankCustomer = setParams.get("bank_customer"); + String bankCustomer = (String) setParams.get("bank_customer"); if (assertNotNull(bankCustomer)) { bank.setBankCustomer(bankCustomer); } - String bankAccount = setParams.get("bank_account"); + String bankAccount = (String) setParams.get("bank_account"); if (assertNotNull(bankAccount)) { bank.setBankAccount(bankAccount); } - String bankCode = setParams.get("bank_code"); + String bankCode = (String) setParams.get("bank_code"); if (assertNotNull(bankCode)) { bank.setBankCode(bankCode); } - String bankName = setParams.get("bank_name"); + String bankName = (String) setParams.get("bank_name"); if (assertNotNull(bankName)) { bank.setBankName(bankName); } @@ -199,63 +199,63 @@ public class CustomerRemote extends AbstractRemote { } else { c = contacts.iterator().next(); } - String salut = setParams.get("contact_salut"); + String salut = (String) setParams.get("contact_salut"); if (assertNotNull(salut)) { c.setSalut(salut); } - String title = setParams.get("contact_title"); + String title = (String) setParams.get("contact_title"); if (assertNotNull(title)) { c.setTitle(title); } - String firstName = setParams.get("contact_firstname"); + String firstName = (String) setParams.get("contact_firstname"); if (assertNotNull(firstName)) { c.setFirstName(firstName); } - String lastName = setParams.get("contact_lastname"); + String lastName = (String) setParams.get("contact_lastname"); if (assertNotNull(lastName)) { c.setLastName(lastName); } - String firma = setParams.get("contact_firma"); + String firma = (String) setParams.get("contact_firma"); if (assertNotNull(firma)) { c.setLastName(firma); } - String co = setParams.get("contact_co"); + String co = (String) setParams.get("contact_co"); if (assertNotNull(co)) { c.setCo(co); } - String street = setParams.get("contact_street"); + String street = (String) setParams.get("contact_street"); if (assertNotNull(street)) { c.setStreet(street); } - String zipCode = setParams.get("contact_zipcode"); + String zipCode = (String) setParams.get("contact_zipcode"); if (assertNotNull(zipCode)) { c.setZipCode(zipCode); } - String city = setParams.get("contact_city"); + String city = (String) setParams.get("contact_city"); if (assertNotNull(city)) { c.setCity(city); } - String country = setParams.get("contact_country"); + String country = (String) setParams.get("contact_country"); if (assertNotNull(country)) { c.setCountry(country); } - String phonePrivate = setParams.get("contact_phone_private"); + String phonePrivate = (String) setParams.get("contact_phone_private"); if (assertNotNull(phonePrivate)) { c.setPhonePrivate(phonePrivate); } - String phoneOffice = setParams.get("contact_phone_office"); + String phoneOffice = (String) setParams.get("contact_phone_office"); if (assertNotNull(phoneOffice)) { c.setPhoneOffice(phoneOffice); } - String phoneMobile = setParams.get("contact_phone_mobile"); + String phoneMobile = (String) setParams.get("contact_phone_mobile"); if (assertNotNull(phoneMobile)) { c.setPhoneMobile(phoneMobile); } - String fax = setParams.get("contact_fax"); + String fax = (String) setParams.get("contact_fax"); if (assertNotNull(fax)) { c.setFax(fax); } - String eMail = setParams.get("contact_email"); + String eMail = (String) setParams.get("contact_email"); if (assertNotNull(eMail)) { c.setEmail(eMail); } diff --git a/hsarback/src/de/hsadmin/remote/DomainRemote.java b/hsarback/src/de/hsadmin/remote/DomainRemote.java index 01ed191..f4024df 100644 --- a/hsarback/src/de/hsadmin/remote/DomainRemote.java +++ b/hsarback/src/de/hsadmin/remote/DomainRemote.java @@ -19,7 +19,7 @@ public class DomainRemote extends AbstractRemote { } @Override - protected void entity2map(AbstractEntity entity, Map resultMap) { + protected void entity2map(AbstractEntity entity, Map resultMap) { Domain dom = (Domain) entity; String id = Long.toString(dom.getId()); resultMap.put("id", id); @@ -39,10 +39,10 @@ public class DomainRemote extends AbstractRemote { } @Override - protected void map2entity(Map setParams, AbstractEntity entity) { + protected void map2entity(Map setParams, AbstractEntity entity) { Domain dom = (Domain) entity; - String name = setParams.get("name"); - String user = setParams.get("user"); + String name = (String) setParams.get("name"); + String user = (String) setParams.get("user"); if (assertNotNull(name)) { dom.setName(name); } diff --git a/hsarback/src/de/hsadmin/remote/EMailAddressRemote.java b/hsarback/src/de/hsadmin/remote/EMailAddressRemote.java index 15c957e..dfa01eb 100644 --- a/hsarback/src/de/hsadmin/remote/EMailAddressRemote.java +++ b/hsarback/src/de/hsadmin/remote/EMailAddressRemote.java @@ -1,5 +1,6 @@ package de.hsadmin.remote; +import java.util.List; import java.util.Map; import de.hsadmin.core.model.AbstractEntity; @@ -9,7 +10,7 @@ import de.hsadmin.mods.email.EMailAddress; public class EMailAddressRemote extends AbstractRemote { @Override - protected void entity2map(AbstractEntity entity, Map map) { + protected void entity2map(AbstractEntity entity, Map map) { EMailAddress adr = (EMailAddress) entity; long id = adr.getId(); String domain = adr.getDomain().getName(); @@ -32,21 +33,36 @@ public class EMailAddressRemote extends AbstractRemote { } @Override - protected void map2entity(Map map, AbstractEntity entity) { + protected void map2entity(Map map, AbstractEntity entity) { EMailAddress adr = (EMailAddress) entity; - String localpart = map.get("localpart"); + String localpart = (String) map.get("localpart"); if (assertNotNull(localpart)) { adr.setLocalpart(localpart); } - String subdomain = map.get("subdomain"); + String subdomain = (String) map.get("subdomain"); if (assertNotNull(subdomain)) { adr.setSubdomain(subdomain); } - String target = map.get("target"); - if (assertNotNull(target)) { - adr.setTarget(target); + Object l = map.get("target"); + if (l instanceof String) { + String target = (String) l; + if (assertNotNull(target)) { + adr.setTarget(target); + } } - String domain = map.get("domain"); + if (l instanceof List) { + StringBuffer tBuff = new StringBuffer(); + for (Object o : (List) l) { + if (o instanceof String) { + if (tBuff.length() > 0) { + tBuff.append(','); + } + tBuff.append((String) o); + } + } + adr.setTarget(tBuff.toString()); + } + String domain = (String) map.get("domain"); if (assertNotNull(domain)) { Domain dom = new Domain(); dom.setName(domain); diff --git a/hsarback/src/de/hsadmin/remote/EMailAliasRemote.java b/hsarback/src/de/hsadmin/remote/EMailAliasRemote.java index c07ef4c..998c8f7 100644 --- a/hsarback/src/de/hsadmin/remote/EMailAliasRemote.java +++ b/hsarback/src/de/hsadmin/remote/EMailAliasRemote.java @@ -1,5 +1,6 @@ package de.hsadmin.remote; +import java.util.List; import java.util.Map; import de.hsadmin.core.model.AbstractEntity; @@ -8,7 +9,7 @@ import de.hsadmin.mods.email.EMailAlias; public class EMailAliasRemote extends AbstractRemote { @Override - protected void entity2map(AbstractEntity entity, Map map) { + protected void entity2map(AbstractEntity entity, Map map) { EMailAlias alias = (EMailAlias) entity; String id = Long.toString(alias.getId()); String name = alias.getName(); @@ -26,15 +27,30 @@ public class EMailAliasRemote extends AbstractRemote { } @Override - protected void map2entity(Map map, AbstractEntity entity) { + protected void map2entity(Map map, AbstractEntity entity) { EMailAlias alias = (EMailAlias) entity; - String name = map.get("name"); - String target = map.get("target"); + String name = (String) map.get("name"); if (assertNotNull(name)) { alias.setName(name); } - if (assertNotNull(target)) { - alias.setTarget(target); + Object l = map.get("target"); + if (l instanceof String) { + String target = (String) l; + if (assertNotNull(target)) { + alias.setTarget(target); + } + } + if (l instanceof List) { + StringBuffer tBuff = new StringBuffer(); + for (Object o : (List) l) { + if (o instanceof String) { + if (tBuff.length() > 0) { + tBuff.append(','); + } + tBuff.append((String) o); + } + } + alias.setTarget(tBuff.toString()); } } diff --git a/hsarback/src/de/hsadmin/remote/IRemote.java b/hsarback/src/de/hsadmin/remote/IRemote.java index 32ca056..48cc2ac 100644 --- a/hsarback/src/de/hsadmin/remote/IRemote.java +++ b/hsarback/src/de/hsadmin/remote/IRemote.java @@ -7,16 +7,16 @@ import de.hsadmin.core.model.HSAdminException; public interface IRemote { - public abstract List> search( + public abstract List> search( String runAsUser, String ticket, Map whereParams ) throws HSAdminException; - public abstract Map add( + public abstract Map add( String runAsUser, String ticket, - Map setParams + Map setParams ) throws HSAdminException; public abstract void delete( @@ -25,10 +25,10 @@ public interface IRemote { Map whereParams ) throws HSAdminException; - public abstract List> update( + public abstract List> update( String runAsUser, String ticket, - Map setParams, + Map setParams, Map whereParams ) throws HSAdminException; diff --git a/hsarback/src/de/hsadmin/remote/MysqlDbRemote.java b/hsarback/src/de/hsadmin/remote/MysqlDbRemote.java index 041ac55..4f29f9b 100644 --- a/hsarback/src/de/hsadmin/remote/MysqlDbRemote.java +++ b/hsarback/src/de/hsadmin/remote/MysqlDbRemote.java @@ -8,7 +8,7 @@ import de.hsadmin.mods.db.MySqlDatabase; public class MysqlDbRemote extends AbstractRemote { @Override - protected void entity2map(AbstractEntity entity, Map map) { + protected void entity2map(AbstractEntity entity, Map map) { MySqlDatabase db = (MySqlDatabase) entity; String id = Long.toString(db.getId()); String name = db.getName(); @@ -32,12 +32,12 @@ public class MysqlDbRemote extends AbstractRemote { } @Override - protected void map2entity(Map map, AbstractEntity entity) { + protected void map2entity(Map map, AbstractEntity entity) { MySqlDatabase db = (MySqlDatabase) entity; db.setInstance("mysql"); - String name = map.get("name"); - String owner = map.get("owner"); - String encoding = map.get("encoding"); + String name = (String) map.get("name"); + String owner = (String) map.get("owner"); + String encoding = (String) map.get("encoding"); if (assertNotNull(name)) { db.setName(name); } diff --git a/hsarback/src/de/hsadmin/remote/MysqlUserRemote.java b/hsarback/src/de/hsadmin/remote/MysqlUserRemote.java index 11816b3..346713e 100644 --- a/hsarback/src/de/hsadmin/remote/MysqlUserRemote.java +++ b/hsarback/src/de/hsadmin/remote/MysqlUserRemote.java @@ -8,7 +8,7 @@ import de.hsadmin.mods.db.MySqlUser; public class MysqlUserRemote extends AbstractRemote { @Override - protected void entity2map(AbstractEntity entity, Map map) { + protected void entity2map(AbstractEntity entity, Map map) { MySqlUser user = (MySqlUser) entity; String id = Long.toString(user.getId()); String name = user.getName(); @@ -28,11 +28,11 @@ public class MysqlUserRemote extends AbstractRemote { } @Override - protected void map2entity(Map map, AbstractEntity entity) { + protected void map2entity(Map map, AbstractEntity entity) { MySqlUser user = (MySqlUser) entity; user.setInstance("mysql"); - String name = map.get("name"); - String password = map.get("password"); + String name = (String) map.get("name"); + String password = (String) map.get("password"); if (assertNotNull(name)) { user.setName(name); } diff --git a/hsarback/src/de/hsadmin/remote/PacRemote.java b/hsarback/src/de/hsadmin/remote/PacRemote.java index 8b7d8f7..807e3b9 100644 --- a/hsarback/src/de/hsadmin/remote/PacRemote.java +++ b/hsarback/src/de/hsadmin/remote/PacRemote.java @@ -21,7 +21,7 @@ public class PacRemote extends AbstractRemote { private static final DateFormat df = SimpleDateFormat.getDateInstance(DateFormat.SHORT); @Override - protected void entity2map(AbstractEntity entity, Map resultMap) { + protected void entity2map(AbstractEntity entity, Map resultMap) { Pac pac = (Pac) entity; resultMap.put("name", pac.getName()); resultMap.put("id", Long.toString(pac.getId())); @@ -59,10 +59,10 @@ public class PacRemote extends AbstractRemote { } @Override - protected void map2entity(Map setParams, AbstractEntity entity) { + protected void map2entity(Map setParams, AbstractEntity entity) { Pac pac = (Pac) entity; BasePac basePac = pac.getBasepac(); - String basePacName = setParams.get("basepac"); + String basePacName = (String) setParams.get("basepac"); if ((basePac == null || basePac.getName() == null) && assertNotNull(basePacName)) { basePac = new BasePac(); basePac.setName(basePacName); @@ -70,26 +70,26 @@ public class PacRemote extends AbstractRemote { } pac.setCreated(new Date()); INetAddress curINetAddr = pac.getCurINetAddr(); - String inetAddrString = setParams.get("curinetaddr"); + String inetAddrString = (String) setParams.get("curinetaddr"); if ((curINetAddr == null || curINetAddr.getInetAddr() == null) && assertNotNull(inetAddrString)) { curINetAddr = new INetAddress(inetAddrString); pac.setCurINetAddr(curINetAddr); } Customer customer = pac.getCustomer(); - String memberCode = setParams.get("customer"); + String memberCode = (String) setParams.get("customer"); if (customer == null && assertNotNull(memberCode)) { customer = new Customer(); customer.setName(memberCode); pac.setCustomer(customer); } Hive hive = pac.getHive(); - String hiveName = setParams.get("hive"); + String hiveName = (String) setParams.get("hive"); if ((hive == null || hive.getName() == null) && assertNotNull(hiveName)) { hive = new Hive(); hive.setName(hiveName); pac.setHive(hive); } - pac.setName(setParams.get("name")); + pac.setName((String) setParams.get("name")); } @Override diff --git a/hsarback/src/de/hsadmin/remote/PgsqlDbRemote.java b/hsarback/src/de/hsadmin/remote/PgsqlDbRemote.java index 1aae396..e3159d9 100644 --- a/hsarback/src/de/hsadmin/remote/PgsqlDbRemote.java +++ b/hsarback/src/de/hsadmin/remote/PgsqlDbRemote.java @@ -8,7 +8,7 @@ import de.hsadmin.mods.db.PgSqlDatabase; public class PgsqlDbRemote extends AbstractRemote { @Override - protected void entity2map(AbstractEntity entity, Map map) { + protected void entity2map(AbstractEntity entity, Map map) { PgSqlDatabase db = (PgSqlDatabase) entity; String id = Long.toString(db.getId()); String name = db.getName(); @@ -32,12 +32,12 @@ public class PgsqlDbRemote extends AbstractRemote { } @Override - protected void map2entity(Map map, AbstractEntity entity) { + protected void map2entity(Map map, AbstractEntity entity) { PgSqlDatabase db = (PgSqlDatabase) entity; db.setInstance("pgsql"); - String name = map.get("name"); - String owner = map.get("owner"); - String encoding = map.get("encoding"); + String name = (String) map.get("name"); + String owner = (String) map.get("owner"); + String encoding = (String) map.get("encoding"); if (assertNotNull(name)) { db.setName(name); } diff --git a/hsarback/src/de/hsadmin/remote/PgsqlUserRemote.java b/hsarback/src/de/hsadmin/remote/PgsqlUserRemote.java index fd6f69e..8ffeab2 100644 --- a/hsarback/src/de/hsadmin/remote/PgsqlUserRemote.java +++ b/hsarback/src/de/hsadmin/remote/PgsqlUserRemote.java @@ -8,7 +8,7 @@ import de.hsadmin.mods.db.PgSqlUser; public class PgsqlUserRemote extends AbstractRemote { @Override - protected void entity2map(AbstractEntity entity, Map map) { + protected void entity2map(AbstractEntity entity, Map map) { PgSqlUser user = (PgSqlUser) entity; String id = Long.toString(user.getId()); String name = user.getName(); @@ -28,11 +28,11 @@ public class PgsqlUserRemote extends AbstractRemote { } @Override - protected void map2entity(Map map, AbstractEntity entity) { + protected void map2entity(Map map, AbstractEntity entity) { PgSqlUser user = (PgSqlUser) entity; user.setInstance("pgsql"); - String name = map.get("name"); - String password = map.get("password"); + String name = (String) map.get("name"); + String password = (String) map.get("password"); if (assertNotNull(name)) { user.setName(name); } diff --git a/hsarback/src/de/hsadmin/remote/QueueTaskRemote.java b/hsarback/src/de/hsadmin/remote/QueueTaskRemote.java index 632e43e..1960be8 100644 --- a/hsarback/src/de/hsadmin/remote/QueueTaskRemote.java +++ b/hsarback/src/de/hsadmin/remote/QueueTaskRemote.java @@ -20,7 +20,7 @@ public class QueueTaskRemote extends AbstractRemote { } @Override - protected void entity2map(AbstractEntity entity, Map resultMap) { + protected void entity2map(AbstractEntity entity, Map resultMap) { QueueTask task = (QueueTask) entity; resultMap.put("id", Long.toString(task.getId())); QueueTaskStatus status = task.getStatus(); @@ -41,7 +41,7 @@ public class QueueTaskRemote extends AbstractRemote { } @Override - protected void map2entity(Map setParams, AbstractEntity entity) { + protected void map2entity(Map setParams, AbstractEntity entity) { // never used } diff --git a/hsarback/src/de/hsadmin/remote/RoleRemote.java b/hsarback/src/de/hsadmin/remote/RoleRemote.java index dce073c..e1a1269 100644 --- a/hsarback/src/de/hsadmin/remote/RoleRemote.java +++ b/hsarback/src/de/hsadmin/remote/RoleRemote.java @@ -24,7 +24,7 @@ public class RoleRemote implements IRemote { } @Override - public List> search(String runAsUser, String ticket, + public List> search(String runAsUser, String ticket, Map whereParams) throws HSAdminException { String user = runAsUser; Transaction transaction = new Transaction(user); @@ -54,8 +54,8 @@ public class RoleRemote implements IRemote { role = "DOM_ADMIN"; } } - List> result = new ArrayList>(); - Map record = new HashMap(); + List> result = new ArrayList>(); + Map record = new HashMap(); record.put("role", role); result.add(record); transaction.close(); @@ -67,14 +67,14 @@ public class RoleRemote implements IRemote { } @Override - public Map add(String runAsUser, String ticket, - Map setParams) throws HSAdminException { + public Map add(String runAsUser, String ticket, + Map setParams) throws HSAdminException { throw new HSAdminException("not implemented"); } @Override - public List> update(String runAsUser, String ticket, - Map setParams, Map whereParams) + public List> update(String runAsUser, String ticket, + Map setParams, Map whereParams) throws HSAdminException { throw new HSAdminException("not implemented"); } diff --git a/hsarback/src/de/hsadmin/remote/UnixUserRemote.java b/hsarback/src/de/hsadmin/remote/UnixUserRemote.java index db29a67..d1a63a8 100644 --- a/hsarback/src/de/hsadmin/remote/UnixUserRemote.java +++ b/hsarback/src/de/hsadmin/remote/UnixUserRemote.java @@ -13,7 +13,7 @@ public class UnixUserRemote extends AbstractRemote { } @Override - protected void entity2map(AbstractEntity entity, Map map) { + protected void entity2map(AbstractEntity entity, Map map) { UnixUser user = (UnixUser) entity; map.put("id", Long.toString(user.getId())); map.put("name", user.getName()); @@ -33,41 +33,41 @@ public class UnixUserRemote extends AbstractRemote { } @Override - protected void map2entity(Map map, AbstractEntity entity) { + protected void map2entity(Map map, AbstractEntity entity) { UnixUser user = (UnixUser) entity; - String id = map.get("id"); + String id = (String) map.get("id"); if (assertNotNull(id)) { user.setId(Long.parseLong(id)); } - String name = map.get("name"); + String name = (String) map.get("name"); if (assertNotNull(name)) { user.setName(name); } - String password = map.get("password"); + String password = (String) map.get("password"); if (assertNotNull(password)) { user.setPassword(password); } - String comment = map.get("comment"); + String comment = (String) map.get("comment"); if (assertNotNull(comment)) { user.setComment(comment); } - String userid = map.get("userid"); + String userid = (String) map.get("userid"); if (assertNotNull(userid)) { user.setUserId(Long.parseLong(userid)); } - String shell = map.get("shell"); + String shell = (String) map.get("shell"); if (assertNotNull(shell)) { user.setShell(shell); } - String homedir = map.get("homedir"); + String homedir = (String) map.get("homedir"); if (assertNotNull(homedir)) { user.setHomedir(homedir); } - String quota = map.get("quota_softlimit"); + String quota = (String) map.get("quota_softlimit"); if (assertNotNull(quota)) { user.setQuotaSoftlimit(Integer.parseInt(quota)); } - String quotaLimit = map.get("quota_hardlimit"); + String quotaLimit = (String) map.get("quota_hardlimit"); if (assertNotNull(quotaLimit)) { user.setQuotaHardlimit(Integer.parseInt(quotaLimit)); }