From eb4642e433e20691c41fd9b83a934332283acf33 Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Thu, 05 Jan 2012 17:40:21 +0000
Subject: [PATCH] Fix issue OPENDJ-396: Remove support for ServiceTags
---
/dev/null | 36 ------------------
opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java | 21 ----------
opendj-sdk/opends/build.xml | 10 ----
opendj-sdk/opends/src/messages/src/org/opends/messages/Category.java | 5 +-
4 files changed, 5 insertions(+), 67 deletions(-)
diff --git a/opendj-sdk/opends/build.xml b/opendj-sdk/opends/build.xml
index d14397d..8f5eea2 100644
--- a/opendj-sdk/opends/build.xml
+++ b/opendj-sdk/opends/build.xml
@@ -23,7 +23,7 @@
!
!
! Copyright 2006-2010 Sun Microsystems, Inc.
- ! Portions Copyright 2011 ForgeRock AS
+ ! Portions Copyright 2011-2012 ForgeRock AS
! -->
<project name="Directory Server" basedir="." default="package">
@@ -288,9 +288,6 @@
<genmsg sourceProps="${msg.prop.dir}/runtime_information.properties"
destJava="${msg.javagen.dir}/org/opends/messages/RuntimeMessages.java">
</genmsg>
- <genmsg sourceProps="${msg.prop.dir}/servicetag.properties"
- destJava="${msg.javagen.dir}/org/opends/messages/ServiceTagMessages.java">
- </genmsg>
</target>
@@ -925,7 +922,6 @@
<mkdir dir="${pdir}/config/messages" />
<mkdir dir="${pdir}/config/MakeLDIF" />
<mkdir dir="${pdir}/config/snmp/security" />
- <mkdir dir="${pdir}/config/servicetag" />
<mkdir dir="${pdir}/db" />
<mkdir dir="${pdir}/import-tmp" />
<mkdir dir="${pdir}/changelogDb" />
@@ -1065,10 +1061,6 @@
<fileset dir="${resource.dir}/schema" />
</copy>
- <copy todir="${pdir}/config/servicetag">
- <fileset dir="${resource.dir}/servicetag" />
- </copy>
-
<copy todir="${pdir}/config/messages">
<fileset dir="${resource.dir}/messages" />
</copy>
diff --git a/opendj-sdk/opends/resource/servicetag/opends.uuids.properties b/opendj-sdk/opends/resource/servicetag/opends.uuids.properties
deleted file mode 100644
index 5c88497..0000000
--- a/opendj-sdk/opends/resource/servicetag/opends.uuids.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-org.opends.server.servicetag.productname=OpenDJ 2.5
-org.opends.server.servicetag.version=2.5
-org.opends.server.servicetag.uuid=urn:uuid:00450d2d-26b0-3d92-b9e8-f616539697fa
-org.opends.server.servicetag.parent=Unknown
-org.opends.server.servicetag.parenturn=Unknown
-org.opends.server.servicetag.vendor=Opendj.org
\ No newline at end of file
diff --git a/opendj-sdk/opends/src/messages/messages/servicetag.properties b/opendj-sdk/opends/src/messages/messages/servicetag.properties
deleted file mode 100644
index 8a3838a..0000000
--- a/opendj-sdk/opends/src/messages/messages/servicetag.properties
+++ /dev/null
@@ -1,64 +0,0 @@
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE
-# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
-# add the following below this CDDL HEADER, with the fields enclosed
-# by brackets "[]" replaced with your own identifying information:
-# Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-# Copyright 2008 Sun Microsystems, Inc.
-
-
-
-#
-# Global directives
-#
-global.category=SERVICETAG
-
-#
-# Format string definitions
-#
-# Keys must be formatted as follows:
-#
-# [SEVERITY]_[DESCRIPTION]_[ORDINAL]
-#
-# where:
-#
-# SEVERITY is one of:
-# [INFO, MILD_WARN, SEVERE_WARN, MILD_ERR, SEVERE_ERR, FATAL_ERR, DEBUG, NOTICE]
-#
-# DESCRIPTION is an upper case string providing a hint as to the context of
-# the message in upper case with the underscore ('_') character serving as
-# word separator
-#
-# ORDINAL is an integer unique among other ordinals in this file
-#
-SEVERE_WARN_SERVICETAG_ALREADY_EXIST_1=ServiceTag already exists
-SEVERE_WARN_SERVICETAG_DOESNOT_EXIST_2=ServiceTag does not exist
-SEVERE_WARN_REGISTRY_NOT_SUPPORTED_3=Common Registration is not supported
-SEVERE_WARN_PARAMETER_CANNOT_BE_NULL_4=Parameter %s cannot be null or empty
-SEVERE_WARN_SERVICETAG_CANNOT_BE_REGISTERED_5=ServiceTag cannot be registered \
-for product name %s, product urn %s, installed location %s
-SEVERE_WARN_SERVICETAG_CANNOT_BE_REMOVED_6=ServiceTag cannot be removed
-SEVERE_WARN_NO_SERVICETAG_TO_REMOVE_7=No ServiceTag to remove
-SEVERE_WARN_NO_SERVICETAG_TO_REGISTER_8=No ServiceTag to register
-SEVERE_WARN_BAD_PROPERTIES_9=Properties parameter does not contain %s
-SEVERE_WARN_SERVICETAG_REGISTRATION_10=ServiceTag cannot be registered : %s
-
-
-
-
diff --git a/opendj-sdk/opends/src/messages/messages/servicetag_de.properties b/opendj-sdk/opends/src/messages/messages/servicetag_de.properties
deleted file mode 100644
index add6380..0000000
--- a/opendj-sdk/opends/src/messages/messages/servicetag_de.properties
+++ /dev/null
@@ -1,63 +0,0 @@
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE
-# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
-# add the following below this CDDL HEADER, with the fields enclosed
-# by brackets "[]" replaced with your own identifying information:
-# Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-# Copyright 2008 Sun Microsystems, Inc.
-
-
-
-#
-# Global directives
-#
-global.category=SERVICETAG
-
-#
-# Format string definitions
-#
-# Keys must be formatted as follows:
-#
-# [SEVERITY]_[DESCRIPTION]_[ORDINAL]
-#
-# where:
-#
-# SEVERITY is one of:
-# [INFO, MILD_WARN, SEVERE_WARN, MILD_ERR, SEVERE_ERR, FATAL_ERR, DEBUG, NOTICE]
-#
-# DESCRIPTION is an upper case string providing a hint as to the context of
-# the message in upper case with the underscore ('_') character serving as
-# word separator
-#
-# ORDINAL is an integer unique among other ordinals in this file
-#
-SEVERE_WARN_SERVICETAG_ALREADY_EXIST_1=ServiceTag ist bereits vorhanden
-SEVERE_WARN_SERVICETAG_DOESNOT_EXIST_2=ServiceTag ist nicht vorhanden
-SEVERE_WARN_REGISTRY_NOT_SUPPORTED_3=Allgemeine Registrierung wird nicht unterst\u00fctzt
-SEVERE_WARN_PARAMETER_CANNOT_BE_NULL_4=Parameter %s darf nicht Null oder leer sein
-SEVERE_WARN_SERVICETAG_CANNOT_BE_REGISTERED_5=ServiceTag kann nicht f\u00fcr Produktname %s, Produkt-URN %s, Installationsort %s registriert werden
-SEVERE_WARN_SERVICETAG_CANNOT_BE_REMOVED_6=ServiceTag kann nicht entfernt werden
-SEVERE_WARN_NO_SERVICETAG_TO_REMOVE_7=Kein ServiceTag zum Entfernen vorhanden
-SEVERE_WARN_NO_SERVICETAG_TO_REGISTER_8=Kein ServiceTag zum Registrieren vorhanden
-SEVERE_WARN_BAD_PROPERTIES_9=Eigenschaftsparameter enth\u00e4lt kein %s
-SEVERE_WARN_SERVICETAG_REGISTRATION_10=ServiceTag kann nicht registriert werden: %s
-
-
-
-
diff --git a/opendj-sdk/opends/src/messages/messages/servicetag_es.properties b/opendj-sdk/opends/src/messages/messages/servicetag_es.properties
deleted file mode 100644
index 7e96ad2..0000000
--- a/opendj-sdk/opends/src/messages/messages/servicetag_es.properties
+++ /dev/null
@@ -1,63 +0,0 @@
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE
-# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
-# add the following below this CDDL HEADER, with the fields enclosed
-# by brackets "[]" replaced with your own identifying information:
-# Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-# Copyright 2008 Sun Microsystems, Inc.
-
-
-
-#
-# Global directives
-#
-global.category=SERVICETAG
-
-#
-# Format string definitions
-#
-# Keys must be formatted as follows:
-#
-# [SEVERITY]_[DESCRIPTION]_[ORDINAL]
-#
-# where:
-#
-# SEVERITY is one of:
-# [INFO, MILD_WARN, SEVERE_WARN, MILD_ERR, SEVERE_ERR, FATAL_ERR, DEBUG, NOTICE]
-#
-# DESCRIPTION is an upper case string providing a hint as to the context of
-# the message in upper case with the underscore ('_') character serving as
-# word separator
-#
-# ORDINAL is an integer unique among other ordinals in this file
-#
-SEVERE_WARN_SERVICETAG_ALREADY_EXIST_1=ServiceTag ya existe
-SEVERE_WARN_SERVICETAG_DOESNOT_EXIST_2=ServiceTag no existe
-SEVERE_WARN_REGISTRY_NOT_SUPPORTED_3=El registro com\u00fan no est\u00e1 soportado
-SEVERE_WARN_PARAMETER_CANNOT_BE_NULL_4=El par\u00e1metro %s no pede ser nulo o vac\u00edo
-SEVERE_WARN_SERVICETAG_CANNOT_BE_REGISTERED_5=ServiceTag no puede ser registrado para el nombrte del producto %s, producto urna %s, ubicaci\u00f3n instalado %s
-SEVERE_WARN_SERVICETAG_CANNOT_BE_REMOVED_6=ServiceTag no puede ser eliminado
-SEVERE_WARN_NO_SERVICETAG_TO_REMOVE_7=Sin ServiceTag para eliminar
-SEVERE_WARN_NO_SERVICETAG_TO_REGISTER_8=Sin ServiceTag para registrar
-SEVERE_WARN_BAD_PROPERTIES_9=El par\u00e1metro de propiedades no contiene %s
-SEVERE_WARN_SERVICETAG_REGISTRATION_10=ServiceTag no puede ser registrado : %s
-
-
-
-
diff --git a/opendj-sdk/opends/src/messages/messages/servicetag_fr.properties b/opendj-sdk/opends/src/messages/messages/servicetag_fr.properties
deleted file mode 100644
index 101d7ca..0000000
--- a/opendj-sdk/opends/src/messages/messages/servicetag_fr.properties
+++ /dev/null
@@ -1,63 +0,0 @@
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE
-# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
-# add the following below this CDDL HEADER, with the fields enclosed
-# by brackets "[]" replaced with your own identifying information:
-# Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-# Copyright 2008 Sun Microsystems, Inc.
-
-
-
-#
-# Global directives
-#
-global.category=SERVICETAG
-
-#
-# Format string definitions
-#
-# Keys must be formatted as follows:
-#
-# [SEVERITY]_[DESCRIPTION]_[ORDINAL]
-#
-# where:
-#
-# SEVERITY is one of:
-# [INFO, MILD_WARN, SEVERE_WARN, MILD_ERR, SEVERE_ERR, FATAL_ERR, DEBUG, NOTICE]
-#
-# DESCRIPTION is an upper case string providing a hint as to the context of
-# the message in upper case with the underscore ('_') character serving as
-# word separator
-#
-# ORDINAL is an integer unique among other ordinals in this file
-#
-SEVERE_WARN_SERVICETAG_ALREADY_EXIST_1=Le ServiceTag existe d\u00e9j\u00e0
-SEVERE_WARN_SERVICETAG_DOESNOT_EXIST_2=Le ServiceTag n'existe pas
-SEVERE_WARN_REGISTRY_NOT_SUPPORTED_3=Enregistrement commun non pris en charge
-SEVERE_WARN_PARAMETER_CANNOT_BE_NULL_4=Le param\u00e8tre %s ne peut pas \u00eatre null ni vide
-SEVERE_WARN_SERVICETAG_CANNOT_BE_REGISTERED_5=Impossible d'enregistrer le ServiceTag pour le nom de produit %s, URN de produit %s, emplacement d'installation %s
-SEVERE_WARN_SERVICETAG_CANNOT_BE_REMOVED_6=Impossible de supprimer le ServiceTag
-SEVERE_WARN_NO_SERVICETAG_TO_REMOVE_7=Aucun ServiceTag \u00e0 supprimer
-SEVERE_WARN_NO_SERVICETAG_TO_REGISTER_8=Aucun ServiceTag \u00e0 enregistrer
-SEVERE_WARN_BAD_PROPERTIES_9=Le param\u00e8tre de propri\u00e9t\u00e9s ne contient pas %s
-SEVERE_WARN_SERVICETAG_REGISTRATION_10=Impossible d'enregistrer le ServiceTag\u00a0: %s
-
-
-
-
diff --git a/opendj-sdk/opends/src/messages/messages/servicetag_ja.properties b/opendj-sdk/opends/src/messages/messages/servicetag_ja.properties
deleted file mode 100644
index 653e198..0000000
--- a/opendj-sdk/opends/src/messages/messages/servicetag_ja.properties
+++ /dev/null
@@ -1,63 +0,0 @@
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE
-# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
-# add the following below this CDDL HEADER, with the fields enclosed
-# by brackets "[]" replaced with your own identifying information:
-# Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-# Copyright 2008 Sun Microsystems, Inc.
-
-
-
-#
-# Global directives
-#
-global.category=SERVICETAG
-
-#
-# Format string definitions
-#
-# Keys must be formatted as follows:
-#
-# [SEVERITY]_[DESCRIPTION]_[ORDINAL]
-#
-# where:
-#
-# SEVERITY is one of:
-# [INFO, MILD_WARN, SEVERE_WARN, MILD_ERR, SEVERE_ERR, FATAL_ERR, DEBUG, NOTICE]
-#
-# DESCRIPTION is an upper case string providing a hint as to the context of
-# the message in upper case with the underscore ('_') character serving as
-# word separator
-#
-# ORDINAL is an integer unique among other ordinals in this file
-#
-SEVERE_WARN_SERVICETAG_ALREADY_EXIST_1=ServiceTag \u306f\u3059\u3067\u306b\u5b58\u5728\u3057\u307e\u3059
-SEVERE_WARN_SERVICETAG_DOESNOT_EXIST_2=ServiceTag \u306f\u5b58\u5728\u3057\u307e\u305b\u3093
-SEVERE_WARN_REGISTRY_NOT_SUPPORTED_3=\u5171\u901a\u767b\u9332\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093
-SEVERE_WARN_PARAMETER_CANNOT_BE_NULL_4=\u30d1\u30e9\u30e1\u30fc\u30bf %s \u306f NULL \u307e\u305f\u306f\u7a7a\u306b\u3067\u304d\u307e\u305b\u3093
-SEVERE_WARN_SERVICETAG_CANNOT_BE_REGISTERED_5=ServiceTag \u306e\u88fd\u54c1\u540d %s\u3001\u88fd\u54c1 URN %s\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5834\u6240 %s \u3092\u767b\u9332\u3067\u304d\u307e\u305b\u3093
-SEVERE_WARN_SERVICETAG_CANNOT_BE_REMOVED_6=ServiceTag \u3092\u524a\u9664\u3067\u304d\u307e\u305b\u3093
-SEVERE_WARN_NO_SERVICETAG_TO_REMOVE_7=\u524a\u9664\u3059\u308b ServiceTag \u304c\u3042\u308a\u307e\u305b\u3093
-SEVERE_WARN_NO_SERVICETAG_TO_REGISTER_8=\u767b\u9332\u3059\u308b ServiceTag \u304c\u3042\u308a\u307e\u305b\u3093
-SEVERE_WARN_BAD_PROPERTIES_9=\u30d7\u30ed\u30d1\u30c6\u30a3\u30fc\u30d1\u30e9\u30e1\u30fc\u30bf\u306b %s \u304c\u542b\u307e\u308c\u3066\u3044\u307e\u305b\u3093
-SEVERE_WARN_SERVICETAG_REGISTRATION_10=ServiceTag \u3092\u767b\u9332\u3067\u304d\u307e\u305b\u3093: %s
-
-
-
-
diff --git a/opendj-sdk/opends/src/messages/messages/servicetag_ko.properties b/opendj-sdk/opends/src/messages/messages/servicetag_ko.properties
deleted file mode 100644
index aac4b9b..0000000
--- a/opendj-sdk/opends/src/messages/messages/servicetag_ko.properties
+++ /dev/null
@@ -1,63 +0,0 @@
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE
-# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
-# add the following below this CDDL HEADER, with the fields enclosed
-# by brackets "[]" replaced with your own identifying information:
-# Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-# Copyright 2008 Sun Microsystems, Inc.
-
-
-
-#
-# Global directives
-#
-global.category=SERVICETAG
-
-#
-# Format string definitions
-#
-# Keys must be formatted as follows:
-#
-# [SEVERITY]_[DESCRIPTION]_[ORDINAL]
-#
-# where:
-#
-# SEVERITY is one of:
-# [INFO, MILD_WARN, SEVERE_WARN, MILD_ERR, SEVERE_ERR, FATAL_ERR, DEBUG, NOTICE]
-#
-# DESCRIPTION is an upper case string providing a hint as to the context of
-# the message in upper case with the underscore ('_') character serving as
-# word separator
-#
-# ORDINAL is an integer unique among other ordinals in this file
-#
-SEVERE_WARN_SERVICETAG_ALREADY_EXIST_1=ServiceTag already exists
-SEVERE_WARN_SERVICETAG_DOESNOT_EXIST_2=ServiceTag does not exist
-SEVERE_WARN_REGISTRY_NOT_SUPPORTED_3=Common Registration is not supported
-SEVERE_WARN_PARAMETER_CANNOT_BE_NULL_4=Parameter %s cannot be null or empty
-SEVERE_WARN_SERVICETAG_CANNOT_BE_REGISTERED_5=ServiceTag cannot be registered for product name %s, product urn %s, installed location %s
-SEVERE_WARN_SERVICETAG_CANNOT_BE_REMOVED_6=ServiceTag cannot be removed
-SEVERE_WARN_NO_SERVICETAG_TO_REMOVE_7=No ServiceTag to remove
-SEVERE_WARN_NO_SERVICETAG_TO_REGISTER_8=No ServiceTag to register
-SEVERE_WARN_BAD_PROPERTIES_9=Properties parameter does not contain %s
-SEVERE_WARN_SERVICETAG_REGISTRATION_10=ServiceTag cannot be registered : %s
-
-
-
-
diff --git a/opendj-sdk/opends/src/messages/messages/servicetag_zh_CN.properties b/opendj-sdk/opends/src/messages/messages/servicetag_zh_CN.properties
deleted file mode 100644
index 78e1343..0000000
--- a/opendj-sdk/opends/src/messages/messages/servicetag_zh_CN.properties
+++ /dev/null
@@ -1,63 +0,0 @@
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE
-# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
-# add the following below this CDDL HEADER, with the fields enclosed
-# by brackets "[]" replaced with your own identifying information:
-# Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-# Copyright 2008 Sun Microsystems, Inc.
-
-
-
-#
-# Global directives
-#
-global.category=SERVICETAG
-
-#
-# Format string definitions
-#
-# Keys must be formatted as follows:
-#
-# [SEVERITY]_[DESCRIPTION]_[ORDINAL]
-#
-# where:
-#
-# SEVERITY is one of:
-# [INFO, MILD_WARN, SEVERE_WARN, MILD_ERR, SEVERE_ERR, FATAL_ERR, DEBUG, NOTICE]
-#
-# DESCRIPTION is an upper case string providing a hint as to the context of
-# the message in upper case with the underscore ('_') character serving as
-# word separator
-#
-# ORDINAL is an integer unique among other ordinals in this file
-#
-SEVERE_WARN_SERVICETAG_ALREADY_EXIST_1=ServiceTag \u5df2\u5b58\u5728
-SEVERE_WARN_SERVICETAG_DOESNOT_EXIST_2=ServiceTag \u4e0d\u5b58\u5728
-SEVERE_WARN_REGISTRY_NOT_SUPPORTED_3=\u4e0d\u652f\u6301\u901a\u7528\u6ce8\u518c
-SEVERE_WARN_PARAMETER_CANNOT_BE_NULL_4=\u53c2\u6570 %s \u4e0d\u80fd\u4e3a null \u6216\u4e3a\u7a7a
-SEVERE_WARN_SERVICETAG_CANNOT_BE_REGISTERED_5=\u4ea7\u54c1\u540d\u79f0 %s\uff0c\u4ea7\u54c1 URN %s\uff0c\u5b89\u88c5\u4f4d\u7f6e %s \u65e0\u6cd5\u6ce8\u518c ServiceTag
-SEVERE_WARN_SERVICETAG_CANNOT_BE_REMOVED_6=\u65e0\u6cd5\u5220\u9664 ServiceTag
-SEVERE_WARN_NO_SERVICETAG_TO_REMOVE_7=\u6ca1\u6709\u8981\u5220\u9664\u7684 ServiceTag
-SEVERE_WARN_NO_SERVICETAG_TO_REGISTER_8=\u6ca1\u6709\u8981\u6ce8\u518c\u7684 ServiceTag
-SEVERE_WARN_BAD_PROPERTIES_9=\u5c5e\u6027\u53c2\u6570\u4e0d\u5305\u542b %s
-SEVERE_WARN_SERVICETAG_REGISTRATION_10=\u65e0\u6cd5\u6ce8\u518c ServiceTag: %s
-
-
-
-
diff --git a/opendj-sdk/opends/src/messages/messages/servicetag_zh_TW.properties b/opendj-sdk/opends/src/messages/messages/servicetag_zh_TW.properties
deleted file mode 100644
index aac4b9b..0000000
--- a/opendj-sdk/opends/src/messages/messages/servicetag_zh_TW.properties
+++ /dev/null
@@ -1,63 +0,0 @@
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE
-# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at
-# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
-# add the following below this CDDL HEADER, with the fields enclosed
-# by brackets "[]" replaced with your own identifying information:
-# Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-# Copyright 2008 Sun Microsystems, Inc.
-
-
-
-#
-# Global directives
-#
-global.category=SERVICETAG
-
-#
-# Format string definitions
-#
-# Keys must be formatted as follows:
-#
-# [SEVERITY]_[DESCRIPTION]_[ORDINAL]
-#
-# where:
-#
-# SEVERITY is one of:
-# [INFO, MILD_WARN, SEVERE_WARN, MILD_ERR, SEVERE_ERR, FATAL_ERR, DEBUG, NOTICE]
-#
-# DESCRIPTION is an upper case string providing a hint as to the context of
-# the message in upper case with the underscore ('_') character serving as
-# word separator
-#
-# ORDINAL is an integer unique among other ordinals in this file
-#
-SEVERE_WARN_SERVICETAG_ALREADY_EXIST_1=ServiceTag already exists
-SEVERE_WARN_SERVICETAG_DOESNOT_EXIST_2=ServiceTag does not exist
-SEVERE_WARN_REGISTRY_NOT_SUPPORTED_3=Common Registration is not supported
-SEVERE_WARN_PARAMETER_CANNOT_BE_NULL_4=Parameter %s cannot be null or empty
-SEVERE_WARN_SERVICETAG_CANNOT_BE_REGISTERED_5=ServiceTag cannot be registered for product name %s, product urn %s, installed location %s
-SEVERE_WARN_SERVICETAG_CANNOT_BE_REMOVED_6=ServiceTag cannot be removed
-SEVERE_WARN_NO_SERVICETAG_TO_REMOVE_7=No ServiceTag to remove
-SEVERE_WARN_NO_SERVICETAG_TO_REGISTER_8=No ServiceTag to register
-SEVERE_WARN_BAD_PROPERTIES_9=Properties parameter does not contain %s
-SEVERE_WARN_SERVICETAG_REGISTRATION_10=ServiceTag cannot be registered : %s
-
-
-
-
diff --git a/opendj-sdk/opends/src/messages/src/org/opends/messages/Category.java b/opendj-sdk/opends/src/messages/src/org/opends/messages/Category.java
index 5d2cbda..3a0cd5b 100644
--- a/opendj-sdk/opends/src/messages/src/org/opends/messages/Category.java
+++ b/opendj-sdk/opends/src/messages/src/org/opends/messages/Category.java
@@ -23,7 +23,7 @@
*
*
* Copyright 2007-2009 Sun Microsystems, Inc.
- * Portions copyright 2011 ForgeRock AS.
+ * Portions copyright 2011-2012 ForgeRock AS.
*/
package org.opends.messages;
@@ -159,8 +159,9 @@
/**
* The category used for messages associated with the Servicetag registration.
+ * No longer used.
+ * SERVICETAG(0x01400000),
*/
- SERVICETAG(0x01400000),
/**
* The category that will be used for messages associated with
diff --git a/opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java b/opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java
index c881545..fb15896 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java
@@ -87,7 +87,6 @@
import org.opends.server.protocols.internal.InternalClientConnection;
import org.opends.server.protocols.internal.InternalConnectionHandler;
import org.opends.server.schema.*;
-import org.opends.server.servicetag.ServiceTagRegistration;
import org.opends.server.tools.ConfigureWindowsService;
import org.opends.server.types.*;
import org.opends.server.util.*;
@@ -102,7 +101,7 @@
* and shutdown processes and coordinates activities between all other
* components.
*/
-public class DirectoryServer
+public final class DirectoryServer
implements AlertGenerator
{
/**
@@ -638,11 +637,6 @@
// mode is 'manual'.
private WorkflowElementConfigManager workflowElementConfigManager;
- // The ServiceTag Registration service for the Directory Server.
- // The Registration is used to create and register a ServiceTag
- // if it does not exist in the common servicetag registry.
- private ServiceTagRegistration serviceTagRegistry;
-
/**
* The default timeout used to start the server in detach mode.
*/
@@ -9523,19 +9517,6 @@
System.exit(1);
}
- try {
- theDirectoryServer.serviceTagRegistry =
- ServiceTagRegistration.getRegistrationService();
- theDirectoryServer.serviceTagRegistry.registerServiceTags("Server");
- }
- catch(Exception ex) {
- // ServiceTags Registration errors do not prevent the server to
- // start. WARNING logged in debug mode
- if (debugEnabled()) {
- TRACER.debugCaught(DebugLogLevel.WARNING, ex);
- }
- }
-
try
{
theDirectoryServer.startServer();
diff --git a/opendj-sdk/opends/src/server/org/opends/server/servicetag/Registry.java b/opendj-sdk/opends/src/server/org/opends/server/servicetag/Registry.java
deleted file mode 100644
index 98aec6e..0000000
--- a/opendj-sdk/opends/src/server/org/opends/server/servicetag/Registry.java
+++ /dev/null
@@ -1,431 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2008-2009 Sun Microsystems, Inc.
- */
-package org.opends.server.servicetag;
-
-import java.io.*;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-
-import org.opends.server.loggers.debug.DebugTracer;
-import org.opends.server.types.DebugLogLevel;
-import static org.opends.server.servicetag.Util.*;
-import static org.opends.server.servicetag.ServiceTagDefinition.*;
-import static org.opends.server.loggers.debug.DebugLogger.*;
-
-/**
- * Allows to create / register/ remove / find ServiceTags calling the
- * appropriated CLI stclient if available on the system.
- */
-public class Registry {
-
- // The tracer object for the debug logger.
- private static final DebugTracer TRACER = getTracer();
- // ServiceTag services are not relocatable
- private static final String STCLIENT_SOLARIS
- = "/usr/bin/stclient";
- private static final String STCLIENT_LINUX
- = "/opt/sun/servicetag/bin/stclient";
- private static final int ST_ERR_NOT_AUTH = 245;
- private static final int ST_ERR_REC_NOT_FOUND = 225;
- private static final String INSTANCE_URN_DESC = "Product instance URN=";
- private static File stclient = null;
- private static String stclientPath = null;
- private static Registry registry = null;
-
- // Private contructor
- private Registry() {
- }
-
- /**
- * Returns the common service tag registry.
- * @return the object for the common system service tag registry.
- * @throws UnsupportedOperationException if the common registry is
- * not supported.
- */
- public static Registry getSystemRegistry() throws
- UnsupportedOperationException {
- if ((registry == null) && (isSupported())) {
- registry = new Registry();
- } else {
- throw new UnsupportedOperationException(
- "Registry class is not supported");
- }
- return registry;
- }
-
- /**
- * Returns true if the DsRegistry class is supported on this system.
- * @return true if the DsRegistry class is supported,
- * otherwise false.
- */
- public static boolean isSupported() {
- return (getSTclientPath() != null);
- }
-
- /**
- * Tests if the corresponding ServiceTag exists in common registry.
- * @param productUrn of the product to look for.
- * @param installedLocation identifying the installed product.
- * @return true if at least corresponding ServiceTag exists, otherwise
- * return false.
- * @throws IOException if an error occurred in the stclient call.
- */
- public boolean existServiceTag(String productUrn,
- String installedLocation) throws IOException {
-
- boolean found = false;
- Set<ServiceTag> tags;
-
- tags = this.findServiceTags(productUrn);
- for (ServiceTag svcTag : tags) {
- if (svcTag.getProductDefinedInstanceID().equals
- (installedLocation)) {
- found = true;
- break;
- }
- }
- return found;
- }
-
- /**
- * Tests if the corresponding ServiceTag exists in common registry.
- * @param instanceUrn of the product to look for.
- * @return true if at least corresponding ServiceTag exists, otherwise
- * return false.
- */
- public boolean existServiceTag(String instanceUrn) {
- try {
- ServiceTag svcTag = getServiceTag(instanceUrn);
- if (svcTag == null) {
- return false;
- } else {
- return true;
- }
- } catch (IOException ex) {
- if (debugEnabled()) {
- TRACER.debugCaught(DebugLogLevel.WARNING, ex);
- }
- return false;
- }
- }
-
- /**
- * Adds a new ServiceTag in the common registry.
- * @param st ServiceTag to add.
- * @return the added serviceTag with updated field.
- * @throws java.io.IOException if the serviceTag can not be added.
- */
- public ServiceTag addServiceTag(ServiceTag st) throws IOException {
-
- // Parameter checking
- if (st == null) {
- throw new NullPointerException("st parameter cannot be null");
- }
-
- // If the ServiceTag already exists
- if (existServiceTag(st.getInstanceURN())) {
- throw new IOException("Instance_urn = " +
- st.getInstanceURN() + " already exists");
- }
-
- List<String> command = new ArrayList<String>();
- command.add(getSTclientPath());
- command.add("-a");
- command.add("-i");
- command.add(st.getInstanceURN());
- command.add("-p");
- command.add(st.getProductName());
- command.add("-e");
- command.add(st.getProductVersion());
- command.add("-t");
- command.add(st.getProductURN());
-
- if (st.getProductParentURN().length() > 0) {
- command.add("-F");
- command.add(st.getProductParentURN());
- }
-
- command.add("-P");
- command.add(st.getProductParent());
-
- if (st.getProductDefinedInstanceID().length() > 0) {
- command.add("-I");
- command.add(st.getProductDefinedInstanceID());
- }
- command.add("-m");
- command.add(st.getProductVendor());
- command.add("-A");
- command.add(st.getPlatformArch());
- command.add("-z");
- command.add(st.getContainer());
- command.add("-S");
- command.add(st.getSource());
-
- BufferedReader in = null;
- try {
- ProcessBuilder pb = new ProcessBuilder(command);
- Process p = pb.start();
- String output = commandOutput(p);
- String urn = "";
- if (p.exitValue() == 0) {
- // Obtain the instance urn from the stclient output
- in = new BufferedReader(new StringReader(output));
- String line = null;
- while ((line = in.readLine()) != null) {
- line = line.trim();
- if (line.startsWith(INSTANCE_URN_DESC)) {
- urn = line.substring(INSTANCE_URN_DESC.length());
- break;
- }
- }
- if (urn.length() == 0) {
- throw new IOException("Error in creating service tag:\n" +
- output);
- }
- return getServiceTag(urn);
- } else {
- return checkReturnError(p.exitValue(), output, st);
- }
- } finally {
- if (in != null) {
- in.close();
- }
- }
- }
-
- /**
- * Removes the corresponding ServiceTag from the common registry.
- * @param instanceURN of the ServiceTag to remove.
- * @return the remove DsServiceTag, if null, the ServiceTag does not exist.
- * @throws java.io.IOException if an error occured.
- */
- public ServiceTag removeServiceTag(String instanceURN) throws IOException {
-
- ServiceTag st = getServiceTag(instanceURN);
- if (st == null) {
- return null;
- }
-
- List<String> command = new ArrayList<String>();
- command.add(getSTclientPath());
- command.add("-d");
- command.add("-i");
- command.add(instanceURN);
-
- ProcessBuilder pb = new ProcessBuilder(command);
- Process p = pb.start();
- String output = commandOutput(p);
- if (p.exitValue() == 0) {
- return st;
- } else {
- return checkReturnError(p.exitValue(), output, st);
- }
- }
-
- /**
- * Returns the corresponding DsServiceTag object.
- * @param instanceURN of the ServiceTag to look for.
- * @return the corresponding DsServiceTag object.
- * @throws java.io.IOException if the tag could not be retrieved.
- */
- public ServiceTag getServiceTag(String instanceURN) throws IOException {
-
- List<String> command = new ArrayList<String>();
- command.add(getSTclientPath());
- command.add("-g");
- command.add("-i");
- command.add(instanceURN);
-
- ProcessBuilder pb = new ProcessBuilder(command);
- Process p = pb.start();
- String output = commandOutput(p);
- if (p.exitValue() == 0) {
- return parseServiceTag(output);
- } else {
- return checkReturnError(p.exitValue(), output, null);
- }
- }
-
- /**
- * Returns a Set of ServiceTag where the product urn is productURN.
- * @param productURN of the ServiceTags.
- * @return a Set of ServiceTag where the product_urn is productURN.
- * @throws java.io.IOException if error.
- */
- public Set<ServiceTag> findServiceTags(String productURN)
- throws IOException {
-
- List<String> command = new ArrayList<String>();
- command.add(getSTclientPath());
- command.add("-f");
- command.add("-t");
- command.add(productURN);
-
- BufferedReader in = null;
- try {
- ProcessBuilder pb = new ProcessBuilder(command);
- Process p = pb.start();
- String output = commandOutput(p);
-
- Set<ServiceTag> instances = new HashSet<ServiceTag>();
- if (p.exitValue() == 0) {
- // parse the service tag output from stclient
- in = new BufferedReader(new StringReader(output));
- String line = null;
- while ((line = in.readLine()) != null) {
- String s = line.trim();
- if (s.startsWith("urn:st:")) {
- instances.add(getServiceTag(s));
- }
- }
- } else {
- checkReturnError(p.exitValue(), output, null);
- }
- return instances;
- } finally {
- if (in != null) {
- in.close();
- }
- }
- }
-
- /**
- * Returns the corrsponding error based on the process exit value <>0.
- * @param exitValue return by the process.
- * @param output return by the CLI execution.
- * @param st returned by the CLI.
- * @return st returned by the CLI.
- * @throws java.io.IOException.
- */
- private static ServiceTag checkReturnError(int exitValue,
- String output,
- ServiceTag st) throws IOException {
- switch (exitValue) {
- case ST_ERR_REC_NOT_FOUND:
- return null;
- case ST_ERR_NOT_AUTH:
- if (st != null) {
- throw new IOException(
- "Not authorized to access " + st.getInstanceURN() +
- " installer_uid=" + st.getInstallerUID());
- } else {
- throw new IOException(
- "Not authorized:" + output);
- }
- default:
- throw new IOException("stclient exits with error" +
- " (" + exitValue + ")\n" + output);
- }
- }
-
- /**
- * Parses the stclient output and return the corresponding DsServiceTag
- * object.
- * @param output to parse.
- * @return the DsServiceTag.
- * @throws java.io.IOException if an error occured during the parsing.
- */
- private ServiceTag parseServiceTag(String output) throws IOException {
- BufferedReader in = null;
- try {
- Properties props = new Properties();
- // parse the service tag output from stclient
- in = new BufferedReader(new StringReader(output));
- String line = null;
- while ((line = in.readLine()) != null) {
- if ((line = line.trim()).length() > 0) {
- String[] ss = line.trim().split("=", 2);
- if (ss.length == 2) {
- props.setProperty(ss[0].trim(), ss[1].trim());
- } else {
- props.setProperty(ss[0].trim(), "");
- }
- }
- }
-
- String urn = props.getProperty(ST_NODE_INSTANCE_URN);
- String productName = props.getProperty(ST_NODE_PRODUCT_NAME);
- String productVersion = props.getProperty(ST_NODE_PRODUCT_VERSION);
- String productURN = props.getProperty(ST_NODE_PRODUCT_URN);
- String productParent = props.getProperty(ST_NODE_PRODUCT_PARENT);
- String productParentURN = props.getProperty(
- ST_NODE_PRODUCT_PARENT_URN);
- String productDefinedInstanceID =
- props.getProperty(ST_NODE_PRODUCT_DEFINED_INST_ID);
- String productVendor = props.getProperty(ST_NODE_PRODUCT_VENDOR);
- String platformArch = props.getProperty(ST_NODE_PLATFORM_ARCH);
- String container = props.getProperty(ST_NODE_CONTAINER);
- String source = props.getProperty(ST_NODE_SOURCE);
- int installerUID =
- Util.getIntValue(props.getProperty(ST_NODE_INSTALLER_UID));
- Date timestamp =
- Util.parseTimestamp(props.getProperty(ST_NODE_TIMESTAMP));
-
- return new ServiceTag(urn,
- productName,
- productVersion,
- productURN,
- productParent,
- productParentURN,
- productDefinedInstanceID,
- productVendor,
- platformArch,
- container,
- source,
- installerUID,
- timestamp);
- } finally {
- if (in != null) {
- in.close();
- }
- }
-
- }
-
- private static String getSTclientPath() {
- if (stclientPath == null) {
- // Initialization to determine the platform's stclient pathname
- String os = System.getProperty("os.name");
- if (os.equals("SunOS")) {
- stclient = new File(STCLIENT_SOLARIS);
- } else if (os.equals("Linux")) {
- stclient = new File(STCLIENT_LINUX);
- } else if (os.startsWith("Windows")) {
- stclient = getWindowsStClientFile();
- }
- }
- if ((stclientPath == null) && (stclient != null) && (stclient.exists()))
- {
- stclientPath = stclient.getAbsolutePath();
- }
- return stclientPath;
- }
-}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/servicetag/ServiceTag.java b/opendj-sdk/opends/src/server/org/opends/server/servicetag/ServiceTag.java
deleted file mode 100644
index d9a539c..0000000
--- a/opendj-sdk/opends/src/server/org/opends/server/servicetag/ServiceTag.java
+++ /dev/null
@@ -1,554 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2008 Sun Microsystems, Inc.
- */
-package org.opends.server.servicetag;
-
-import java.util.Date;
-
-import static org.opends.server.servicetag.ServiceTagDefinition.*;
-
-/**
- * The ServiceTag class represents a ServiceTag of the common registry.
- * The class allows to create new instance and retreive properties values.
- */
-public class ServiceTag {
-
- private String instanceURN;
- private String productName;
- private String productVersion;
- private String productURN;
- private String productParent;
- private String productParentURN;
- private String productDefinedInstanceID;
- private String productVendor;
- private String platformArch;
- private String container;
- private String source;
- private int installerUID;
- private Date timestamp;
- // Service Tag Field Lengths (defined in sthelper.h)
- // Since the constants defined in sthelper.h includes the null-terminated
- // character, so minus 1 from the sthelper.h defined values.
- private final int MAX_URN_LEN = 256 - 1;
- private final int MAX_PRODUCT_NAME_LEN = 256 - 1;
- private final int MAX_PRODUCT_VERSION_LEN = 64 - 1;
- private final int MAX_PRODUCT_PARENT_LEN = 256 - 1;
- private final int MAX_PRODUCT_VENDOR_LEN = 64 - 1;
- private final int MAX_PLATFORM_ARCH_LEN = 64 - 1;
- private final int MAX_CONTAINER_LEN = 64 - 1;
- private final int MAX_SOURCE_LEN = 64 - 1;
-
- // private constructors
- private ServiceTag() {
- }
-
- /**
- * Build a ServiceTag object.
- * @param instanceURN the instanceUrn of the ServiceTag.
- * @param productName the product name.
- * @param productVersion the product version.
- * @param productURN the product urn.
- * @param productParent the product parent name.
- * @param productParentURN the parent urn.
- * @param productDefinedInstanceID the installed location of the product.
- * @param productVendor the product vendor.
- * @param platformArch the platform arch.
- * @param container the container.
- * @param source the source.
- * @param installerUID the installed UID
- * @param timestamp the timestamp of the ServiceTag.
- */
- public ServiceTag(String instanceURN,
- String productName,
- String productVersion,
- String productURN,
- String productParent,
- String productParentURN,
- String productDefinedInstanceID,
- String productVendor,
- String platformArch,
- String container,
- String source,
- int installerUID,
- Date timestamp) {
- setInstanceURN(instanceURN);
- setProductName(productName);
- setProductVersion(productVersion);
- setProductURN(productURN);
- setProductParentURN(productParentURN);
- setProductParent(productParent);
- setProductDefinedInstanceID(productDefinedInstanceID);
- setProductVendor(productVendor);
- setPlatformArch(platformArch);
- setContainer(container);
- setSource(source);
- setInstallerUID(installerUID);
- setTimestamp(timestamp);
- }
-
- /**
- * Creates a new instance of DsServiceTag.
- * @param parser the properties provider.
- * @param source the creator name.
- * @param installedLocation the installed location of the product.
- * @return DsServiceTag instance.
- */
- public static ServiceTag newInstance(SwordFishIDParser parser,
- String source,
- String installedLocation) {
- return new ServiceTag("", /* empty instance_urn */
- parser.getProductName(),
- parser.getProductVersion(),
- parser.getSwordFishID(),
- parser.getProductParent(),
- parser.getProductParentUrn(),
- installedLocation,
- parser.getProductVendor(),
- SystemEnvironment.getSystemEnvironment().getOsArchitecture(),
- PRODUCT_CONTAINER,
- source,
- -1,
- null);
- }
-
- /**
- * Creates a new service tag object with no instance_urn.
- * @param productName the name of the product.
- * @param productVersion the version of the product.
- * @param productURN the uniform resource name of the product
- * @param productParent the name of the product's parent.
- * @param productParentURN the uniform resource name of the
- * product's parent.
- * @param productDefinedInstanceID the instance identifier.
- * @param productVendor the vendor of the product.
- * @param platformArch the operating system architecture.
- * @param container the container of the product.
- * @param source the source of the product.
- *
- * @return DsServiceTag instance.
- */
- public static ServiceTag newInstance(String productName,
- String productVersion,
- String productURN,
- String productParent,
- String productParentURN,
- String productDefinedInstanceID,
- String productVendor,
- String platformArch,
- String container,
- String source) {
- return new ServiceTag("", /* empty instance_urn */
- productName,
- productVersion,
- productURN,
- productParent,
- productParentURN,
- productDefinedInstanceID,
- productVendor,
- platformArch,
- container,
- source,
- -1,
- null);
- }
-
- /**
- * Creates a service tag object with a specified <tt>instance_urn</tt>.
- *
- * @param instanceURN the uniform resource name of this
- * instance.
- * @param productName the name of the product.
- * @param productVersion the version of the product.
- * @param productURN the uniform resource name of the product
- * @param productParent the name of the product's parent.
- * @param productParentURN the uniform resource name of the
- * product's parent.
- * @param productDefinedInstanceID the instance identifier.
- * @param productVendor the vendor of the product.
- * @param platformArch the operating system architecture.
- * @param container the container of the product.
- * @param source the source of the product.
- * @return the ServiceTag object
- */
- public static ServiceTag newInstance(String instanceURN,
- String productName,
- String productVersion,
- String productURN,
- String productParent,
- String productParentURN,
- String productDefinedInstanceID,
- String productVendor,
- String platformArch,
- String container,
- String source) {
- return new ServiceTag(instanceURN,
- productName,
- productVersion,
- productURN,
- productParent,
- productParentURN,
- productDefinedInstanceID,
- productVendor,
- platformArch,
- container,
- source,
- -1,
- null);
- }
-
- /**
- * Returns a uniform resource name (urn).
- * @return a URN as a String.
- */
- public static String generateInstanceURN() {
- return Util.generateURN();
- }
-
- /**
- * Returns the uniform resource name of this service tag instance.
- * @return the instance_urn of this service tag.
- */
- public String getInstanceURN() {
- return instanceURN;
- }
-
- /**
- * Returns the name of the product.
- * @return the product name.
- */
- public String getProductName() {
- return productName;
- }
-
- /**
- * Returns the version of the product.
- * @return the product version.
- */
- public String getProductVersion() {
- return productVersion;
- }
-
- /**
- * Returns the uniform resource name of the product.
- * @return the product URN.
- */
- public String getProductURN() {
- return productURN;
- }
-
- /**
- * Returns the uniform resource name of the product's parent.
- * @return the product's parent URN.
- */
- public String getProductParentURN() {
- return productParentURN;
- }
-
- /**
- * Returns the name of the product's parent.
- * @return the product's parent name.
- */
- public String getProductParent() {
- return productParent;
- }
-
- /**
- * Returns the identifier defined for this product instance.
- * @return the identifier defined for this product instance.
- */
- public String getProductDefinedInstanceID() {
- return productDefinedInstanceID;
- }
-
- /**
- * Returns the vendor of the product.
- * @return the product vendor.
- */
- public String getProductVendor() {
- return productVendor;
- }
-
- /**
- * Returns the platform architecture on which the product
- * is running on.
- * @return the platform architecture on which the product is running on.
- */
- public String getPlatformArch() {
- return platformArch;
- }
-
- /**
- * Returns the timestamp. This timestamp is set when this service tag
- * is added to or updated in the system service tag registry.
- * @return timestamp when this service tag
- * is added to or updated in a the system service tag registry.
- */
- public Date getTimestamp() {
- if (timestamp != null) {
- return (Date) timestamp.clone();
- } else {
- return null;
- }
- }
-
- /**
- * Returns the container of the product.
- * @return the container of the product.
- */
- public String getContainer() {
- return container;
- }
-
- /**
- * Returns the source of this service tag.
- * @return source of this service tag.
- */
- public String getSource() {
- return source;
- }
-
- /**
- * Returns the UID. The UID is set when this service tag
- * is added to or updated in the system service tag registry.
- * @return the UID of whom this service tag
- * is added to or updated in the system service tag registry.
- */
- public int getInstallerUID() {
- return installerUID;
- }
-
- // The following setter methods are used to validate the
- // input field when constructing a ServiceTag instance
- private void setInstanceURN(String instanceURN) {
- if (instanceURN == null) {
- throw new NullPointerException(
- "Parameter instanceURN cannot be null");
- }
- if (instanceURN.length() > MAX_URN_LEN) {
- throw new IllegalArgumentException("instanceURN \"" + instanceURN +
- "\" exceeds maximum length " + MAX_URN_LEN);
- }
- this.instanceURN = instanceURN;
- }
-
- private void setProductName(String productName) {
- if (productName == null) {
- throw new NullPointerException(
- "Parameter productName cannot be null");
- }
- if (productName.length() == 0) {
- throw new IllegalArgumentException("product name cannot be empty");
- }
- if (productName.length() > MAX_PRODUCT_NAME_LEN) {
- throw new IllegalArgumentException("productName \"" + productName +
- "\" exceeds maximum length " + MAX_PRODUCT_NAME_LEN);
- }
- this.productName = productName;
- }
-
- private void setProductVersion(String productVersion) {
- if (productVersion == null) {
- throw new NullPointerException(
- "Parameter productVersion cannot be null");
- }
-
- if (productVersion.length() == 0) {
- throw new IllegalArgumentException(
- "product version cannot be empty");
- }
- if (productVersion.length() > MAX_PRODUCT_VERSION_LEN) {
- throw new IllegalArgumentException("productVersion \"" +
- productVersion + "\" exceeds maximum length " +
- MAX_PRODUCT_VERSION_LEN);
- }
- this.productVersion = productVersion;
- }
-
- private void setProductURN(String productURN) {
- if (productURN == null) {
- throw new NullPointerException(
- "Parameter productURN cannot be null");
- }
- if (productURN.length() == 0) {
- throw new IllegalArgumentException(
- "product URN cannot be empty");
- }
- if (productURN.length() > MAX_URN_LEN) {
- throw new IllegalArgumentException("productURN \"" + productURN +
- "\" exceeds maximum length " + MAX_URN_LEN);
- }
- this.productURN = productURN;
- }
-
- private void setProductParentURN(String productParentURN) {
- if (productParentURN == null) {
- throw new NullPointerException(
- "Parameter productParentURN cannot be null");
- }
- // optional field - can be empty
- if (productParentURN.length() > MAX_URN_LEN) {
- throw new IllegalArgumentException("productParentURN \"" +
- productParentURN + "\" exceeds maximum length " +
- MAX_URN_LEN);
- }
- this.productParentURN = productParentURN;
- }
-
- private void setProductParent(String productParent) {
- if (productParent == null) {
- throw new NullPointerException(
- "Parameter productParent cannot be null");
- }
- if (productParent.length() == 0) {
- throw new IllegalArgumentException(
- "product parent cannot be empty");
- }
- if (productParent.length() > MAX_PRODUCT_PARENT_LEN) {
- throw new IllegalArgumentException("productParent \"" +
- productParent + "\" exceeds maximum length " +
- MAX_PRODUCT_PARENT_LEN);
- }
- this.productParent = productParent;
- }
-
- private void setProductDefinedInstanceID(String productDefinedInstanceID) {
- if (productDefinedInstanceID == null) {
- throw new NullPointerException(
- "Parameter productDefinedInstanceID cannot be null");
- }
- if (productDefinedInstanceID.length() > MAX_URN_LEN) {
- throw new IllegalArgumentException("productDefinedInstanceID \"" +
- productDefinedInstanceID + "\" exceeds maximum length " +
- MAX_URN_LEN);
- }
- // optional field - can be empty
- this.productDefinedInstanceID = productDefinedInstanceID;
- }
-
- private void setProductVendor(String productVendor) {
- if (productVendor == null) {
- throw new NullPointerException(
- "Parameter productVendor cannot be null");
- }
- if (productVendor.length() == 0) {
- throw new IllegalArgumentException(
- "product vendor cannot be empty");
- }
- if (productVendor.length() > MAX_PRODUCT_VENDOR_LEN) {
- throw new IllegalArgumentException("productVendor \"" +
- productVendor + "\" exceeds maximum length " +
- MAX_PRODUCT_VENDOR_LEN);
- }
- this.productVendor = productVendor;
- }
-
- private void setPlatformArch(String platformArch) {
- if (platformArch == null) {
- throw new NullPointerException(
- "Parameter platformArch cannot be null");
- }
- if (platformArch.length() == 0) {
- throw new IllegalArgumentException(
- "platform architecture cannot be empty");
- }
- if (platformArch.length() > MAX_PLATFORM_ARCH_LEN) {
- throw new IllegalArgumentException("platformArch \"" +
- platformArch + "\" exceeds maximum length " +
- MAX_PLATFORM_ARCH_LEN);
- }
- this.platformArch = platformArch;
- }
-
- private void setTimestamp(Date timestamp) {
- // can be null
- this.timestamp = timestamp;
- }
-
- private void setContainer(String container) {
- if (container == null) {
- throw new NullPointerException(
- "Parameter container cannot be null");
- }
- if (container.length() == 0) {
- throw new IllegalArgumentException("container cannot be empty");
- }
- if (container.length() > MAX_CONTAINER_LEN) {
- throw new IllegalArgumentException("container \"" +
- container + "\" exceeds maximum length " +
- MAX_CONTAINER_LEN);
- }
- this.container = container;
- }
-
- private void setSource(String source) {
- if (source == null) {
- throw new NullPointerException("Parameter source cannot be null");
- }
- if (source.length() == 0) {
- throw new IllegalArgumentException("source cannot be empty");
- }
- if (source.length() > MAX_SOURCE_LEN) {
- throw new IllegalArgumentException("source \"" + source +
- "\" exceeds maximum length " + MAX_SOURCE_LEN);
- }
- this.source = source;
- }
-
- private void setInstallerUID(int installerUID) {
- this.installerUID = installerUID;
- }
-
- /**
- * Compares this service tag to the specified object.
- * @param obj Object to test.
- * @return true if this service tag is the same as
- * the specified object.
- */
- @Override
- public boolean equals(Object obj) {
- if (obj == null || !(obj instanceof ServiceTag)) {
- return false;
- }
- ServiceTag st = (ServiceTag) obj;
- if (st == this) {
- return true;
- }
- return st.getInstanceURN().equals(getInstanceURN());
- }
-
- /**
- * Returns the hash code value for this service tag.
- * @return the hash code value for this service tag.
- */
- @Override
- public int hashCode() {
- int hash = 7;
- hash = 19 * hash + (this.instanceURN != null ?
- this.instanceURN.hashCode()
- : 0);
- return hash;
- }
-}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/servicetag/ServiceTagAlreadyExistsException.java b/opendj-sdk/opends/src/server/org/opends/server/servicetag/ServiceTagAlreadyExistsException.java
deleted file mode 100644
index c67c42c..0000000
--- a/opendj-sdk/opends/src/server/org/opends/server/servicetag/ServiceTagAlreadyExistsException.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2008 Sun Microsystems, Inc.
- */
-package org.opends.server.servicetag;
-
-import org.opends.messages.Message;
-
-/**
- * Exception class if the ServiceTag exists.
- */
-public class ServiceTagAlreadyExistsException extends ServiceTagException {
-
- /**
- * The serial version identifier required to satisfy the compiler
- * because this class extends <CODE>java.lang.Exception</CODE>,
- * which implements the <CODE>java.io.Serializable</CODE> interface.
- * This value was generated using the <CODE>serialver</CODE>
- * command-line utility included with the Java SDK.
- */
- private static final long serialVersionUID = -7988596995323914139L;
- /**
- * Create a ServiceTag Exception with a message and cause.
- *
- * @param message
- * The message.
- */
- protected ServiceTagAlreadyExistsException(Message message) {
- super(message);
- }
-
- /**
- * Create a ServiceTag Exception with a message and cause.
- *
- * @param message
- * The message.
- * @param cause
- * The cause.
- */
- protected ServiceTagAlreadyExistsException(
- Message message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/servicetag/ServiceTagDefinition.java b/opendj-sdk/opends/src/server/org/opends/server/servicetag/ServiceTagDefinition.java
deleted file mode 100644
index 90e2819..0000000
--- a/opendj-sdk/opends/src/server/org/opends/server/servicetag/ServiceTagDefinition.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2008-2010 Sun Microsystems, Inc.
- */
-package org.opends.server.servicetag;
-
-/**
- * Definitions of ServiceTag properties, fields and values.
- */
-public class ServiceTagDefinition {
-
- /**
- * instance_urn tag field name in the servicetag dtd.
- */
- public final static String ST_NODE_INSTANCE_URN = "instance_urn";
- /**
- * product_name tag field name in the servicetag dtd.
- */
- public final static String ST_NODE_PRODUCT_NAME = "product_name";
- /**
- * product_version tag field name in the servicetag dtd.
- */
- public final static String ST_NODE_PRODUCT_VERSION = "product_version";
- /**
- * product_urn tag field name in the servicetag dtd.
- */
- public final static String ST_NODE_PRODUCT_URN = "product_urn";
- /**
- * product_parent_urn tag field name in the servicetag dtd.
- */
- public final static String ST_NODE_PRODUCT_PARENT_URN
- = "product_parent_urn";
- /**
- * product_parent tag field name in the servicetag dtd.
- */
- public final static String ST_NODE_PRODUCT_PARENT = "product_parent";
- /**
- * product_defined_inst_id tag field name in the servicetag dtd.
- */
- public final static String ST_NODE_PRODUCT_DEFINED_INST_ID
- = "product_defined_inst_id";
- /**
- * product_vendor tag field name in the servicetag dtd.
- */
- public final static String ST_NODE_PRODUCT_VENDOR = "product_vendor";
- /**
- * platform_arch tag field name in the servicetag dtd.
- */
- public final static String ST_NODE_PLATFORM_ARCH = "platform_arch";
- /**
- * timestamp tag field name in the servicetag dtd.
- */
- public final static String ST_NODE_TIMESTAMP = "timestamp";
- /**
- * container tag field name in the servicetag dtd.
- */
- final static String ST_NODE_CONTAINER = "container";
- /**
- * tag field name in the servicetag dtd.
- */
- final static String ST_NODE_SOURCE = "source";
- /**
- * tag field name in the servicetag dtd.
- */
- final static String ST_NODE_INSTALLER_UID = "installer_uid";
- /**
- * Product container value.
- */
- final static String PRODUCT_CONTAINER = "Global";
- /**
- * Product vendor property.
- */
- final static String PRODUCT_VENDOR = "org.opends.server.servicetag.vendor";
- /**
- * Product name property.
- */
- final static String PRODUCT_NAME =
- "org.opends.server.servicetag.productname";
- /**
- * Product version property.
- */
- final static String PRODUCT_VERSION =
- "org.opends.server.servicetag.version";
- /**
- * Product uuid property.
- */
- final static String PRODUCT_UUID =
- "org.opends.server.servicetag.uuid";
- /**
- * Product parent property.
- */
- final static String PRODUCT_PARENT =
- "org.opends.server.servicetag.parent";
- /**
- * Product parent urn property.
- */
- final static String PRODUCT_PARENT_URN =
- "org.opends.server.servicetag.parenturn";
-
- /**
- * Registration done file name.
- */
- final static String FILE_REGISTRATION_DONE = "st-registration.done";
-}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/servicetag/ServiceTagDoesNotExistException.java b/opendj-sdk/opends/src/server/org/opends/server/servicetag/ServiceTagDoesNotExistException.java
deleted file mode 100644
index b6eb909..0000000
--- a/opendj-sdk/opends/src/server/org/opends/server/servicetag/ServiceTagDoesNotExistException.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2008 Sun Microsystems, Inc.
- */
-package org.opends.server.servicetag;
-
-import org.opends.messages.Message;
-
-/**
- * Exception thrown when the ServiceTag does not exist.
- */
-public class ServiceTagDoesNotExistException extends ServiceTagException {
-
- /**
- * The serial version identifier required to satisfy the compiler
- * because this class extends <CODE>java.lang.Exception</CODE>,
- * which implements the <CODE>java.io.Serializable</CODE> interface.
- * This value was generated using the <CODE>serialver</CODE>
- * command-line utility included with the Java SDK.
- */
- private static final long serialVersionUID = -134526464852686155L;
-
- /**
- * Create a ServiceTag Exception with a message and cause.
- * @param message
- * The message.
- */
- protected ServiceTagDoesNotExistException(Message message) {
- super(message);
- }
-
- /**
- * Create a ServiceTag Exception with a message and cause.
- * @param message
- * The message.
- * @param cause
- * The cause.
- */
- protected ServiceTagDoesNotExistException(
- Message message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/servicetag/ServiceTagException.java b/opendj-sdk/opends/src/server/org/opends/server/servicetag/ServiceTagException.java
deleted file mode 100644
index cab7608..0000000
--- a/opendj-sdk/opends/src/server/org/opends/server/servicetag/ServiceTagException.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2008 Sun Microsystems, Inc.
- */
-package org.opends.server.servicetag;
-
-import org.opends.messages.Message;
-import org.opends.server.types.OpenDsException;
-
-/**
- * Common ServiceTag Exception.
- */
-public class ServiceTagException extends OpenDsException {
-
- /**
- * The serial version identifier required to satisfy the compiler
- * because this class extends <CODE>java.lang.Exception</CODE>,
- * which implements the <CODE>java.io.Serializable</CODE> interface.
- * This value was generated using the <CODE>serialver</CODE>
- * command-line utility included with the Java SDK.
- */
- private static final long serialVersionUID = -6378920301282558293L;
- /**
- * Create a ServiceTag Exception with a message and cause.
- * @param message
- * The message.
- */
- protected ServiceTagException(Message message) {
- super(message);
- }
-
- /**
- * Create a ServiceTag Exception with a message and cause.
- * @param message
- * The message.
- * @param cause
- * The cause.
- */
- protected ServiceTagException(Message message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/servicetag/ServiceTagRegistration.java b/opendj-sdk/opends/src/server/org/opends/server/servicetag/ServiceTagRegistration.java
deleted file mode 100644
index de02c38..0000000
--- a/opendj-sdk/opends/src/server/org/opends/server/servicetag/ServiceTagRegistration.java
+++ /dev/null
@@ -1,482 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2008-2010 Sun Microsystems, Inc.
- * Portions Copyright 2011 ForgeRock AS
- */
-package org.opends.server.servicetag;
-
-
-import java.io.File;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Properties;
-import java.util.Set;
-import org.opends.messages.Message;
-import org.opends.server.core.DirectoryServer;
-
-import org.opends.server.loggers.debug.DebugTracer;
-import org.opends.server.types.DebugLogLevel;
-import static org.opends.server.loggers.debug.DebugLogger.*;
-
-import static org.opends.server.servicetag.ServiceTagDefinition.*;
-import static org.opends.messages.ServiceTagMessages.*;
-
-/**
- * ServiceTagRegistration service is responsible to
- * manage the Common and Active product registration : Only common registration
- * is currently supported.
- * Main class to register/delete ServiceTags.
- */
-public class ServiceTagRegistration {
-
- /**
- * The tracer object for the debug logger.
- */
- private static final DebugTracer TRACER = getTracer();
-
-
- // Registration singleton service
- private static ServiceTagRegistration registrationService = null;
- // Configuration / properties files management
- private SwordFishIdConfiguration configurationService = null;
- // ServiceTag Registry which manage the stclient calls
- private Registry registry = null;
-
- /**
- * Private service contructor.
- */
- private ServiceTagRegistration() {
- // Get the configuration
- this.configurationService = SwordFishIdConfiguration.getService();
- // Get the common registry
- if (Registry.isSupported()) {
- this.registry = Registry.getSystemRegistry();
- }
- }
-
- /**
- * Gets the ServiceTag registration service.
- * This registration service allow to register create and register
- * ServiceTag for products.
- * @return the service
- */
- public static ServiceTagRegistration getRegistrationService() {
- if (ServiceTagRegistration.registrationService == null) {
- ServiceTagRegistration.registrationService =
- new ServiceTagRegistration();
- }
-
- return registrationService;
- }
-
- /**
- * Tests if the stclient CLI is present on the filesystem.
- * The serviceTag packages are not relocatable so the full path
- * is well known if exists.
- * @return true if stclient binary exists, false otherwise.
- */
- public boolean isCommonRegistrationSupported() {
- return Registry.isSupported();
- }
-
- /**
- * Tests if the ST registration has already be done for the instance.
- * @return true if the ST registration has been done, false otherwise.
- */
- public boolean isRegistrationAlreadyDone() {
- File serviceTag =
- new File(DirectoryServer.getInstanceRoot() +
- File.separatorChar +
- "config" +
- File.separatorChar +
- "servicetag" +
- File.separatorChar +
- ServiceTagDefinition.FILE_REGISTRATION_DONE);
-
- if (!serviceTag.exists()) {
- return false;
- }
- else {
- return true;
- }
- }
-
-
- /**
- * Create the registration file.
- * @throws IOException if the file cannot be created.
- */
- public void createRegistrationDone() throws IOException {
- File serviceTag =
- new File(DirectoryServer.getInstanceRoot() +
- File.separatorChar +
- "config" +
- File.separatorChar +
- "servicetag" +
- File.separatorChar +
- ServiceTagDefinition.FILE_REGISTRATION_DONE);
-
- if (!serviceTag.exists()) {
- serviceTag.createNewFile();
- }
- }
-
-
- /**
- * Create the defined serviceTags for OpenDS Based Servers.
- * At this point the ST registration is supported. stclient will be used
- * to create the OpenDS service tag.
- * @param svcTag the ServiceTag to register.
- * @throws org.opends.server.servicetag.ServiceTagException
- * if the ServiceTag can not be registered
- */
- public void registerServiceTag(ServiceTag svcTag) throws
- ServiceTagException {
- try {
- // Add the ServiceTag in the common registry
- this.registry.addServiceTag(svcTag);
- this.createRegistrationDone();
- } catch (IOException ex) {
- throw new ServiceTagException(
- WARN_SERVICETAG_CANNOT_BE_REGISTERED.get(
- svcTag.getProductName(),
- svcTag.getProductURN(),
- svcTag.getProductDefinedInstanceID()));
- }
- }
-
- /**
- * Create and register the defined serviceTags for OpenDS Based Servers if
- * the common registration is supported.
- * If the system supports service tag, stclient will be used
- * to create the OpenDS service tag.
- * @param source defining who is the creater
- * @return a set of DsServiceTag which have NOT been registered
- * due to registration errors.
- * An empty Set means that no error occurs.
- * @throws org.opends.server.servicetag.ServiceTagException if a pb
- * occurs.
- * @throws java.lang.IllegalArgumentException if parameter is not valid.
- */
- public Set<ServiceTag> registerServiceTags(String source)
- throws ServiceTagException, IllegalArgumentException {
-
- // Check if the registration has been done.
- if (this.isRegistrationAlreadyDone()) {
- throw new ServiceTagAlreadyExistsException
- (WARN_SERVICETAG_ALREADY_EXIST.get());
- }
-
- // Parameter checking
- // Test if the common registration is supported on the filesystem
- // or not
- if (!isCommonRegistrationSupported()) {
- throw new ServiceTagException(
- WARN_REGISTRY_NOT_SUPPORTED.get());
- }
-
- if ((source == null) || (source.length() == 0)) {
- throw new IllegalArgumentException(
- WARN_PARAMETER_CANNOT_BE_NULL.get("source").toString());
- }
-
- // Errors Set
- Set<ServiceTag> errors = new HashSet<ServiceTag>();
-
- // Get the parsers
- Set<SwordFishIDParser> parsers =
- this.configurationService.getParsers();
-
- // Throw exception id nothing to register
- if (parsers.isEmpty()) {
- throw new ServiceTagException(
- WARN_NO_SERVICETAG_TO_REGISTER.get());
- }
-
- // Register ServiceTag
- ServiceTag svcTag = null;
- for (SwordFishIDParser parser : parsers) {
-
- // create the serviceTag if the registration is supported
- // and the tag does not already exist
- svcTag = ServiceTag.newInstance(
- parser,
- source,
- DirectoryServer.getServerRoot());
- try {
- registerServiceTag(svcTag);
- } catch (Exception ex) {
- if (debugEnabled()) {
- Message message =
- WARN_SERVICETAG_CANNOT_BE_REGISTERED.get(
- svcTag.getProductName(),
- svcTag.getProductURN(),
- svcTag.getProductDefinedInstanceID());
- TRACER.debugWarning(message.toString());
- }
- }
- }
- return errors;
- }
-
- /**
- * Deletes from the common registry the defined ServiceTag.
- * @param svcTag to delete.
- * @throws java.lang.IllegalArgumentException if parameter is not valid.
- * @throws org.opends.server.servicetag.ServiceTagException if a
- * pb occurs.
- * @throws org.opends.server.servicetag.ServiceTagDoesNotExistException
- * if the ServiceTag to delete does not exist.
- */
- public void deleteServiceTag(ServiceTag svcTag) throws
- IllegalArgumentException, ServiceTagException,
- ServiceTagDoesNotExistException {
-
- // Test if the common registration is supported on the filesystem
- // or not
- if (!isCommonRegistrationSupported()) {
- throw new ServiceTagException(
- WARN_REGISTRY_NOT_SUPPORTED.get());
- }
- // Parametr checking
- if (svcTag == null) {
- throw new IllegalArgumentException(
- WARN_PARAMETER_CANNOT_BE_NULL.get("svcTag").toString());
- }
- try {
- if (!this.registry.existServiceTag(
- svcTag.getProductURN(),
- svcTag.getProductDefinedInstanceID())) {
- throw new ServiceTagDoesNotExistException(
- WARN_SERVICETAG_DOESNOT_EXIST.get());
- }
- this.registry.removeServiceTag(svcTag.getInstanceURN());
- } catch (IOException ex) {
- throw new ServiceTagException(
- WARN_NO_SERVICETAG_TO_REMOVE.get());
- }
- }
-
- /**
- * Delete the created tags defined in the properties files.
- * @throws org.opends.server.servicetag.ServiceTagException.
- */
- private Set<ServiceTag> deleteServiceTags() throws ServiceTagException {
-
- // Parameter checking
- // Test if the common registration is supported on the filesystem
- // or not
- if (!isCommonRegistrationSupported()) {
- throw new ServiceTagException(
- WARN_REGISTRY_NOT_SUPPORTED.get());
- }
-
- Set<SwordFishIDParser> parsers =
- this.configurationService.getParsers();
-
- // Throw exception id nothing to register
- if (parsers.isEmpty()) {
- throw new ServiceTagException(
- WARN_NO_SERVICETAG_TO_REMOVE.get());
- }
-
- Set<ServiceTag> errors = new HashSet<ServiceTag>();
- for (SwordFishIDParser parser : parsers) {
- Set<ServiceTag> removeTags = null;
- try {
- removeTags = this.registry.findServiceTags(
- parser.getSwordFishID());
- if ((removeTags == null) || (removeTags.isEmpty())) {
- throw new ServiceTagException(
- WARN_NO_SERVICETAG_TO_REMOVE.get());
- }
- } catch (Exception ex) {
- throw new ServiceTagException(
- WARN_NO_SERVICETAG_TO_REMOVE.get());
- }
-
- for (ServiceTag svcTag : removeTags) {
- try {
- deleteServiceTag(svcTag);
- } catch (Exception ex) {
- errors.add(svcTag);
- }
- }
- }
- return errors;
- }
-
- /**
- * Creates and register a ServiceTag based on properties definitions
- * and source.
- * @param source defining the caller.
- * @param properties where the following ones are defined
- * <B>org.opends.server.servicetag.productname</B>
- * <B>org.opends.server.servicetag.version</B>
- * <B>org.opends.server.servicetag.uuid</B>
- * <B>org.opends.server.servicetag.parent</B>
- * <B>org.opends.server.servicetag.parenturn</B>
- * <B>org.opends.server.servicetag.vendor</B>
- * @return the corresponding registered ServiceTag object
- * @throws org.opends.server.servicetag.ServiceTagException if a
- * registration problem occurs.
- * @throws org.opends.server.servicetag.ServiceTagAlreadyExistsException if
- * the Service tag already exist.
- * @throws java.lang.IllegalArgumentException if parameters are not valid.
- */
- public ServiceTag registerServiceTag(String source,
- Properties properties)
- throws ServiceTagException, IllegalArgumentException,
- ServiceTagAlreadyExistsException {
-
- if ((source == null) || (source.length() == 0)) {
- throw new IllegalArgumentException(
- WARN_PARAMETER_CANNOT_BE_NULL.get("source").toString());
- }
-
- if (properties == null) {
- throw new IllegalArgumentException(
- WARN_PARAMETER_CANNOT_BE_NULL.get("properties").toString());
- }
-
- if (!properties.containsKey(PRODUCT_NAME)) {
- throw new IllegalArgumentException(
- WARN_BAD_PROPERTIES.get(PRODUCT_NAME).toString());
- }
- String productName = properties.getProperty(PRODUCT_NAME);
-
- if (!properties.containsKey(PRODUCT_VERSION)) {
- throw new IllegalArgumentException(
- WARN_BAD_PROPERTIES.get(PRODUCT_VERSION).toString());
- }
- String productVersion = properties.getProperty(PRODUCT_VERSION);
-
- if (!properties.containsKey(PRODUCT_UUID)) {
- throw new IllegalArgumentException(
- WARN_BAD_PROPERTIES.get(PRODUCT_UUID).toString());
- }
- String productURN = properties.getProperty(PRODUCT_UUID);
-
- if (!properties.containsKey(PRODUCT_PARENT)) {
- throw new IllegalArgumentException(
- WARN_BAD_PROPERTIES.get(PRODUCT_PARENT).toString());
- }
- String productParent = properties.getProperty(PRODUCT_PARENT);
-
- if (!properties.containsKey(PRODUCT_PARENT_URN)) {
- throw new IllegalArgumentException(
- WARN_BAD_PROPERTIES.get(PRODUCT_PARENT_URN).toString());
- }
- String productParentURN = properties.getProperty(PRODUCT_PARENT_URN);
-
- ServiceTag svcTag = ServiceTag.newInstance(
- productName,
- productVersion,
- productURN,
- productParent,
- productParentURN,
- DirectoryServer.getServerRoot(),
- PRODUCT_VENDOR,
- SystemEnvironment.getSystemEnvironment().getOsArchitecture(),
- PRODUCT_CONTAINER,
- source);
-
- registerServiceTag(svcTag);
-
- return svcTag;
- }
-
- /**
- * Test purpose.
- * @param args represents -register or -delete command.
- */
- public static void main(String[] args) {
-
- String source = "Manual";
-
- // Parse the options (arguments starting with "-" )
- boolean delete = false;
- boolean register = false;
-
- int count = 0;
- while (count < args.length) {
- String arg = args[count];
- if (arg.trim().length() == 0) {
- // skip empty arguments
- count++;
- continue;
- }
-
- if (arg.equals("-delete")) {
- delete = true;
- } else if (arg.equals("-register")) {
- register = true;
- }
- count++;
- }
-
- if ((register == false) && (delete == false)) {
- usage();
- return;
- }
-
- ServiceTagRegistration service =
- ServiceTagRegistration.getRegistrationService();
-
- if (delete) {
- try {
- service.deleteServiceTags();
- } catch (ServiceTagException ex) {
- // ServiceTags Registration errors do not prevent the server to
- // start. WARNING logged in debug mode
- if (debugEnabled()) {
- TRACER.debugCaught(DebugLogLevel.WARNING, ex);
- } }
- } else {
- try {
- service.registerServiceTags(source);
- } catch (Exception ex) {
- // ServiceTags Registration errors do not prevent the server to
- // start. WARNING logged in debug mode
- if (debugEnabled()) {
- TRACER.debugCaught(DebugLogLevel.WARNING, ex);
- }
- }
- }
- System.exit(0);
- }
-
- private static void usage() {
- System.out.println("Usage:");
- System.out.print(" " + ServiceTagRegistration.class.getName());
- System.out.println(" [-delete|-register|-help]");
- System.out.println(" to delete/register a OpenDJ ServiceTags");
- System.out.println("");
- System.out.println("Options:");
- System.out.println(" -delete : to delete the OpenDJ ServiceTags");
- System.out.println(" -register: to register the OpenDJ ServiceTags");
- System.out.println(" -help : to print this help message");
- }
-}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/servicetag/SwordFishIDParser.java b/opendj-sdk/opends/src/server/org/opends/server/servicetag/SwordFishIDParser.java
deleted file mode 100644
index ded9c35..0000000
--- a/opendj-sdk/opends/src/server/org/opends/server/servicetag/SwordFishIDParser.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2008 Sun Microsystems, Inc.
- */
-package org.opends.server.servicetag;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Properties;
-
-import static org.opends.server.servicetag.ServiceTagDefinition.*;
-
-/**
- * SwordFishIDParser parses a properties file where product's properties
- * are
- * <LI><B>org.opends.server.servicetag.productname</B></LI>
- * <LI><B>org.opends.server.servicetag.version</B></LI>
- * <LI><B>org.opends.server.servicetag.uuid</B></LI>
- * <LI><B>org.opends.server.servicetag.parent</B></LI>
- * <LI><B>org.opends.server.servicetag.parenturn</B></LI>
- * <LI><B>org.opends.server.servicetag.vendor</B></LI>.
- */
-public class SwordFishIDParser {
-
- // List of properties
- private Properties properties; // File propeties url to load
- private final URL url; // Properties names
-
- /**
- * Creates a parser for the properties file.
- * @param url to the properties file.
- * @throws java.io.IOException if the stream could not be opened.
- */
- public SwordFishIDParser(URL url) throws IOException {
- this.url = url;
- this.properties = new Properties();
- this.properties.load(url.openStream());
- }
-
- /**
- * Gets the UUID defined in the properties file.
- * @return the swordfish id.
- */
- public String getSwordFishID() {
- return properties.getProperty(PRODUCT_UUID);
- }
-
- /**
- * Gets the product name defined in the properties file.
- * @return the product name.
- */
- public String getProductName() {
- return properties.getProperty(PRODUCT_NAME);
- }
-
- /**
- * Gets the version defined in the properties file.
- * @return the version.
- */
- public String getProductVersion() {
- return properties.getProperty(PRODUCT_VERSION);
- }
-
- /**
- * Gets the vendor defined in the properties file.
- * @return the product vendor.
- */
- public String getProductVendor() {
- return properties.getProperty(PRODUCT_VENDOR);
- }
-
- /**
- * Gets the parent product family defined in the properties file.
- * @return the parent family name.
- */
- public String getProductParent() {
- return properties.getProperty(PRODUCT_PARENT);
- }
-
- /**
- * Gets the UUID of the parent family defined in the properties file.
- * @return the UUID of the product's family.
- */
- public String getProductParentUrn() {
- return properties.getProperty(PRODUCT_PARENT_URN);
- }
-
- /**
- * Gets the defined properties in a properties object.
- * @return the properties object.
- */
- public Properties getProperties() {
- return this.properties;
- }
-
-}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/servicetag/SwordFishIdConfiguration.java b/opendj-sdk/opends/src/server/org/opends/server/servicetag/SwordFishIdConfiguration.java
deleted file mode 100644
index fabac3c..0000000
--- a/opendj-sdk/opends/src/server/org/opends/server/servicetag/SwordFishIdConfiguration.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2008-2009 Sun Microsystems, Inc.
- */
-package org.opends.server.servicetag;
-
-import java.io.File;
-import java.util.HashSet;
-import java.util.Set;
-import org.opends.server.core.DirectoryServer;
-
-import org.opends.server.loggers.debug.DebugTracer;
-import org.opends.server.types.DebugLogLevel;
-import static org.opends.server.loggers.debug.DebugLogger.*;
-
-/**
- * SwordFishIdConfiguration allows to read the properties file,
- * This class allows to get the associated parsers.
- */
-public class SwordFishIdConfiguration {
-
- /**
- * The tracer object for the debug logger.
- */
- private static final DebugTracer TRACER = getTracer();
-
- // Singleton
- private static SwordFishIdConfiguration service = null;
- // Parsers for the ServiceTag properties files
- private Set<SwordFishIDParser> parsers = new HashSet<SwordFishIDParser>();
- // Configuration properties files pattern
- private String FILE_PATTERN = "opends.uuids";
- private File[] listProperties;
-
- // Private constructor
- private SwordFishIdConfiguration() {
-
- try {
-
- // Build the full path to the properties files
- // if resources dir exists then read the property files
- // else use the default in config dir
- File serviceTag = new File(
- DirectoryServer.getServerRoot() +
- File.separatorChar +
- "resources" +
- File.separatorChar +
- "servicetag");
-
- if ((!serviceTag.exists()) || (!serviceTag.isDirectory())) {
- serviceTag = new File(DirectoryServer.getInstanceRoot() +
- File.separatorChar +
- "config" +
- File.separatorChar +
- "servicetag");
- if ((!serviceTag.exists()) || (!serviceTag.isDirectory())) {
- return;
- }
- }
-
- this.listProperties = serviceTag.listFiles();
- for (int i = 0; i < listProperties.length; i++) {
- try {
- if (listProperties[i].getAbsolutePath().
- contains(FILE_PATTERN)) {
- parsers.add(new SwordFishIDParser(
- listProperties[i].toURI().toURL()));
- }
- } catch (Throwable t) {
- if (debugEnabled()) {
- TRACER.debugCaught(DebugLogLevel.WARNING, t);
- }
- }
- }
- } catch (Exception ex) {
- if (debugEnabled()) {
- TRACER.debugCaught(DebugLogLevel.WARNING, ex);
- }
- }
- }
-
- /**
- * Returns the configuration object allowing to get parsers
- * and properties files.
- * @return the configuration service.
- */
- public static SwordFishIdConfiguration getService() {
- if (service == null) {
- service = new SwordFishIdConfiguration();
- }
- return service;
- }
-
- /**
- * Returns the list of parsers.
- * @return the list of parsers.
- */
- public Set<SwordFishIDParser> getParsers() {
- return this.parsers;
- }
-
- /**
- * Returns the list of processed properties files.
- * @return an Array of File.
- */
- public File[] getPropertiesFiles() {
- return this.listProperties;
- }
-}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/servicetag/SystemEnvironment.java b/opendj-sdk/opends/src/server/org/opends/server/servicetag/SystemEnvironment.java
deleted file mode 100644
index cff4db5..0000000
--- a/opendj-sdk/opends/src/server/org/opends/server/servicetag/SystemEnvironment.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2008 Sun Microsystems, Inc.
- */
-package org.opends.server.servicetag;
-
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-
-/**
- * SystemEnvironment provides utilities to get System information :
- * hostname, os.name, os.version, os.arch.
- */
-public class SystemEnvironment {
-
- private String hostname;
- private String osName;
- private String osVersion;
- private String osArchitecture;
-
- private static SystemEnvironment sysEnv = null;
-
- // Private contructor
- private SystemEnvironment() {
- try {
- this.hostname = InetAddress.getLocalHost().getHostName();
- } catch (UnknownHostException ex) {
- this.hostname = "Unknown host";
- }
- this.osName = System.getProperty("os.name");
- this.osVersion = System.getProperty("os.version");
- this.osArchitecture = System.getProperty("os.arch");
- }
-
- /**
- * Return the System Environment singleton object.
- * @return the DsSystemEnvironment object.
- */
- public static synchronized SystemEnvironment getSystemEnvironment() {
- if (sysEnv == null) {
- sysEnv = new SystemEnvironment();
- }
- return sysEnv;
- }
-
- /**
- * Returns the hostname.
- * @return The hostname.
- */
- public String getHostname() {
- return hostname;
- }
-
- /**
- * Returns the osName.
- * @return The osName.
- */
- public String getOsName() {
- return osName;
- }
-
- /**
- * Returns the osVersion.
- * @return The osVersion.
- */
- public String getOsVersion() {
- return osVersion;
- }
-
- /**
- * Returns the osArchitecture.
- * @return The osArchitecture.
- */
- public String getOsArchitecture() {
- return osArchitecture;
- }
-}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/servicetag/Util.java b/opendj-sdk/opends/src/server/org/opends/server/servicetag/Util.java
deleted file mode 100644
index d6180a5..0000000
--- a/opendj-sdk/opends/src/server/org/opends/server/servicetag/Util.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2008 Sun Microsystems, Inc.
- */
-package org.opends.server.servicetag;
-
-import java.io.*;
-import java.util.Date;
-import java.text.SimpleDateFormat;
-import java.text.ParseException;
-import java.util.TimeZone;
-import java.util.UUID;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import org.opends.server.loggers.debug.DebugTracer;
-import org.opends.server.types.DebugLogLevel;
-import static org.opends.server.loggers.debug.DebugLogger.*;
-
-/**
- * Utility class for org.opends.server.servicetag package.
- */
-class Util {
-
- /**
- * The tracer object for the debug logger.
- */
- private static final DebugTracer TRACER = getTracer();
-
- /**
- * Returns a generated a random instance URN.
- * @return a String "urn:st:....".
- */
- public static String generateURN() {
- return "urn:st:" + UUID.randomUUID().toString();
- }
-
- /**
- * Returns the int represntation of the String.
- * @param value to tranform.
- * @return the int value.
- */
- public static int getIntValue(String value) {
- try {
- return Integer.parseInt(value);
- } catch (NumberFormatException e) {
- throw new IllegalArgumentException("\"" + value + "\"" +
- " expected to be an integer");
- }
- }
-
-
- /**
- * Parses a timestamp string in YYYY-MM-dd HH:mm:ss GMT format.
- * @param timestamp Timestamp in the YYYY-MM-dd HH:mm:ss GMT format.
- * @return Date.
- */
- public static Date parseTimestamp(String timestamp) {
- SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
- df.setTimeZone(TimeZone.getTimeZone("GMT"));
- try {
- return df.parse(timestamp);
- } catch (ParseException e) {
- if (debugEnabled()) {
- TRACER.debugCaught(DebugLogLevel.WARNING, e);
- }
- return new Date();
- }
- }
-
- /**
- * Returns the output of the process execution.
- * @param p process.
- * @return the output of the process execution.
- * @throws java.io.IOException if a problem occurs.
- */
- public static String commandOutput(Process p) throws IOException {
- Reader r = null;
- Reader err = null;
- try {
- r = new InputStreamReader(p.getInputStream());
- err = new InputStreamReader(p.getErrorStream());
- String output = commandOutput(r);
- String errorMsg = commandOutput(err);
- p.waitFor();
- return output + errorMsg.trim();
- } catch (InterruptedException e) {
- return e.getMessage();
- } finally {
- if (r != null) {
- r.close();
- }
- if (err != null) {
- err.close();
- }
- }
- }
-
- /**
- * Returns the reader content as a String.
- * @param r Reader.
- * @return the Reader content.
- * @throws java.io.IOException if a problem occurs.
- */
- public static String commandOutput(Reader r) throws IOException {
- StringBuilder sb = new StringBuilder();
- int c;
- while ((c = r.read()) > 0) {
- if (c != '\r') {
- sb.append((char) c);
- }
- }
- return sb.toString();
- }
-
- /**
- * Returns this java string as a null-terminated byte array.
- */
- private static byte[] stringToByteArray(String str) {
- return (str + "\u0000").getBytes();
- }
-
- /**
- * Converts a null-terminated byte array to java string.
- */
- private static String byteArrayToString(byte[] array) {
- return new String(array, 0, array.length -1);
- }
-
- /**
- * Gets the stclient path using a well known location from
- * the Windows platform Registry, otherwise it will return null.
- * @return the File representation of the stclient on windows platform.
- */
- public static File getWindowsStClientFile() {
- File out = null;
- String regKey =
- "software\\microsoft\\windows\\currentversion\\app paths\\stclient.exe";
- String keyName = "" ; // use the default key
- String path = getRegistryKey(regKey, keyName);
-
- if (path != null && (new File(path)).exists()) {
- out = new File(path);
- }
- return out;
- }
-
- /**
- * This uses reflection to access a private java windows registry
- * interface, any changes to that Class must be appropriately adjusted.
- * Returns a null if unsuccessful.
- */
- private static String getRegistryKey(String regKey, String keyName) {
- String out = null;
- try {
- Class<?> clazz = Class.forName(
- "java.util.prefs.WindowsPreferences");
-
- // Get the registry methods
- Method winRegOpenKeyM = clazz.getDeclaredMethod(
- "WindowsRegOpenKey",
- int.class, byte[].class, int.class);
- winRegOpenKeyM.setAccessible(true);
-
- Method winRegCloseKeyM = clazz.getDeclaredMethod(
- "WindowsRegCloseKey",
- int.class);
- winRegCloseKeyM.setAccessible(true);
-
- Method winRegQueryValueM = clazz.getDeclaredMethod(
- "WindowsRegQueryValueEx",
- int.class, byte[].class);
- winRegQueryValueM.setAccessible(true);
-
- // Get all the constants we need
- int HKLM = getValueFromStaticField("HKEY_LOCAL_MACHINE", clazz);
- int KEY_READ = getValueFromStaticField("KEY_READ", clazz);
- int ERROR_CODE = getValueFromStaticField("ERROR_CODE", clazz);
- int NATIVE_HANDLE = getValueFromStaticField("NATIVE_HANDLE", clazz);
- int ERROR_SUCCESS = getValueFromStaticField("ERROR_SUCCESS", clazz);
-
- // Convert keys
- byte[] reg = stringToByteArray(regKey);
- byte[] key = stringToByteArray(keyName);
-
- // Open the registry
- int[] result = (int[]) winRegOpenKeyM.invoke(
- null, HKLM, reg, KEY_READ);
-
- if (result[ERROR_CODE] == ERROR_SUCCESS) {
- byte[] stvalue = (byte[]) winRegQueryValueM.invoke(null,
- result[NATIVE_HANDLE], key);
- out = byteArrayToString(stvalue);
- winRegCloseKeyM.invoke(null, result[NATIVE_HANDLE]);
- }
- } catch (Exception ex) {
- }
- return out;
- }
-
- private static int getValueFromStaticField(
- String fldName, Class<?> klass) throws Exception {
- Field f = klass.getDeclaredField(fldName);
- f.setAccessible(true);
- return f.getInt(null);
- }
-}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/servicetag/package-info.java b/opendj-sdk/opends/src/server/org/opends/server/servicetag/package-info.java
deleted file mode 100644
index ba064c5..0000000
--- a/opendj-sdk/opends/src/server/org/opends/server/servicetag/package-info.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2008 Sun Microsystems, Inc.
- */
-
-/**
- * This package manages the common registration of the defined ServiceTags.
- * The ServiceTagRegistration class is the main class and entry point
- * to manage ServiceTags : registration and removal.
- */
-@org.opends.server.types.PublicAPI(
- stability=org.opends.server.types.StabilityLevel.PRIVATE)
-package org.opends.server.servicetag;
-
--
Gitblit v1.10.0