提交 f9a9584c 编写于 作者: M mchung

6984036: servicetag vendor rebranding issues

Summary: Update product_vendor field to use java.vendor system property
Reviewed-by: ohair
上级 917567c8
......@@ -43,7 +43,8 @@ public class Installer {
"servicetag.dir.path";
private static String SVCTAG_ENABLE_REGISTRATION =
"servicetag.registration.enabled";
private final static String SUN_VENDOR = "Sun Microsystems";
private final static String ORACLE = "Oracle";
private final static String SUN = "Sun Microsystems";
private final static String REGISTRATION_XML = "registration.xml";
private final static String SERVICE_TAG_FILE = "servicetag";
private final static String REGISTRATION_HTML_NAME = "register";
......@@ -84,9 +85,10 @@ public class Installer {
// Implementation of ServiceTag.getJavaServiceTag(String) method
static ServiceTag getJavaServiceTag(String source) throws IOException {
if (!System.getProperty("java.vendor").startsWith(SUN_VENDOR)) {
String vendor = System.getProperty("java.vendor", "");
if (!vendor.startsWith(SUN) && !vendor.startsWith(ORACLE)) {
// Products bundling this implementation may run on
// Mac OS which is not a Sun JDK
// Mac OS which is not a Sun/Oracle JDK
return null;
}
boolean cleanup = false;
......@@ -365,7 +367,7 @@ public class Installer {
props.getProperty("servicetag.parent.name"),
props.getProperty("servicetag.parent.urn"),
getProductDefinedId(),
SUN_VENDOR,
System.getProperty("java.vendor"),
System.getProperty("os.arch"),
getZoneName(),
svcTagSource);
......
......@@ -80,12 +80,12 @@ import static com.sun.servicetag.RegistrationDocument.*;
* <tr>
* <td><tt>systemManufacturer</tt></td>
* <td>System manufacturer</td>
* <td> e.g. Sun Microsystems</td>
* <td> e.g. Oracle Corporation</td>
* </tr>
* <tr>
* <td><tt>cpuManufacturer</tt></td>
* <td>CPU manufacturer</td>
* <td> e.g. Sun Microsystems</td>
* <td> e.g. Oracle Corporation</td>
* </tr>
* <tr>
* <td><tt>serialNumber</tt></td>
......
......@@ -90,7 +90,7 @@ public class Registry {
stclient = getWindowsStClientFile();
} else {
if (isVerbose()) {
System.out.println("Running on non-Sun JDK");
System.out.println("Running on unsupported platform");
}
}
initialized = true;
......
......@@ -44,6 +44,7 @@ import java.io.*;
* Solaris implementation of the SystemEnvironment class.
*/
class SolarisSystemEnvironment extends SystemEnvironment {
private static final String ORACLE = "Oracle Corporation";
SolarisSystemEnvironment() {
setHostId(getCommandOutput("/usr/bin/hostid"));
setSystemModel(getCommandOutput("/usr/bin/uname", "-i"));
......@@ -59,7 +60,7 @@ class SolarisSystemEnvironment extends SystemEnvironment {
private String getSolarisCpuManufacturer() {
// not fully accurate, this could be another manufacturer (fujitsu for example)
if ("sparc".equalsIgnoreCase(System.getProperty("os.arch"))) {
return "Sun Microsystems, Inc";
return ORACLE;
}
// if we're here, then we'll try smbios (type 4)
......@@ -73,7 +74,7 @@ class SolarisSystemEnvironment extends SystemEnvironment {
private String getSolarisSystemManufacturer() {
// not fully accurate, this could be another manufacturer (fujitsu for example)
if ("sparc".equalsIgnoreCase(System.getProperty("os.arch"))) {
return "Sun Microsystems, Inc";
return ORACLE;
}
// if we're here, then we'll try smbios (type 1)
......@@ -117,7 +118,7 @@ class SolarisSystemEnvironment extends SystemEnvironment {
// ID SIZE TYPE
// 1 150 SMB_TYPE_SYSTEM (system information)
//
// Manufacturer: Sun Microsystems
// Manufacturer: Oracle Corporation
// Product: Sun Fire X4600
// Version: To Be Filled By O.E.M.
// Serial Number: 00:14:4F:45:0C:2A
......
......@@ -124,8 +124,9 @@ public class JavaServiceTagTest {
throw new RuntimeException("Unexpected platform_arch: " +
st.getPlatformArch());
}
String vendor = System.getProperty("java.vendor");
if (!st.getProductVendor().
equals("Sun Microsystems")) {
equals(vendor)) {
throw new RuntimeException("Unexpected product_vendor: " +
st.getProductVendor());
}
......
......@@ -196,8 +196,10 @@ public class JavaServiceTagTest1 {
throw new RuntimeException("Unexpected platform_arch: " +
st.getPlatformArch());
}
String vendor = System.getProperty("java.vendor");
if (!st.getProductVendor().
equals("Sun Microsystems")) {
equals(vendor)) {
throw new RuntimeException("Unexpected product_vendor: " +
st.getProductVendor());
}
......
......@@ -162,6 +162,8 @@ public class Util {
for (ServiceTag st : svcTags) {
ServiceTag st1 = stMap.get(st.getInstanceURN());
if (!matches(st, st1)) {
System.err.println(st);
System.err.println(st1);
throw new RuntimeException("ServiceTag in the registry " +
"does not match the one in the map");
}
......
......@@ -4,6 +4,6 @@ osName=SunOS
osVersion=5.10
osArchitecture=sparc
systemModel=Sun-Fire-V440
systemManufacturer=Sun Microsystems
cpuManufacturer=Sun Microsystems
systemManufacturer=Oracle Corporation
cpuManufacturer=Oracle Corporation
serialNumber=BEL078932
......@@ -19,7 +19,7 @@
<product_parent_urn>urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3</product_parent_urn>
<product_parent>Java Platform Standard Edition 6 (Java SE 6)</product_parent>
<product_defined_inst_id>id=1.6.0-internal-b00 sparc,dir=/myjdk/solaris-sparc</product_defined_inst_id>
<product_vendor>Sun Microsystems</product_vendor>
<product_vendor>Oracle Corporation</product_vendor>
<platform_arch>sparc</platform_arch>
<timestamp>2007-11-12 06:15:11 GMT</timestamp>
<container>global</container>
......@@ -34,7 +34,7 @@
<product_parent_urn>urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3</product_parent_urn>
<product_parent>Java Platform Standard Edition 6 (Java SE 6)</product_parent>
<product_defined_inst_id>id=1.6.0_05-b01 sparc,dir=/myjdk/solaris-i586</product_defined_inst_id>
<product_vendor>Sun Microsystems</product_vendor>
<product_vendor>Oracle Corporation</product_vendor>
<platform_arch>i386</platform_arch>
<timestamp>2007-11-12 06:15:11 GMT</timestamp>
<container>global</container>
......
......@@ -20,7 +20,7 @@
<product_parent_urn>urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3</product_parent_urn>
<product_parent>Java Platform Standard Edition 6 (Java SE 6)</product_parent>
<product_defined_inst_id>id=1.6.0-internal-b00 sparc,dir=/myjdk/solaris-sparc</product_defined_inst_id>
<product_vendor>Sun Microsystems</product_vendor>
<product_vendor>Oracle Corporation</product_vendor>
<platform_arch>sparc</platform_arch>
<timestamp>2007-11-13 00:49:01 GMT</timestamp>
<container>global</container>
......
......@@ -7,8 +7,8 @@
<osVersion>5.10</osVersion>
<osArchitecture>sparc</osArchitecture>
<systemModel>Sun-Fire-V440</systemModel>
<systemManufacturer>Sun Microsystems</systemManufacturer>
<cpuManufacturer>Sun Microsystems</cpuManufacturer>
<systemManufacturer>Oracle Corporation</systemManufacturer>
<cpuManufacturer>Oracle Corporation</cpuManufacturer>
<serialNumber>BEL078932</serialNumber>
</environment>
<registry urn="urn:st:9543ffaa-a4f1-4f77-b2d1-f561922d4e4a" version="1.0">
......@@ -20,7 +20,7 @@
<product_parent_urn>urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3</product_parent_urn>
<product_parent>Java Platform Standard Edition 6 (Java SE 6)</product_parent>
<product_defined_inst_id>id=1.6.0-internal-b00 sparc,dir=/myjdk/solaris-sparc</product_defined_inst_id>
<product_vendor>Sun Microsystems</product_vendor>
<product_vendor>Oracle Corporation</product_vendor>
<platform_arch>sparc</platform_arch>
<timestamp>2007-11-13 00:49:01 GMT</timestamp>
<container>global</container>
......@@ -35,7 +35,7 @@
<product_parent_urn>urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3</product_parent_urn>
<product_parent>Java Platform Standard Edition 6 (Java SE 6)</product_parent>
<product_defined_inst_id>id=1.6.0_05-b01 i386,dir=/myjdk/solaris-i586</product_defined_inst_id>
<product_vendor>Sun Microsystems</product_vendor>
<product_vendor>Oracle Corporation</product_vendor>
<platform_arch>i386</platform_arch>
<timestamp>2007-11-13 00:49:01 GMT</timestamp>
<container>global</container>
......@@ -50,7 +50,7 @@
<product_parent_urn>urn:uuid:596ffcfa-63d5-11d7-9886-ac816a682f92</product_parent_urn>
<product_parent>Solaris Operating System</product_parent>
<product_defined_inst_id/>
<product_vendor>Sun Microsystems</product_vendor>
<product_vendor>Oracle Corporation</product_vendor>
<platform_arch>sparc</platform_arch>
<timestamp>2007-11-13 00:49:01 GMT</timestamp>
<container>global</container>
......
......@@ -5,7 +5,7 @@ product_urn=urn:uuid:92d1de8c-1e59-42c6-a280-1c379526bcbc
product_parent_urn=urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3
product_parent=Java Platform Standard Edition 6 (Java SE 6)
product_defined_inst_id=id=1.6.0-internal-b00 sparc,dir=/myjdk/solaris-sparc
product_vendor=Sun Microsystems
product_vendor=Oracle Corporation
platform_arch=sparc
timestamp=2007-11-12 05:19:40 GMT
container=global
......
......@@ -5,7 +5,7 @@ product_urn=urn:uuid:b58ef9a8-5ae8-11db-a023-080020a9ed93
product_parent_urn=urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3
product_parent=Java Platform Standard Edition 6 (Java SE 6)
product_defined_inst_id=id=1.6.0_05-b01 i386,dir=/myjdk/solaris-i586
product_vendor=Sun Microsystems
product_vendor=Oracle Corporation
platform_arch=i386
timestamp=2007-11-12 06:12:21 GMT
container=global
......
......@@ -5,7 +5,7 @@ product_urn=urn:uuid:5005588c-36f3-11d6-9cec-fc96f718e113
product_parent_urn=urn:uuid:596ffcfa-63d5-11d7-9886-ac816a682f92
product_parent=Solaris Operating System
product_defined_inst_id=
product_vendor=Sun Microsystems
product_vendor=Oracle Corporation
platform_arch=sparc
timestamp=2007-06-20 22:07:11 GMT
container=global
......
......@@ -5,7 +5,7 @@ product_urn=urn:uuid:92d1de8c-1e59-42c6-a280-1c379526bcbc
product_parent_urn=urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3
product_parent=Java Platform Standard Edition 6 (Java SE 6)
product_defined_inst_id=id=1.6.0_05-b01 amd64,dir=/myjdk/linux-amd64
product_vendor=Sun Microsystems
product_vendor=Oracle Corporation
platform_arch=x64
timestamp=2007-12-12 05:19:40 GMT
container=global
......
......@@ -5,7 +5,7 @@ product_urn=urn:uuid:92d1de8c-1e59-42c6-a280-1c379526bcbc
product_parent_urn=urn:uuid:fdc90b21-018d-4cab-b866-612c7c119ed3
product_parent=Java Platform Standard Edition 6 (Java SE 6)
product_defined_inst_id=id=1.6.0_06-b06 i386,dir=/w/mchung/bundles/jdk1.6.0_05/jre
product_vendor=Sun Microsystems
product_vendor=Oracle Corporation
platform_arch=x86
timestamp=2007-11-29 17:59:42 GMT
container=global
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册