From 6fc86145cabeb378a7daa52ab859345db97a5716 Mon Sep 17 00:00:00 2001 From: HuangXin Date: Sat, 9 Oct 2021 14:59:16 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20REM:=201.=20=E9=B9=8F=E4=BF=A1=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=94=B9=E5=90=8D=E4=B8=BA=E9=9B=86=E5=9B=A2=E4=B8=80?= =?UTF-8?q?=E9=94=AE=E5=A4=84=E7=BD=AE=E8=AE=BE=E5=A4=87PengXin->Cmhi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/CmhiDisposeAbilityInfo.java} | 78 ++-- .../common/CmhiDisposeAbilityRsp.java} | 62 +-- .../dispose/common/CmhiDisposeBaseResp.java} | 48 +-- .../dispose/common/CmhiDisposeLoginReq.java} | 52 +-- .../dispose/common/CmhiDisposeLoginRsp.java} | 76 ++-- .../common/CmhiDisposeStartTaskItem.java} | 76 ++-- .../common/CmhiDisposeStartTaskReq.java} | 48 +-- .../common/CmhiDisposeStartTaskRsp.java} | 58 +-- .../common/CmhiDisposeStartedItem.java} | 68 +-- .../common/CmhiDisposeStopTaskReq.java} | 44 +- .../common/CmhiDisposeStopTaskRsp.java} | 56 +-- .../common/CmhiDisposeStoppedItem.java} | 80 ++-- .../common/CmhiDisposeTaskStatus.java} | 6 +- .../common/CmhiDisposeTaskStatusItem.java} | 4 +- .../common/CmhiDisposeTaskStatusRsp.java} | 6 +- .../protocol/CmhiDisposeInterface.java} | 386 +++++++++--------- .../ability/impl/PengXinAbilityImpl.java | 34 +- .../dispose/ability/impl/UpfAbilityImpl.java | 26 +- .../com/dispose/common/DisposeDeviceType.java | 2 +- .../impl/DeviceTaskManagerServiceImpl.java | 12 +- .../impl/DisposeAbilityRouterServiceImpl.java | 2 +- 21 files changed, 612 insertions(+), 612 deletions(-) rename src/main/java/com/{pengxin/dispose/common/PengXinDisposeAbilityInfo.java => cmhi/dispose/common/CmhiDisposeAbilityInfo.java} (85%) rename src/main/java/com/{pengxin/dispose/common/PengXinDisposeAbilityRsp.java => cmhi/dispose/common/CmhiDisposeAbilityRsp.java} (75%) rename src/main/java/com/{pengxin/dispose/common/PengXinBaseResp.java => cmhi/dispose/common/CmhiDisposeBaseResp.java} (79%) rename src/main/java/com/{pengxin/dispose/common/PengXinLoginReq.java => cmhi/dispose/common/CmhiDisposeLoginReq.java} (80%) rename src/main/java/com/{pengxin/dispose/common/PengXinLoginRsp.java => cmhi/dispose/common/CmhiDisposeLoginRsp.java} (83%) rename src/main/java/com/{pengxin/dispose/common/PengXinStartTaskItem.java => cmhi/dispose/common/CmhiDisposeStartTaskItem.java} (84%) rename src/main/java/com/{pengxin/dispose/common/PengXinStartTaskReq.java => cmhi/dispose/common/CmhiDisposeStartTaskReq.java} (70%) rename src/main/java/com/{pengxin/dispose/common/PengXinStartTaskRsp.java => cmhi/dispose/common/CmhiDisposeStartTaskRsp.java} (76%) rename src/main/java/com/{pengxin/dispose/common/PengXinStartedItem.java => cmhi/dispose/common/CmhiDisposeStartedItem.java} (82%) rename src/main/java/com/{pengxin/dispose/common/PengXinStopTaskReq.java => cmhi/dispose/common/CmhiDisposeStopTaskReq.java} (77%) rename src/main/java/com/{pengxin/dispose/common/PengXinStopTaskRsp.java => cmhi/dispose/common/CmhiDisposeStopTaskRsp.java} (76%) rename src/main/java/com/{pengxin/dispose/common/PengXinStoppedItem.java => cmhi/dispose/common/CmhiDisposeStoppedItem.java} (84%) rename src/main/java/com/{pengxin/dispose/common/PengXinTaskStatus.java => cmhi/dispose/common/CmhiDisposeTaskStatus.java} (92%) rename src/main/java/com/{pengxin/dispose/common/PengXinTaskStatusItem.java => cmhi/dispose/common/CmhiDisposeTaskStatusItem.java} (89%) rename src/main/java/com/{pengxin/dispose/common/PengXinTaskStatusRsp.java => cmhi/dispose/common/CmhiDisposeTaskStatusRsp.java} (78%) rename src/main/java/com/{pengxin/dispose/protocol/PengXinInterface.java => cmhi/dispose/protocol/CmhiDisposeInterface.java} (66%) diff --git a/src/main/java/com/pengxin/dispose/common/PengXinDisposeAbilityInfo.java b/src/main/java/com/cmhi/dispose/common/CmhiDisposeAbilityInfo.java similarity index 85% rename from src/main/java/com/pengxin/dispose/common/PengXinDisposeAbilityInfo.java rename to src/main/java/com/cmhi/dispose/common/CmhiDisposeAbilityInfo.java index 1611cd3f..6de30611 100644 --- a/src/main/java/com/pengxin/dispose/common/PengXinDisposeAbilityInfo.java +++ b/src/main/java/com/cmhi/dispose/common/CmhiDisposeAbilityInfo.java @@ -1,39 +1,39 @@ -package com.pengxin.dispose.common; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * The type Peng xin dispose ability info. - * - * @author - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonInclude(JsonInclude.Include.NON_NULL) -public class PengXinDisposeAbilityInfo { - /** - * The Type. - */ - private Integer type; - - /** - * The Object type. - */ - private Integer objectType; - - /** - * The Ip type. - */ - @JsonProperty("IPType") - private Integer ipType; - - /** - * The Dispose ip. - */ - private String disposeIp; -} +package com.cmhi.dispose.common; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * The type Peng xin dispose ability info. + * + * @author + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +public class CmhiDisposeAbilityInfo { + /** + * The Type. + */ + private Integer type; + + /** + * The Object type. + */ + private Integer objectType; + + /** + * The Ip type. + */ + @JsonProperty("IPType") + private Integer ipType; + + /** + * The Dispose ip. + */ + private String disposeIp; +} diff --git a/src/main/java/com/pengxin/dispose/common/PengXinDisposeAbilityRsp.java b/src/main/java/com/cmhi/dispose/common/CmhiDisposeAbilityRsp.java similarity index 75% rename from src/main/java/com/pengxin/dispose/common/PengXinDisposeAbilityRsp.java rename to src/main/java/com/cmhi/dispose/common/CmhiDisposeAbilityRsp.java index 3bff8ced..6926cd17 100644 --- a/src/main/java/com/pengxin/dispose/common/PengXinDisposeAbilityRsp.java +++ b/src/main/java/com/cmhi/dispose/common/CmhiDisposeAbilityRsp.java @@ -1,31 +1,31 @@ -package com.pengxin.dispose.common; - -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * The type Peng xin dispose ability rsp. - * - * @author - */ -@EqualsAndHashCode(callSuper = true) -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonInclude(JsonInclude.Include.NON_NULL) -public class PengXinDisposeAbilityRsp extends PengXinBaseResp { - /** - * The Device name. - */ - private String deviceName; - - /** - * The Capacity. - */ - List capacity; -} +package com.cmhi.dispose.common; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * The type Peng xin dispose ability rsp. + * + * @author + */ +@EqualsAndHashCode(callSuper = true) +@Data +@NoArgsConstructor +@AllArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +public class CmhiDisposeAbilityRsp extends CmhiDisposeBaseResp { + /** + * The Device name. + */ + private String deviceName; + + /** + * The Capacity. + */ + List capacity; +} diff --git a/src/main/java/com/pengxin/dispose/common/PengXinBaseResp.java b/src/main/java/com/cmhi/dispose/common/CmhiDisposeBaseResp.java similarity index 79% rename from src/main/java/com/pengxin/dispose/common/PengXinBaseResp.java rename to src/main/java/com/cmhi/dispose/common/CmhiDisposeBaseResp.java index cae32ead..9e918dd4 100644 --- a/src/main/java/com/pengxin/dispose/common/PengXinBaseResp.java +++ b/src/main/java/com/cmhi/dispose/common/CmhiDisposeBaseResp.java @@ -1,24 +1,24 @@ -package com.pengxin.dispose.common; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * The type Peng xin base resp. - * - * @author - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class PengXinBaseResp { - /** - * The Status. - */ - private Integer status; - /** - * The Message. - */ - private String message; -} +package com.cmhi.dispose.common; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * The type Peng xin base resp. + * + * @author + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class CmhiDisposeBaseResp { + /** + * The Status. + */ + private Integer status; + /** + * The Message. + */ + private String message; +} diff --git a/src/main/java/com/pengxin/dispose/common/PengXinLoginReq.java b/src/main/java/com/cmhi/dispose/common/CmhiDisposeLoginReq.java similarity index 80% rename from src/main/java/com/pengxin/dispose/common/PengXinLoginReq.java rename to src/main/java/com/cmhi/dispose/common/CmhiDisposeLoginReq.java index d652d701..9324ac4b 100644 --- a/src/main/java/com/pengxin/dispose/common/PengXinLoginReq.java +++ b/src/main/java/com/cmhi/dispose/common/CmhiDisposeLoginReq.java @@ -1,26 +1,26 @@ -package com.pengxin.dispose.common; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * The type Peng xin login req. - * - * @author - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class PengXinLoginReq { - /** - * The User name. - */ - private String userName; - /** - * The Password. - */ - private String password; -} +package com.cmhi.dispose.common; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * The type Peng xin login req. + * + * @author + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class CmhiDisposeLoginReq { + /** + * The User name. + */ + private String userName; + /** + * The Password. + */ + private String password; +} diff --git a/src/main/java/com/pengxin/dispose/common/PengXinLoginRsp.java b/src/main/java/com/cmhi/dispose/common/CmhiDisposeLoginRsp.java similarity index 83% rename from src/main/java/com/pengxin/dispose/common/PengXinLoginRsp.java rename to src/main/java/com/cmhi/dispose/common/CmhiDisposeLoginRsp.java index a7d620df..faefbb0b 100644 --- a/src/main/java/com/pengxin/dispose/common/PengXinLoginRsp.java +++ b/src/main/java/com/cmhi/dispose/common/CmhiDisposeLoginRsp.java @@ -1,38 +1,38 @@ -package com.pengxin.dispose.common; - -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; - -/** - * The type Peng xin login rsp. - * - * @author - */ -@EqualsAndHashCode(callSuper = true) -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonInclude(JsonInclude.Include.NON_NULL) -public class PengXinLoginRsp extends PengXinBaseResp { - /** - * The User name. - */ - private String userName; - - /** - * The Token. - */ - private String token; - - /** - * The Log time. - */ - private Long logTime; - /** - * The Expire time. - */ - private Long expireTime; -} +package com.cmhi.dispose.common; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +/** + * The type Peng xin login rsp. + * + * @author + */ +@EqualsAndHashCode(callSuper = true) +@Data +@NoArgsConstructor +@AllArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +public class CmhiDisposeLoginRsp extends CmhiDisposeBaseResp { + /** + * The User name. + */ + private String userName; + + /** + * The Token. + */ + private String token; + + /** + * The Log time. + */ + private Long logTime; + /** + * The Expire time. + */ + private Long expireTime; +} diff --git a/src/main/java/com/pengxin/dispose/common/PengXinStartTaskItem.java b/src/main/java/com/cmhi/dispose/common/CmhiDisposeStartTaskItem.java similarity index 84% rename from src/main/java/com/pengxin/dispose/common/PengXinStartTaskItem.java rename to src/main/java/com/cmhi/dispose/common/CmhiDisposeStartTaskItem.java index b6804c4c..8bf0c34d 100644 --- a/src/main/java/com/pengxin/dispose/common/PengXinStartTaskItem.java +++ b/src/main/java/com/cmhi/dispose/common/CmhiDisposeStartTaskItem.java @@ -1,38 +1,38 @@ -package com.pengxin.dispose.common; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * The type Peng xin start task item. - * - * @author - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class PengXinStartTaskItem { - /** - * The Task req id. - */ - private String taskReqId; - /** - * The Type. - */ - private Integer type; - /** - * The Object type. - */ - private Integer objectType; - /** - * The Dispose object. - */ - private String disposeObject; - /** - * The Dispose time. - */ - private Long disposeTime; -} +package com.cmhi.dispose.common; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * The type Peng xin start task item. + * + * @author + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class CmhiDisposeStartTaskItem { + /** + * The Task req id. + */ + private String taskReqId; + /** + * The Type. + */ + private Integer type; + /** + * The Object type. + */ + private Integer objectType; + /** + * The Dispose object. + */ + private String disposeObject; + /** + * The Dispose time. + */ + private Long disposeTime; +} diff --git a/src/main/java/com/pengxin/dispose/common/PengXinStartTaskReq.java b/src/main/java/com/cmhi/dispose/common/CmhiDisposeStartTaskReq.java similarity index 70% rename from src/main/java/com/pengxin/dispose/common/PengXinStartTaskReq.java rename to src/main/java/com/cmhi/dispose/common/CmhiDisposeStartTaskReq.java index 86fc5ee8..2f61bb10 100644 --- a/src/main/java/com/pengxin/dispose/common/PengXinStartTaskReq.java +++ b/src/main/java/com/cmhi/dispose/common/CmhiDisposeStartTaskReq.java @@ -1,24 +1,24 @@ -package com.pengxin.dispose.common; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * The type Peng xin start task req. - * - * @author - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class PengXinStartTaskReq { - /** - * The Items. - */ - List items; -} +package com.cmhi.dispose.common; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * The type Peng xin start task req. + * + * @author + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class CmhiDisposeStartTaskReq { + /** + * The Items. + */ + List items; +} diff --git a/src/main/java/com/pengxin/dispose/common/PengXinStartTaskRsp.java b/src/main/java/com/cmhi/dispose/common/CmhiDisposeStartTaskRsp.java similarity index 76% rename from src/main/java/com/pengxin/dispose/common/PengXinStartTaskRsp.java rename to src/main/java/com/cmhi/dispose/common/CmhiDisposeStartTaskRsp.java index 9ace88b6..5a9a9b7f 100644 --- a/src/main/java/com/pengxin/dispose/common/PengXinStartTaskRsp.java +++ b/src/main/java/com/cmhi/dispose/common/CmhiDisposeStartTaskRsp.java @@ -1,29 +1,29 @@ -package com.pengxin.dispose.common; - -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * The type Peng xin start task rsp. - * - * @author - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonInclude(JsonInclude.Include.NON_NULL) -public class PengXinStartTaskRsp { - /** - * The Device name. - */ - private String deviceName; - - /** - * The Items. - */ - List items; -} +package com.cmhi.dispose.common; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * The type Peng xin start task rsp. + * + * @author + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +public class CmhiDisposeStartTaskRsp { + /** + * The Device name. + */ + private String deviceName; + + /** + * The Items. + */ + List items; +} diff --git a/src/main/java/com/pengxin/dispose/common/PengXinStartedItem.java b/src/main/java/com/cmhi/dispose/common/CmhiDisposeStartedItem.java similarity index 82% rename from src/main/java/com/pengxin/dispose/common/PengXinStartedItem.java rename to src/main/java/com/cmhi/dispose/common/CmhiDisposeStartedItem.java index 35c2a140..e7ecbe80 100644 --- a/src/main/java/com/pengxin/dispose/common/PengXinStartedItem.java +++ b/src/main/java/com/cmhi/dispose/common/CmhiDisposeStartedItem.java @@ -1,34 +1,34 @@ -package com.pengxin.dispose.common; - -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; - -/** - * The type Peng xin started item. - * - * @author - */ -@EqualsAndHashCode(callSuper = true) -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonInclude(JsonInclude.Include.NON_NULL) -public class PengXinStartedItem extends PengXinBaseResp { - /** - * The Task req id. - */ - private String taskReqId; - - /** - * The Task id. - */ - private String taskId; - - /** - * The Expire time. - */ - private Long expireTime; -} +package com.cmhi.dispose.common; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +/** + * The type Peng xin started item. + * + * @author + */ +@EqualsAndHashCode(callSuper = true) +@Data +@NoArgsConstructor +@AllArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +public class CmhiDisposeStartedItem extends CmhiDisposeBaseResp { + /** + * The Task req id. + */ + private String taskReqId; + + /** + * The Task id. + */ + private String taskId; + + /** + * The Expire time. + */ + private Long expireTime; +} diff --git a/src/main/java/com/pengxin/dispose/common/PengXinStopTaskReq.java b/src/main/java/com/cmhi/dispose/common/CmhiDisposeStopTaskReq.java similarity index 77% rename from src/main/java/com/pengxin/dispose/common/PengXinStopTaskReq.java rename to src/main/java/com/cmhi/dispose/common/CmhiDisposeStopTaskReq.java index 7fe16509..d3586e5e 100644 --- a/src/main/java/com/pengxin/dispose/common/PengXinStopTaskReq.java +++ b/src/main/java/com/cmhi/dispose/common/CmhiDisposeStopTaskReq.java @@ -1,22 +1,22 @@ -package com.pengxin.dispose.common; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * The type Peng xin stop task req. - * - * @author - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class PengXinStopTaskReq { - /** - * The Task id. - */ - private String[] taskId; -} +package com.cmhi.dispose.common; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * The type Peng xin stop task req. + * + * @author + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class CmhiDisposeStopTaskReq { + /** + * The Task id. + */ + private String[] taskId; +} diff --git a/src/main/java/com/pengxin/dispose/common/PengXinStopTaskRsp.java b/src/main/java/com/cmhi/dispose/common/CmhiDisposeStopTaskRsp.java similarity index 76% rename from src/main/java/com/pengxin/dispose/common/PengXinStopTaskRsp.java rename to src/main/java/com/cmhi/dispose/common/CmhiDisposeStopTaskRsp.java index 34999f81..f0580e25 100644 --- a/src/main/java/com/pengxin/dispose/common/PengXinStopTaskRsp.java +++ b/src/main/java/com/cmhi/dispose/common/CmhiDisposeStopTaskRsp.java @@ -1,28 +1,28 @@ -package com.pengxin.dispose.common; - -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * The type Peng xin stop task rsp. - * - * @author - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonInclude(JsonInclude.Include.NON_NULL) -public class PengXinStopTaskRsp { - /** - * The Device name. - */ - private String deviceName; - /** - * The Items. - */ - private List items; -} +package com.cmhi.dispose.common; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * The type Peng xin stop task rsp. + * + * @author + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +public class CmhiDisposeStopTaskRsp { + /** + * The Device name. + */ + private String deviceName; + /** + * The Items. + */ + private List items; +} diff --git a/src/main/java/com/pengxin/dispose/common/PengXinStoppedItem.java b/src/main/java/com/cmhi/dispose/common/CmhiDisposeStoppedItem.java similarity index 84% rename from src/main/java/com/pengxin/dispose/common/PengXinStoppedItem.java rename to src/main/java/com/cmhi/dispose/common/CmhiDisposeStoppedItem.java index 422d3c71..dbad9539 100644 --- a/src/main/java/com/pengxin/dispose/common/PengXinStoppedItem.java +++ b/src/main/java/com/cmhi/dispose/common/CmhiDisposeStoppedItem.java @@ -1,40 +1,40 @@ -package com.pengxin.dispose.common; - -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; - -/** - * The type Peng xin stopped item. - * - * @author - */ -@EqualsAndHashCode(callSuper = true) -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonInclude(JsonInclude.Include.NON_NULL) -public class PengXinStoppedItem extends PengXinBaseResp { - /** - * The Task id. - */ - private String taskId; - /** - * The Type. - */ - private Integer type; - /** - * The Object type. - */ - private Integer objectType; - /** - * The Dispose object. - */ - private String disposeObject; - /** - * The Left time. - */ - private Long leftTime; -} +package com.cmhi.dispose.common; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +/** + * The type Peng xin stopped item. + * + * @author + */ +@EqualsAndHashCode(callSuper = true) +@Data +@NoArgsConstructor +@AllArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +public class CmhiDisposeStoppedItem extends CmhiDisposeBaseResp { + /** + * The Task id. + */ + private String taskId; + /** + * The Type. + */ + private Integer type; + /** + * The Object type. + */ + private Integer objectType; + /** + * The Dispose object. + */ + private String disposeObject; + /** + * The Left time. + */ + private Long leftTime; +} diff --git a/src/main/java/com/pengxin/dispose/common/PengXinTaskStatus.java b/src/main/java/com/cmhi/dispose/common/CmhiDisposeTaskStatus.java similarity index 92% rename from src/main/java/com/pengxin/dispose/common/PengXinTaskStatus.java rename to src/main/java/com/cmhi/dispose/common/CmhiDisposeTaskStatus.java index ac00e250..4041ecf1 100644 --- a/src/main/java/com/pengxin/dispose/common/PengXinTaskStatus.java +++ b/src/main/java/com/cmhi/dispose/common/CmhiDisposeTaskStatus.java @@ -1,4 +1,4 @@ -package com.pengxin.dispose.common; +package com.cmhi.dispose.common; import com.dispose.common.BaseEnum; @@ -7,7 +7,7 @@ import com.dispose.common.BaseEnum; * * @author */ -public enum PengXinTaskStatus implements BaseEnum { +public enum CmhiDisposeTaskStatus implements BaseEnum { /** * The Task starting. */ @@ -69,7 +69,7 @@ public enum PengXinTaskStatus implements BaseEnum { * @param code the code * @param readme the readme */ - PengXinTaskStatus(int code, String readme) { + CmhiDisposeTaskStatus(int code, String readme) { this.code = code; this.readme = readme; } diff --git a/src/main/java/com/pengxin/dispose/common/PengXinTaskStatusItem.java b/src/main/java/com/cmhi/dispose/common/CmhiDisposeTaskStatusItem.java similarity index 89% rename from src/main/java/com/pengxin/dispose/common/PengXinTaskStatusItem.java rename to src/main/java/com/cmhi/dispose/common/CmhiDisposeTaskStatusItem.java index 6ab93c42..b89adad6 100644 --- a/src/main/java/com/pengxin/dispose/common/PengXinTaskStatusItem.java +++ b/src/main/java/com/cmhi/dispose/common/CmhiDisposeTaskStatusItem.java @@ -1,4 +1,4 @@ -package com.pengxin.dispose.common; +package com.cmhi.dispose.common; import com.fasterxml.jackson.annotation.JsonInclude; import lombok.AllArgsConstructor; @@ -16,7 +16,7 @@ import lombok.NoArgsConstructor; @NoArgsConstructor @AllArgsConstructor @JsonInclude(JsonInclude.Include.NON_NULL) -public class PengXinTaskStatusItem extends PengXinBaseResp { +public class CmhiDisposeTaskStatusItem extends CmhiDisposeBaseResp { /** * The Task id. */ diff --git a/src/main/java/com/pengxin/dispose/common/PengXinTaskStatusRsp.java b/src/main/java/com/cmhi/dispose/common/CmhiDisposeTaskStatusRsp.java similarity index 78% rename from src/main/java/com/pengxin/dispose/common/PengXinTaskStatusRsp.java rename to src/main/java/com/cmhi/dispose/common/CmhiDisposeTaskStatusRsp.java index ea31c5c6..ff5dc8d4 100644 --- a/src/main/java/com/pengxin/dispose/common/PengXinTaskStatusRsp.java +++ b/src/main/java/com/cmhi/dispose/common/CmhiDisposeTaskStatusRsp.java @@ -1,4 +1,4 @@ -package com.pengxin.dispose.common; +package com.cmhi.dispose.common; import com.fasterxml.jackson.annotation.JsonInclude; import lombok.AllArgsConstructor; @@ -16,7 +16,7 @@ import java.util.List; @NoArgsConstructor @AllArgsConstructor @JsonInclude(JsonInclude.Include.NON_NULL) -public class PengXinTaskStatusRsp { +public class CmhiDisposeTaskStatusRsp { /** * The Device name. @@ -26,5 +26,5 @@ public class PengXinTaskStatusRsp { /** * The Items. */ - private List items; + private List items; } diff --git a/src/main/java/com/pengxin/dispose/protocol/PengXinInterface.java b/src/main/java/com/cmhi/dispose/protocol/CmhiDisposeInterface.java similarity index 66% rename from src/main/java/com/pengxin/dispose/protocol/PengXinInterface.java rename to src/main/java/com/cmhi/dispose/protocol/CmhiDisposeInterface.java index b6977c85..729951ed 100644 --- a/src/main/java/com/pengxin/dispose/protocol/PengXinInterface.java +++ b/src/main/java/com/cmhi/dispose/protocol/CmhiDisposeInterface.java @@ -1,193 +1,193 @@ -package com.pengxin.dispose.protocol; - -import com.dispose.common.ErrorCode; -import com.dispose.pojo.dto.protocol.base.BaseProtocolDTO; -import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO; -import com.dispose.restful.RestfulInterface; -import com.pengxin.dispose.common.PengXinBaseResp; -import com.pengxin.dispose.common.PengXinDisposeAbilityRsp; -import com.pengxin.dispose.common.PengXinLoginReq; -import com.pengxin.dispose.common.PengXinLoginRsp; -import com.pengxin.dispose.common.PengXinStartTaskItem; -import com.pengxin.dispose.common.PengXinStartTaskReq; -import com.pengxin.dispose.common.PengXinStartTaskRsp; -import com.pengxin.dispose.common.PengXinStopTaskReq; -import com.pengxin.dispose.common.PengXinStopTaskRsp; -import com.pengxin.dispose.common.PengXinTaskStatusRsp; -import org.springframework.web.bind.annotation.RequestMethod; - -import javax.servlet.http.HttpServletResponse; -import java.util.List; - -/** - * The type Peng xin interface. - * - * @author - */ -public class PengXinInterface { - /** - * The Ver. - */ - private int ver; - /** - * The Crypto type. - */ - private int cryptoType; - - /** - * Sets params. - * - * @param ver the ver - * @param cryptoType the crypto type - */ - public void setParams(int ver, int cryptoType) { - this.ver = ver; - this.cryptoType = cryptoType; - } - - /** - * Login protocol resp dto. - * - * @param baseUrlPath the base url path - * @param username the username - * @param password the password - * @return the protocol resp dto - */ - public ProtocolRespDTO login(String baseUrlPath, String username, String password) { - - BaseProtocolDTO reqInfo = new BaseProtocolDTO<>(); - - reqInfo.setMsgContent(PengXinLoginReq.builder() - .userName(username) - .password(password) - .build()); - - reqInfo.setCryptoType(this.cryptoType); - reqInfo.setVer(this.ver); - reqInfo.setTimeStamp(System.currentTimeMillis()); - - return RestfulInterface.baseProRun(baseUrlPath, - null, - reqInfo, - PengXinLoginRsp.class, - RequestMethod.POST); - } - - /** - * Gets link status. - * - * @param baseUrlPath the base url path - * @param token the token - * @return the link status - */ - public ErrorCode getLinkStatus(String baseUrlPath, String token) { - ProtocolRespDTO rspInfo = RestfulInterface.baseProRun(baseUrlPath, - token, - null, - PengXinBaseResp.class, - RequestMethod.GET); - if (rspInfo != null && rspInfo.getMsgContent() != null) { - if (rspInfo.getCode() == HttpServletResponse.SC_UNAUTHORIZED) { - return ErrorCode.ERR_LOGOUT; - } else if (rspInfo.getCode() == HttpServletResponse.SC_OK) { - if(rspInfo.getMsgContent().getStatus() != ErrorCode.ERR_OK.getCode()){ - return ErrorCode.ERR_LOGOUT; - } else { - return ErrorCode.ERR_OK; - } - } - } - - return ErrorCode.ERR_UNKNOWNCMD; - } - - /** - * Start dispose task protocol resp dto. - * - * @param baseUrlPath the base url path - * @param token the token - * @param items the items - * @return the protocol resp dto - */ - public ProtocolRespDTO startDisposeTask(String baseUrlPath, String token, - List items) { - BaseProtocolDTO reqInfo = new BaseProtocolDTO<>(); - reqInfo.setMsgContent(new PengXinStartTaskReq()); - - reqInfo.getMsgContent().setItems(items); - reqInfo.setCryptoType(this.cryptoType); - reqInfo.setVer(this.ver); - reqInfo.setTimeStamp(System.currentTimeMillis()); - - return RestfulInterface.baseProRun(baseUrlPath, - token, - reqInfo, - PengXinStartTaskRsp.class, - RequestMethod.POST); - } - - /** - * Stop dispose task protocol resp dto. - * - * @param baseUrlPath the base url path - * @param token the token - * @param taskId the task id - * @return the protocol resp dto - */ - public ProtocolRespDTO stopDisposeTask(String baseUrlPath, String token, String[] taskId) { - BaseProtocolDTO reqInfo = new BaseProtocolDTO<>(); - - reqInfo.setMsgContent(new PengXinStopTaskReq()); - - reqInfo.getMsgContent().setTaskId(taskId); - reqInfo.setCryptoType(this.cryptoType); - reqInfo.setVer(this.ver); - reqInfo.setTimeStamp(System.currentTimeMillis()); - - return RestfulInterface.baseProRun(baseUrlPath, - token, - reqInfo, - PengXinStopTaskRsp.class, - RequestMethod.POST); - } - - /** - * Gets device dispose ability. - * - * @param baseUrlPath the base url path - * @param token the token - * @return the device dispose ability - */ - public ProtocolRespDTO getDeviceDisposeAbility(String baseUrlPath, String token) { - return RestfulInterface.baseProRun(baseUrlPath, - token, - null, - PengXinDisposeAbilityRsp.class, - RequestMethod.GET); - } - - /** - * Gets device task status. - * - * @param baseUrlPath the base url path - * @param token the token - * @param taskId the task id - * @return the device task status - */ - public ProtocolRespDTO getDeviceTaskStatus(String baseUrlPath, String token, String[] taskId) { - BaseProtocolDTO reqInfo = new BaseProtocolDTO<>(); - - reqInfo.setMsgContent(new PengXinStopTaskReq()); - - reqInfo.getMsgContent().setTaskId(taskId); - reqInfo.setCryptoType(this.cryptoType); - reqInfo.setVer(this.ver); - reqInfo.setTimeStamp(System.currentTimeMillis()); - - return RestfulInterface.baseProRun(baseUrlPath, - token, - reqInfo, - PengXinTaskStatusRsp.class, - RequestMethod.POST); - } -} +package com.cmhi.dispose.protocol; + +import com.cmhi.dispose.common.CmhiDisposeAbilityRsp; +import com.cmhi.dispose.common.CmhiDisposeBaseResp; +import com.cmhi.dispose.common.CmhiDisposeLoginReq; +import com.cmhi.dispose.common.CmhiDisposeLoginRsp; +import com.cmhi.dispose.common.CmhiDisposeStartTaskItem; +import com.cmhi.dispose.common.CmhiDisposeStartTaskReq; +import com.cmhi.dispose.common.CmhiDisposeStartTaskRsp; +import com.cmhi.dispose.common.CmhiDisposeStopTaskReq; +import com.cmhi.dispose.common.CmhiDisposeStopTaskRsp; +import com.cmhi.dispose.common.CmhiDisposeTaskStatusRsp; +import com.dispose.common.ErrorCode; +import com.dispose.pojo.dto.protocol.base.BaseProtocolDTO; +import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO; +import com.dispose.restful.RestfulInterface; +import org.springframework.web.bind.annotation.RequestMethod; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * The type Peng xin interface. + * + * @author + */ +public class CmhiDisposeInterface { + /** + * The Ver. + */ + private int ver; + /** + * The Crypto type. + */ + private int cryptoType; + + /** + * Sets params. + * + * @param ver the ver + * @param cryptoType the crypto type + */ + public void setParams(int ver, int cryptoType) { + this.ver = ver; + this.cryptoType = cryptoType; + } + + /** + * Login protocol resp dto. + * + * @param baseUrlPath the base url path + * @param username the username + * @param password the password + * @return the protocol resp dto + */ + public ProtocolRespDTO login(String baseUrlPath, String username, String password) { + + BaseProtocolDTO reqInfo = new BaseProtocolDTO<>(); + + reqInfo.setMsgContent(CmhiDisposeLoginReq.builder() + .userName(username) + .password(password) + .build()); + + reqInfo.setCryptoType(this.cryptoType); + reqInfo.setVer(this.ver); + reqInfo.setTimeStamp(System.currentTimeMillis()); + + return RestfulInterface.baseProRun(baseUrlPath, + null, + reqInfo, + CmhiDisposeLoginRsp.class, + RequestMethod.POST); + } + + /** + * Gets link status. + * + * @param baseUrlPath the base url path + * @param token the token + * @return the link status + */ + public ErrorCode getLinkStatus(String baseUrlPath, String token) { + ProtocolRespDTO rspInfo = RestfulInterface.baseProRun(baseUrlPath, + token, + null, + CmhiDisposeBaseResp.class, + RequestMethod.GET); + if (rspInfo != null && rspInfo.getMsgContent() != null) { + if (rspInfo.getCode() == HttpServletResponse.SC_UNAUTHORIZED) { + return ErrorCode.ERR_LOGOUT; + } else if (rspInfo.getCode() == HttpServletResponse.SC_OK) { + if(rspInfo.getMsgContent().getStatus() != ErrorCode.ERR_OK.getCode()){ + return ErrorCode.ERR_LOGOUT; + } else { + return ErrorCode.ERR_OK; + } + } + } + + return ErrorCode.ERR_UNKNOWNCMD; + } + + /** + * Start dispose task protocol resp dto. + * + * @param baseUrlPath the base url path + * @param token the token + * @param items the items + * @return the protocol resp dto + */ + public ProtocolRespDTO startDisposeTask(String baseUrlPath, String token, + List items) { + BaseProtocolDTO reqInfo = new BaseProtocolDTO<>(); + reqInfo.setMsgContent(new CmhiDisposeStartTaskReq()); + + reqInfo.getMsgContent().setItems(items); + reqInfo.setCryptoType(this.cryptoType); + reqInfo.setVer(this.ver); + reqInfo.setTimeStamp(System.currentTimeMillis()); + + return RestfulInterface.baseProRun(baseUrlPath, + token, + reqInfo, + CmhiDisposeStartTaskRsp.class, + RequestMethod.POST); + } + + /** + * Stop dispose task protocol resp dto. + * + * @param baseUrlPath the base url path + * @param token the token + * @param taskId the task id + * @return the protocol resp dto + */ + public ProtocolRespDTO stopDisposeTask(String baseUrlPath, String token, String[] taskId) { + BaseProtocolDTO reqInfo = new BaseProtocolDTO<>(); + + reqInfo.setMsgContent(new CmhiDisposeStopTaskReq()); + + reqInfo.getMsgContent().setTaskId(taskId); + reqInfo.setCryptoType(this.cryptoType); + reqInfo.setVer(this.ver); + reqInfo.setTimeStamp(System.currentTimeMillis()); + + return RestfulInterface.baseProRun(baseUrlPath, + token, + reqInfo, + CmhiDisposeStopTaskRsp.class, + RequestMethod.POST); + } + + /** + * Gets device dispose ability. + * + * @param baseUrlPath the base url path + * @param token the token + * @return the device dispose ability + */ + public ProtocolRespDTO getDeviceDisposeAbility(String baseUrlPath, String token) { + return RestfulInterface.baseProRun(baseUrlPath, + token, + null, + CmhiDisposeAbilityRsp.class, + RequestMethod.GET); + } + + /** + * Gets device task status. + * + * @param baseUrlPath the base url path + * @param token the token + * @param taskId the task id + * @return the device task status + */ + public ProtocolRespDTO getDeviceTaskStatus(String baseUrlPath, String token, String[] taskId) { + BaseProtocolDTO reqInfo = new BaseProtocolDTO<>(); + + reqInfo.setMsgContent(new CmhiDisposeStopTaskReq()); + + reqInfo.getMsgContent().setTaskId(taskId); + reqInfo.setCryptoType(this.cryptoType); + reqInfo.setVer(this.ver); + reqInfo.setTimeStamp(System.currentTimeMillis()); + + return RestfulInterface.baseProRun(baseUrlPath, + token, + reqInfo, + CmhiDisposeTaskStatusRsp.class, + RequestMethod.POST); + } +} diff --git a/src/main/java/com/dispose/ability/impl/PengXinAbilityImpl.java b/src/main/java/com/dispose/ability/impl/PengXinAbilityImpl.java index 1a555458..3802aa29 100644 --- a/src/main/java/com/dispose/ability/impl/PengXinAbilityImpl.java +++ b/src/main/java/com/dispose/ability/impl/PengXinAbilityImpl.java @@ -1,5 +1,12 @@ package com.dispose.ability.impl; +import com.cmhi.dispose.common.CmhiDisposeAbilityRsp; +import com.cmhi.dispose.common.CmhiDisposeLoginRsp; +import com.cmhi.dispose.common.CmhiDisposeStartTaskItem; +import com.cmhi.dispose.common.CmhiDisposeStartTaskRsp; +import com.cmhi.dispose.common.CmhiDisposeStopTaskRsp; +import com.cmhi.dispose.common.CmhiDisposeTaskStatusRsp; +import com.cmhi.dispose.protocol.CmhiDisposeInterface; import com.dispose.ability.DisposeAbility; import com.dispose.common.DisposeCapacityType; import com.dispose.common.DisposeConfigValue; @@ -12,13 +19,6 @@ import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO; import com.dispose.pojo.entity.ServiceInfo; import com.dispose.pojo.po.MulReturnType; import com.dispose.pojo.vo.DeviceFirewareInfo; -import com.pengxin.dispose.common.PengXinDisposeAbilityRsp; -import com.pengxin.dispose.common.PengXinLoginRsp; -import com.pengxin.dispose.common.PengXinStartTaskItem; -import com.pengxin.dispose.common.PengXinStartTaskRsp; -import com.pengxin.dispose.common.PengXinStopTaskRsp; -import com.pengxin.dispose.common.PengXinTaskStatusRsp; -import com.pengxin.dispose.protocol.PengXinInterface; import inet.ipaddr.IPAddress; import inet.ipaddr.IPAddressString; import lombok.Getter; @@ -48,7 +48,7 @@ public class PengXinAbilityImpl implements DisposeAbility { /** * The Restful interface. */ - private final PengXinInterface restfulInterface = new PengXinInterface(); + private final CmhiDisposeInterface restfulInterface = new CmhiDisposeInterface(); /** * The Peng xin dispose type. */ @@ -150,7 +150,7 @@ public class PengXinAbilityImpl implements DisposeAbility { @Nullable NetflowDirection nfDirection, @Nullable Integer attackType, @Nullable Long duration) { - List reqItems = new ArrayList<>(); + List reqItems = new ArrayList<>(); String url = urlRootPath + "dispose_device/task/start"; @@ -171,7 +171,7 @@ public class PengXinAbilityImpl implements DisposeAbility { duration = -1L; } - reqItems.add(PengXinStartTaskItem.builder() + reqItems.add(CmhiDisposeStartTaskItem.builder() .type(getPengXinTaskType(capType)) .disposeObject(disposeObject) .objectType(getPengXinObjectType(objectType)) @@ -179,7 +179,7 @@ public class PengXinAbilityImpl implements DisposeAbility { .taskReqId(String.valueOf(taskReqId++)) .build()); - ProtocolRespDTO rspInfo = restfulInterface.startDisposeTask(url, token, reqItems); + ProtocolRespDTO rspInfo = restfulInterface.startDisposeTask(url, token, reqItems); // 判断是否token过期 if (rspInfo != null && reLogin(rspInfo, rspInfo.getMsgContent().getItems().get(0).getStatus())) { @@ -244,8 +244,8 @@ public class PengXinAbilityImpl implements DisposeAbility { return new MulReturnType<>(ErrorCode.ERR_PARAMS, null); } - ProtocolRespDTO rspInfo = restfulInterface.stopDisposeTask(url, token, - new String[]{taskId}); + ProtocolRespDTO rspInfo = restfulInterface.stopDisposeTask(url, token, + new String[]{taskId}); // 判断是否token过期 if (rspInfo != null && reLogin(rspInfo, rspInfo.getMsgContent().getItems().get(0).getStatus())) { @@ -365,7 +365,7 @@ public class PengXinAbilityImpl implements DisposeAbility { try { String url = urlRootPath + "dispose_device/information/capacity"; - ProtocolRespDTO rspInfo = restfulInterface.getDeviceDisposeAbility(url, token); + ProtocolRespDTO rspInfo = restfulInterface.getDeviceDisposeAbility(url, token); // 判断是否token过期 if (rspInfo != null && reLogin(rspInfo, rspInfo.getMsgContent().getStatus())) { @@ -458,8 +458,8 @@ public class PengXinAbilityImpl implements DisposeAbility { try { String url = urlRootPath + "dispose_device/task/get"; - ProtocolRespDTO rspInfo = restfulInterface.getDeviceTaskStatus(url, token, - new String[]{taskId}); + ProtocolRespDTO rspInfo = restfulInterface.getDeviceTaskStatus(url, token, + new String[]{taskId}); // 判断是否token过期 if (rspInfo != null && reLogin(rspInfo, rspInfo.getMsgContent().getItems().get(0).getStatus())) { @@ -489,7 +489,7 @@ public class PengXinAbilityImpl implements DisposeAbility { private void upgradeToken() { try { String url = urlRootPath + "dispose_device/auth/login"; - ProtocolRespDTO logInfo = restfulInterface.login(url, username, password); + ProtocolRespDTO logInfo = restfulInterface.login(url, username, password); if (logInfo != null && logInfo.getMsgContent().getStatus() == ErrorCode.ERR_OK.getCode()) { this.token = logInfo.getMsgContent().getToken(); diff --git a/src/main/java/com/dispose/ability/impl/UpfAbilityImpl.java b/src/main/java/com/dispose/ability/impl/UpfAbilityImpl.java index 7874d393..26a7ba71 100644 --- a/src/main/java/com/dispose/ability/impl/UpfAbilityImpl.java +++ b/src/main/java/com/dispose/ability/impl/UpfAbilityImpl.java @@ -1,5 +1,10 @@ package com.dispose.ability.impl; +import com.cmhi.dispose.common.CmhiDisposeStartTaskItem; +import com.cmhi.dispose.common.CmhiDisposeStartTaskRsp; +import com.cmhi.dispose.common.CmhiDisposeStopTaskRsp; +import com.cmhi.dispose.common.CmhiDisposeTaskStatusRsp; +import com.cmhi.dispose.protocol.CmhiDisposeInterface; import com.dispose.common.DisposeCapacityType; import com.dispose.common.DisposeObjectType; import com.dispose.common.ErrorCode; @@ -8,11 +13,6 @@ import com.dispose.pojo.dto.protocol.base.ProtocolRespDTO; import com.dispose.pojo.entity.ServiceInfo; import com.dispose.pojo.po.MulReturnType; import com.dispose.pojo.vo.DeviceFirewareInfo; -import com.pengxin.dispose.common.PengXinStartTaskItem; -import com.pengxin.dispose.common.PengXinStartTaskRsp; -import com.pengxin.dispose.common.PengXinStopTaskRsp; -import com.pengxin.dispose.common.PengXinTaskStatusRsp; -import com.pengxin.dispose.protocol.PengXinInterface; import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; @@ -32,7 +32,7 @@ public class UpfAbilityImpl extends PengXinAbilityImpl { /** * The Restful interface. */ - private final PengXinInterface restfulInterface = new PengXinInterface(); + private final CmhiDisposeInterface restfulInterface = new CmhiDisposeInterface(); /** * The upf dispose type. */ @@ -125,7 +125,7 @@ public class UpfAbilityImpl extends PengXinAbilityImpl { @Nullable NetflowDirection nfDirection, @Nullable Integer attackType, @Nullable Long duration) { - List reqItems = new ArrayList<>(); + List reqItems = new ArrayList<>(); String url = urlRootPath + "dispose_device/task/start"; //1.调用upf设备登录接口,生成token值;2.upf不提供登录接口,随机生成token值,保证有token值 if (token == null || token.length() == 0) { @@ -142,7 +142,7 @@ public class UpfAbilityImpl extends PengXinAbilityImpl { // 适配处置时间参数, -1为不限制处置时间 duration = -1L; - reqItems.add(PengXinStartTaskItem.builder() + reqItems.add(CmhiDisposeStartTaskItem.builder() .type(getUpfTaskType(capType)) .disposeObject(disposeObject) .objectType(getUpfObjectType(objectType)) @@ -150,7 +150,7 @@ public class UpfAbilityImpl extends PengXinAbilityImpl { .taskReqId(String.valueOf(taskReqId++)) .build()); - ProtocolRespDTO rspInfo = restfulInterface.startDisposeTask(url, token, reqItems); + ProtocolRespDTO rspInfo = restfulInterface.startDisposeTask(url, token, reqItems); // upf设备不判断header认证消息中的token值 if (rspInfo == null || rspInfo.getCode() != ErrorCode.ERR_OK.getHttpCode()) { @@ -209,8 +209,8 @@ public class UpfAbilityImpl extends PengXinAbilityImpl { return new MulReturnType<>(ErrorCode.ERR_PARAMS, null); } - ProtocolRespDTO rspInfo = restfulInterface.stopDisposeTask(url, token, - new String[]{taskId}); + ProtocolRespDTO rspInfo = restfulInterface.stopDisposeTask(url, token, + new String[]{taskId}); if (rspInfo == null || rspInfo.getCode() != ErrorCode.ERR_OK.getHttpCode()) { log.error("----Error UPF stop task{} server return error", taskId); @@ -315,8 +315,8 @@ public class UpfAbilityImpl extends PengXinAbilityImpl { try { String url = urlRootPath + "dispose_device/task/get"; - ProtocolRespDTO rspInfo = restfulInterface.getDeviceTaskStatus(url, token, - new String[]{taskId}); + ProtocolRespDTO rspInfo = restfulInterface.getDeviceTaskStatus(url, token, + new String[]{taskId}); if (rspInfo != null && rspInfo.getCode() == ErrorCode.ERR_OK.getHttpCode()) { int errCode = rspInfo.getMsgContent().getItems().get(0).getStatus(); diff --git a/src/main/java/com/dispose/common/DisposeDeviceType.java b/src/main/java/com/dispose/common/DisposeDeviceType.java index e5dc8bf3..684503b3 100644 --- a/src/main/java/com/dispose/common/DisposeDeviceType.java +++ b/src/main/java/com/dispose/common/DisposeDeviceType.java @@ -17,7 +17,7 @@ public enum DisposeDeviceType implements BaseEnum { /** * The Pengxin platform. */ - PENGXIN_PLATFORM(2, "鹏信处置设备"), + CMHI_PLATFORM(2, "集团一键处置设备"), /** * The Huawei platform. */ diff --git a/src/main/java/com/dispose/service/impl/DeviceTaskManagerServiceImpl.java b/src/main/java/com/dispose/service/impl/DeviceTaskManagerServiceImpl.java index ccc3e741..e24824ae 100644 --- a/src/main/java/com/dispose/service/impl/DeviceTaskManagerServiceImpl.java +++ b/src/main/java/com/dispose/service/impl/DeviceTaskManagerServiceImpl.java @@ -1,5 +1,6 @@ package com.dispose.service.impl; +import com.cmhi.dispose.common.CmhiDisposeTaskStatus; import com.dispose.common.DisposeConfigValue; import com.dispose.common.DisposeDeviceType; import com.dispose.common.DisposeObjectType; @@ -18,7 +19,6 @@ import com.dispose.pojo.po.AbilityInfo; import com.dispose.pojo.po.MulReturnType; import com.dispose.service.DeviceTaskManagerService; import com.dispose.service.DisposeAbilityRouterService; -import com.pengxin.dispose.common.PengXinTaskStatus; import lombok.extern.slf4j.Slf4j; import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Scheduled; @@ -416,7 +416,7 @@ public class DeviceTaskManagerServiceImpl implements DeviceTaskManagerService { //任务出错,设备任务状态为启动处置任务失败 deviceTaskManager.changeDisposeDeviceTaskInfoDevStatus(deviceTask.getId(), - (long) PengXinTaskStatus.TASK_STARTED_FAILED.getValue()); + (long) CmhiDisposeTaskStatus.TASK_STARTED_FAILED.getValue()); // 记录任务出错重试次数 deviceTaskManager.setTaskErrRetryTimes(deviceTask.getId(), 0); @@ -583,8 +583,8 @@ public class DeviceTaskManagerServiceImpl implements DeviceTaskManagerService { virtualDeviceTaskRun(ai, v, task); break; - case PENGXIN_PLATFORM: - restfulDeviceTaskRun(ai, v, task, DisposeDeviceType.PENGXIN_PLATFORM); + case CMHI_PLATFORM: + restfulDeviceTaskRun(ai, v, task, DisposeDeviceType.CMHI_PLATFORM); break; case HUAWEI_PLATFORM: @@ -668,8 +668,8 @@ public class DeviceTaskManagerServiceImpl implements DeviceTaskManagerService { virtualDeviceTaskStop(ai, v, task); break; - case PENGXIN_PLATFORM: - restfulDeviceTaskStop(ai, v, task, DisposeDeviceType.PENGXIN_PLATFORM); + case CMHI_PLATFORM: + restfulDeviceTaskStop(ai, v, task, DisposeDeviceType.CMHI_PLATFORM); break; case HUAWEI_PLATFORM: diff --git a/src/main/java/com/dispose/service/impl/DisposeAbilityRouterServiceImpl.java b/src/main/java/com/dispose/service/impl/DisposeAbilityRouterServiceImpl.java index 61065718..865d517e 100644 --- a/src/main/java/com/dispose/service/impl/DisposeAbilityRouterServiceImpl.java +++ b/src/main/java/com/dispose/service/impl/DisposeAbilityRouterServiceImpl.java @@ -166,7 +166,7 @@ public class DisposeAbilityRouterServiceImpl implements DisposeAbilityRouterServ case HAOHAN_PLATFORM: db = new HaoHanAbilityImpl(); break; - case PENGXIN_PLATFORM: + case CMHI_PLATFORM: db = new PengXinAbilityImpl(); break; case HUAWEI_PLATFORM: