allow hivename hxxx and vmxxxx in JsonPillar
This commit is contained in:
parent
139ac93193
commit
40f4429922
@ -50,10 +50,18 @@ public class JsonPillarServlet extends HttpServlet {
|
|||||||
String hiveName = "";
|
String hiveName = "";
|
||||||
if (hiveFqdn != null && hiveFqdn.length() == 19 && hiveFqdn.endsWith(".hostsharing.net") && hiveFqdn.startsWith("h")) {
|
if (hiveFqdn != null && hiveFqdn.length() == 19 && hiveFqdn.endsWith(".hostsharing.net") && hiveFqdn.startsWith("h")) {
|
||||||
hiveName = hiveFqdn.substring(0, 3);
|
hiveName = hiveFqdn.substring(0, 3);
|
||||||
|
} else {
|
||||||
|
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 {
|
} else {
|
||||||
em.close();
|
em.close();
|
||||||
throw new ServletException("error in hive parameter");
|
throw new ServletException("error in hive parameter");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
final Query hiveQuery = em.createQuery("SELECT h FROM Hives h WHERE h.name = :hive");
|
final Query hiveQuery = em.createQuery("SELECT h FROM Hives h WHERE h.name = :hive");
|
||||||
hiveQuery.setParameter("hive", hiveName);
|
hiveQuery.setParameter("hive", hiveName);
|
||||||
final Object hiveResult = hiveQuery.getSingleResult();
|
final Object hiveResult = hiveQuery.getSingleResult();
|
||||||
|
Loading…
Reference in New Issue
Block a user