fix error: packet is now created as requested
This commit is contained in:
parent
d61b2a2b35
commit
9148f924b2
@ -2,11 +2,13 @@
|
||||
-- Table: basepacket
|
||||
--
|
||||
INSERT INTO basepacket (basepacket_code, description, sorting, valid, article_number)
|
||||
VALUES ('DW/B', 'Dynamic-Web/Base', 200, true, 100);
|
||||
VALUES ('DW/B', 'Dynamic-Web/Base', 300, true, 100);
|
||||
INSERT INTO basepacket (basepacket_code, description, sorting, valid, article_number)
|
||||
VALUES ('SW/B', 'Static-Web/Base', 300, true, 200);
|
||||
VALUES ('SW/B', 'Static-Web/Base', 400, true, 200);
|
||||
INSERT INTO basepacket (basepacket_code, description, sorting, valid, article_number)
|
||||
VALUES ('PAC', 'PAC/Web', 100, true, 300);
|
||||
VALUES ('WEB', 'Web/Base', 100, true, 300);
|
||||
INSERT INTO basepacket (basepacket_code, description, sorting, valid, article_number)
|
||||
VALUES ('HIVE', 'Managed Server', 200, true, 400);
|
||||
|
||||
--
|
||||
-- Table: basecomponent
|
||||
|
@ -158,4 +158,9 @@ public class BasePac implements Serializable {
|
||||
public void setArticleNumber(int articleNumber) {
|
||||
this.articleNumber = articleNumber;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BasePac \"" + getName() + "\"";
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,11 @@ import de.hsadmin.mods.user.UnixUser;
|
||||
@AnnModuleImpl(de.hsadmin.mods.pac.PacModuleImpl.class)
|
||||
public class Pac extends AbstractEntity implements Serializable {
|
||||
|
||||
public static final String PAC_WEB_BASE = "WEB";
|
||||
public static final String PAC_HIVE = "HIVE";
|
||||
public static final String PAC_DW_BASE = "DW/B";
|
||||
public static final String PAC_SW_BASE = "SW/B";
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
|
@ -25,7 +25,7 @@ public class PacProcessorFactory implements EntityProcessorFactory {
|
||||
EntityManager em, T entity) throws ProcessorException {
|
||||
Pac pac = (Pac) entity;
|
||||
String basepacName = pac.getBasepac().getName();
|
||||
if (basepacName.startsWith("PAC") || basepacName.startsWith("DW") || basepacName.startsWith("SW")) {
|
||||
if (basepacName.equals(Pac.PAC_WEB_BASE) || basepacName.equals(Pac.PAC_DW_BASE) || basepacName.equals(Pac.PAC_SW_BASE)) {
|
||||
String pacName = pac.getName();
|
||||
Hive hive = pac.getHive();
|
||||
UnixUser unixUser = getPacAdminUser(pac);
|
||||
@ -79,7 +79,7 @@ public class PacProcessorFactory implements EntityProcessorFactory {
|
||||
throws ProcessorException {
|
||||
Pac pac = (Pac) entity;
|
||||
String basepacName = pac.getBasepac().getName();
|
||||
if (basepacName.startsWith("PAC") || basepacName.startsWith("DW") || basepacName.startsWith("SW")) {
|
||||
if (basepacName.equals(Pac.PAC_WEB_BASE) || basepacName.equals(Pac.PAC_DW_BASE) || basepacName.equals(Pac.PAC_SW_BASE)) {
|
||||
return createSetQuotaProc(pac);
|
||||
} else {
|
||||
return new NullProcessor();
|
||||
@ -90,7 +90,7 @@ public class PacProcessorFactory implements EntityProcessorFactory {
|
||||
public <T extends AbstractEntity> Processor createDeleteProcessor(EntityManager em, T entity) throws ProcessorException {
|
||||
Pac pac = (Pac) entity;
|
||||
String basepacName = pac.getBasepac().getName();
|
||||
if (basepacName.startsWith("PAC") || basepacName.startsWith("DW") || basepacName.startsWith("SW")) {
|
||||
if (basepacName.equals(Pac.PAC_WEB_BASE) || basepacName.equals(Pac.PAC_DW_BASE) || basepacName.equals(Pac.PAC_SW_BASE)) {
|
||||
Hive hive = pac.getHive();
|
||||
WaitingTasksProcessor waiting = new WaitingTasksProcessor(createDelUserProc(pac.getName()));
|
||||
waiting.appendProcessor(pac.getHiveName(), new CompoundProcessor(
|
||||
|
@ -51,7 +51,7 @@ public class PacRemote extends AbstractRemote {
|
||||
Pac pac = (Pac) entity;
|
||||
BasePac basePac = pac.getBasepac();
|
||||
String basePacName = (String) setParams.get("basepac");
|
||||
if ((basePac == null || basePac.getName() == null) && assertNotNull(basePacName)) {
|
||||
if (assertNotNull(basePacName)) {
|
||||
basePac = new BasePac();
|
||||
basePac.setName(basePacName);
|
||||
pac.setBasepac(basePac);
|
||||
|
@ -77,7 +77,7 @@ public class InitDataTest {
|
||||
setParams.put("name", "aaa00");
|
||||
setParams.put("hive", "h99");
|
||||
setParams.put("customer", "hsh00-aaa");
|
||||
setParams.put("basepac", "PAC/WEB");
|
||||
setParams.put("basepac", "WEB");
|
||||
setParams.put("curinetaddr", "176.9.242.74");
|
||||
Object[] params = new Object[] { user,
|
||||
cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()),
|
||||
|
Loading…
Reference in New Issue
Block a user