Change error message for node creation action for object already exists. #804
authorzev <zev@radensolutions.com>
Wed, 22 Apr 2015 14:12:58 +0000 (17:12 +0300)
committerzev <zev@radensolutions.com>
Wed, 22 Apr 2015 14:13:04 +0000 (17:13 +0300)
ChangeLog
doc/misc/agent_parameters.ods [new file with mode: 0644]
src/java/client/netxms-client/src/main/java/org/netxms/client/NXCSession.java
src/java/client/netxms-client/src/main/java/org/netxms/client/constants/RCC.java
src/java/client/netxms-client/src/main/resources/messages.properties
src/java/client/netxms-client/src/main/resources/messages_es.properties
src/java/client/netxms-client/src/main/resources/messages_ru.properties
src/server/core/session.cpp

index 9f2edc7..a74dc54 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,7 +15,7 @@
 - Fixed broken PING subagent
 - Fixed database upgrade issues on MS SQL
 - IPv6 support in PING subagent
-- Fixed issues: #655, #657
+- Fixed issues: #655, #657, #804
 
 
 *
diff --git a/doc/misc/agent_parameters.ods b/doc/misc/agent_parameters.ods
new file mode 100644 (file)
index 0000000..d2a87cd
Binary files /dev/null and b/doc/misc/agent_parameters.ods differ
index 6dafb0f..db617be 100644 (file)
@@ -1511,6 +1511,10 @@ public class NXCSession
          {
             throw new NXCException(rcc, msg.getFieldAsString(NXCPCodes.VID_ERROR_TEXT));
          }
+         else if (msg.findField(NXCPCodes.VID_VALUE) != null)
+         {
+            throw new NXCException(rcc, msg.getFieldAsString(NXCPCodes.VID_VALUE));
+         }
          else
          {
             throw new NXCException(rcc);
index ae6f09f..ebe79d4 100644 (file)
@@ -26,6 +26,7 @@ import org.netxms.base.CommonRCC;
 public final class RCC extends CommonRCC
 {
        public static final int INVALID_OBJECT_ID = 7;
+   public static final int CANT_CREATE_OBJECT = 8;
        public static final int DUPLICATE_DCI = 13;
        public static final int INVALID_DCI_ID = 14;
        public static final int OBJECT_CREATION_FAILED = 18;
index 31188d4..7f08a10 100644 (file)
@@ -6,7 +6,7 @@ RCC_0004 = Request timed out
 RCC_0005 = Request is out of state
 RCC_0006 = Database failure
 RCC_0007 = Invalid object ID
-RCC_0008 = Object already exist
+RCC_0008 = Can't add node because of ip conflict between nodes %s
 RCC_0009 = Communication failure
 RCC_0010 = System failure
 RCC_0011 = Invalid user ID
index 9ebb2ed..a96a663 100644 (file)
@@ -7,7 +7,7 @@ RCC_0005 = La petici\u00f3n est\u00e1 fuera de estado
 RCC_0006 = Fallo en la base de datos
 RCC_0007 = ID de objeto inv\u00e1lido
 RCC_0008 = El objeto ya existe
-RCC_0009 = Fallo en la comunicaci\u00f3n
+RCC_0009 = Can't add node because of ip conflict between nodes %s
 RCC_0010 = Fallo del sistema
 RCC_0011 = ID de usuario inv\u00e1lido
 RCC_0012 = Argumento inv\u00e1lido
index b291239..0b1b8fa 100644 (file)
@@ -6,7 +6,7 @@ RCC_0004 = \u041f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u043e \u0432\u0440\u
 RCC_0005 = \u041d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441
 RCC_0006 = \u041e\u0448\u0438\u0431\u043a\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445
 RCC_0007 = \u041d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u0430
-RCC_0008 = \u041e\u0431\u044a\u0435\u043a\u0442 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442
+RCC_0008 = \u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u0437-\u0437\u0430 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0430 IP \u043c\u0435\u0436\u0434\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 %s
 RCC_0009 = \u0421\u0431\u043e\u0439 \u0441\u0432\u044f\u0437\u0438
 RCC_0010 = \u0421\u0431\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b
 RCC_0011 = \u041d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f
index dbc5411..886113a 100644 (file)
@@ -4731,6 +4731,26 @@ void ClientSession::createObject(NXCPMessage *pRequest)
                                                           if (iClass == OBJECT_NODE)
                                                           {
                                   msg.setField(VID_RCC, RCC_ALREADY_EXIST);
+
+                                  //Add to description IP of new created node and name of node with the same IP
+                                  TCHAR value[512];
+                           TCHAR firstAddress[64];
+                           ipAddr.toString(firstAddress);
+                           Node *sameNode = FindNodeByIP(zoneId, ipAddr);
+                           Subnet *sameSubnet = FindSubnetByIP(zoneId, ipAddr);
+                                  if(sameNode != NULL)
+                                  {
+                              _sntprintf(value, 512, _T("%s, %s"), firstAddress, sameNode->getName());
+                                  }
+                                  else if (sameSubnet != NULL)
+                                  {
+                              _sntprintf(value, 512, _T("%s, %s"), firstAddress, sameSubnet->getName());
+                                  }
+                                  else
+                                  {
+                              _tcscpy(value, _T(""));
+                                  }
+                                  msg.setField(VID_VALUE, value);
                                                           }
                                                           else if (iClass == OBJECT_ZONE)
                                                           {