-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send additional data to SCC (jsc#SUMA-406)
- Loading branch information
1 parent
dde0d80
commit ac66fa7
Showing
27 changed files
with
706 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
java/code/src/com/redhat/rhn/domain/server/SAPWorkload.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
/* | ||
* Copyright (c) 2025 SUSE LLC | ||
* | ||
* This software is licensed to you under the GNU General Public License, | ||
* version 2 (GPLv2). There is NO WARRANTY for this software, express or | ||
* implied, including the implied warranties of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 | ||
* along with this software; if not, see | ||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. | ||
* | ||
* Red Hat trademarks are not licensed under GPLv2. No permission is | ||
* granted to use or replicate Red Hat trademarks that are incorporated | ||
* in this software or its documentation. | ||
*/ | ||
package com.redhat.rhn.domain.server; | ||
|
||
import java.util.Objects; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.JoinColumn; | ||
import javax.persistence.ManyToOne; | ||
import javax.persistence.Table; | ||
|
||
@Entity | ||
@Table(name = "suseServerSAPWorkload") | ||
public class SAPWorkload { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Column(name = "system_id") | ||
private String systemIdSAP; | ||
|
||
@Column(name = "instance_type") | ||
private String instanceType; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "server_id") | ||
private Server server; | ||
|
||
/** | ||
* Constructs a SAPWorkload instance. | ||
*/ | ||
public SAPWorkload() { } | ||
|
||
/** | ||
* Constructs a SAPWorkload instance with the specified server, system ID, and instance type. | ||
* | ||
* @param serverIn the server | ||
* @param systemIdSAPIn the SAP system | ||
* @param instanceTypeIn the SAP type of instance | ||
*/ | ||
public SAPWorkload(Server serverIn, String systemIdSAPIn, String instanceTypeIn) { | ||
this.server = serverIn; | ||
this.systemIdSAP = systemIdSAPIn; | ||
this.instanceType = instanceTypeIn; | ||
} | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long idIn) { | ||
id = idIn; | ||
} | ||
|
||
public String getSystemIdSAP() { | ||
return systemIdSAP; | ||
} | ||
|
||
public void setSystemIdSAP(String systemIdSAPIn) { | ||
systemIdSAP = systemIdSAPIn; | ||
} | ||
|
||
public String getInstanceType() { | ||
return instanceType; | ||
} | ||
|
||
public void setInstanceType(String instanceTypeIn) { | ||
instanceType = instanceTypeIn; | ||
} | ||
|
||
public Server getServer() { | ||
return server; | ||
} | ||
|
||
public void setServer(Server serverIn) { | ||
server = serverIn; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object oIn) { | ||
if (this == oIn) { | ||
return true; | ||
} | ||
if (oIn == null || getClass() != oIn.getClass()) { | ||
return false; | ||
} | ||
SAPWorkload that = (SAPWorkload) oIn; | ||
return Objects.equals(systemIdSAP, that.systemIdSAP) && | ||
Objects.equals(instanceType, that.instanceType) && | ||
Objects.equals(server, that.server); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(systemIdSAP, instanceType, server); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright (c) 2025 SUSE LLC | ||
* | ||
* This software is licensed to you under the GNU General Public License, | ||
* version 2 (GPLv2). There is NO WARRANTY for this software, express or | ||
* implied, including the implied warranties of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 | ||
* along with this software; if not, see | ||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. | ||
* | ||
* Red Hat trademarks are not licensed under GPLv2. No permission is | ||
* granted to use or replicate Red Hat trademarks that are incorporated | ||
* in this software or its documentation. | ||
*/ | ||
package com.suse.scc.model; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
import java.util.List; | ||
|
||
public class SAPJson { | ||
|
||
@SerializedName("system_id") | ||
private String systemId; | ||
|
||
@SerializedName("instance_types") | ||
private List<String> instanceTypes; | ||
|
||
/** | ||
* Constructor | ||
* @param systemIdIn - the SAP system id | ||
* @param instanceTypesIn - the array of SAP instance types | ||
*/ | ||
public SAPJson(String systemIdIn, List<String> instanceTypesIn) { | ||
systemId = systemIdIn; | ||
instanceTypes = instanceTypesIn; | ||
} | ||
|
||
public String getSystemId() { | ||
return systemId; | ||
} | ||
|
||
public List<String> getInstanceTypes() { | ||
return instanceTypes; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.