diff --git a/hsarback/src/de/hsadmin/pillar/JsonPillarServlet.java b/hsarback/src/de/hsadmin/pillar/JsonPillarServlet.java index 56c98ee..97362c8 100644 --- a/hsarback/src/de/hsadmin/pillar/JsonPillarServlet.java +++ b/hsarback/src/de/hsadmin/pillar/JsonPillarServlet.java @@ -51,8 +51,16 @@ public class JsonPillarServlet extends HttpServlet { if (hiveFqdn != null && hiveFqdn.length() == 19 && hiveFqdn.endsWith(".hostsharing.net") && hiveFqdn.startsWith("h")) { hiveName = hiveFqdn.substring(0, 3); } else { - em.close(); - throw new ServletException("error in hive parameter"); + if (hiveFqdn != null && hiveFqdn.length() == 20 && hiveFqdn.endsWith(".hostsharing.net") && hiveFqdn.startsWith("h")) { + hiveName = hiveFqdn.substring(0, 4); + } else { + if (hiveFqdn != null && hiveFqdn.length() == 22 && hiveFqdn.endsWith(".hostsharing.net") && hiveFqdn.startsWith("vm")) { + hiveName = hiveFqdn.substring(0, 6); + } else { + em.close(); + throw new ServletException("error in hive parameter"); + } + } } final Query hiveQuery = em.createQuery("SELECT h FROM Hives h WHERE h.name = :hive"); hiveQuery.setParameter("hive", hiveName);