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