client library now can keep local copy of event templates; log viewer query builder...
authorVictor Kirhenshtein <victor@netxms.org>
Wed, 18 Nov 2009 16:00:14 +0000 (16:00 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Wed, 18 Nov 2009 16:00:14 +0000 (16:00 +0000)
83 files changed:
.gitattributes
src/java/netxms-client/src/main/java/org/netxms/client/GeoLocation.java
src/java/netxms-client/src/main/java/org/netxms/client/NXCObjectCreationData.java
src/java/netxms-client/src/main/java/org/netxms/client/NXCSession.java
src/java/netxms-client/src/main/java/org/netxms/client/internal/jobs/ResyncEventTemplatesThread.java [new file with mode: 0644]
src/java/netxms-client/src/main/java/org/netxms/client/maps/NetworkMapPage.java
src/java/netxms-client/src/main/java/org/netxms/client/objects/AgentPolicy.java [moved from src/java/netxms-client/src/main/java/org/netxms/client/NXCAgentPolicy.java with 78% similarity]
src/java/netxms-client/src/main/java/org/netxms/client/objects/AgentPolicyConfig.java [moved from src/java/netxms-client/src/main/java/org/netxms/client/NXCAgentPolicyConfig.java with 71% similarity]
src/java/netxms-client/src/main/java/org/netxms/client/objects/Container.java [moved from src/java/netxms-client/src/main/java/org/netxms/client/NXCContainer.java with 79% similarity]
src/java/netxms-client/src/main/java/org/netxms/client/objects/EntireNetwork.java [moved from src/java/netxms-client/src/main/java/org/netxms/client/NXCEntireNetwork.java with 62% similarity]
src/java/netxms-client/src/main/java/org/netxms/client/objects/GenericObject.java [moved from src/java/netxms-client/src/main/java/org/netxms/client/NXCObject.java with 92% similarity]
src/java/netxms-client/src/main/java/org/netxms/client/objects/Interface.java [moved from src/java/netxms-client/src/main/java/org/netxms/client/NXCInterface.java with 84% similarity]
src/java/netxms-client/src/main/java/org/netxms/client/objects/Node.java [moved from src/java/netxms-client/src/main/java/org/netxms/client/NXCNode.java with 92% similarity]
src/java/netxms-client/src/main/java/org/netxms/client/objects/PolicyGroup.java [moved from src/java/netxms-client/src/main/java/org/netxms/client/NXCPolicyGroup.java with 64% similarity]
src/java/netxms-client/src/main/java/org/netxms/client/objects/PolicyRoot.java [moved from src/java/netxms-client/src/main/java/org/netxms/client/NXCPolicyRoot.java with 64% similarity]
src/java/netxms-client/src/main/java/org/netxms/client/objects/ServiceRoot.java [moved from src/java/netxms-client/src/main/java/org/netxms/client/NXCServiceRoot.java with 62% similarity]
src/java/netxms-client/src/main/java/org/netxms/client/objects/Subnet.java [moved from src/java/netxms-client/src/main/java/org/netxms/client/NXCSubnet.java with 75% similarity]
src/java/netxms-client/src/main/java/org/netxms/client/objects/Template.java [moved from src/java/netxms-client/src/main/java/org/netxms/client/NXCTemplate.java with 83% similarity]
src/java/netxms-client/src/test/java/org/netxms/client/EventDatabaseSyncTest.java [new file with mode: 0644]
src/java/netxms-client/src/test/java/org/netxms/client/ObjectTest.java
src/java/netxms-eclipse/AlarmViewer/src/org/netxms/ui/eclipse/alarmviewer/AlarmComparator.java
src/java/netxms-eclipse/AlarmViewer/src/org/netxms/ui/eclipse/alarmviewer/AlarmListFilter.java
src/java/netxms-eclipse/AlarmViewer/src/org/netxms/ui/eclipse/alarmviewer/AlarmListLabelProvider.java
src/java/netxms-eclipse/DataCollection/plugin.xml
src/java/netxms-eclipse/DataCollection/src/org/netxms/ui/eclipse/datacollection/DciLabelProvider.java
src/java/netxms-eclipse/DataCollection/src/org/netxms/ui/eclipse/datacollection/actions/OpenEditor.java
src/java/netxms-eclipse/DataCollection/src/org/netxms/ui/eclipse/datacollection/propertypages/General.java
src/java/netxms-eclipse/DataCollection/src/org/netxms/ui/eclipse/datacollection/views/DataCollectionEditor.java
src/java/netxms-eclipse/GoogleMaps/plugin.xml
src/java/netxms-eclipse/GoogleMaps/src/org/netxms/ui/eclipse/googlemaps/actions/OpenLocationMap.java
src/java/netxms-eclipse/LanguagePacks/ru/console/src/org/netxms/ui/eclipse/console/messages_ru.properties
src/java/netxms-eclipse/LogViewer/icons/remove.png [new file with mode: 0644]
src/java/netxms-eclipse/LogViewer/src/org/netxms/ui/eclipse/logviewer/dialogs/QueryBuilder.java
src/java/netxms-eclipse/LogViewer/src/org/netxms/ui/eclipse/logviewer/views/LogViewer.java
src/java/netxms-eclipse/LogViewer/src/org/netxms/ui/eclipse/logviewer/views/helpers/LogLabelProvider.java
src/java/netxms-eclipse/NetworkMaps/plugin.xml
src/java/netxms-eclipse/NetworkMaps/src/org/netxms/ui/eclipse/networkmaps/ObjectFigure.java
src/java/netxms-eclipse/NetworkMaps/src/org/netxms/ui/eclipse/networkmaps/actions/ShowIPNeighbors.java
src/java/netxms-eclipse/NetworkMaps/src/org/netxms/ui/eclipse/networkmaps/views/IPNeighbors.java
src/java/netxms-eclipse/NetworkMaps/src/org/netxms/ui/eclipse/networkmaps/views/NetworkMap.java
src/java/netxms-eclipse/ObjectBrowser/plugin.xml
src/java/netxms-eclipse/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/ObjectAdapterFactory.java
src/java/netxms-eclipse/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/ObjectDecorator.java
src/java/netxms-eclipse/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/dialogs/ObjectSelectionDialog.java
src/java/netxms-eclipse/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/widgets/ObjectSelector.java
src/java/netxms-eclipse/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/widgets/ObjectTree.java
src/java/netxms-eclipse/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/widgets/internal/ObjectListFilter.java
src/java/netxms-eclipse/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/widgets/internal/ObjectTreeComparator.java
src/java/netxms-eclipse/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/widgets/internal/ObjectTreeContentProvider.java
src/java/netxms-eclipse/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/widgets/internal/ObjectTreeFilter.java
src/java/netxms-eclipse/ObjectManager/plugin.xml
src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/TrustedNodesComparator.java
src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/actions/BindObject.java
src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/actions/ChangeIpAddress.java
src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/actions/DeleteObject.java
src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/actions/Manage.java
src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/actions/MultipleObjectAction.java
src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/actions/Unmanage.java
src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/propertypages/AccessControl.java
src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/propertypages/AutoApply.java
src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/propertypages/AutoBind.java
src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/propertypages/Comments.java
src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/propertypages/Communication.java
src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/propertypages/CustomAttributes.java
src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/propertypages/General.java
src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/propertypages/TrustedNodes.java
src/java/netxms-eclipse/ObjectView/plugin.xml
src/java/netxms-eclipse/ObjectView/src/org/netxms/ui/eclipse/objectview/LastValuesView.java
src/java/netxms-eclipse/ObjectView/src/org/netxms/ui/eclipse/objectview/actions/ShowLastValues.java
src/java/netxms-eclipse/ObjectView/src/org/netxms/ui/eclipse/objectview/views/LastValues.java
src/java/netxms-eclipse/PolicyManager/plugin.xml
src/java/netxms-eclipse/PolicyManager/src/org/netxms/ui/eclipse/policymanager/actions/CreateAgentPolicyConfig.java
src/java/netxms-eclipse/PolicyManager/src/org/netxms/ui/eclipse/policymanager/actions/CreatePolicyGroup.java
src/java/netxms-eclipse/PolicyManager/src/org/netxms/ui/eclipse/policymanager/actions/DeployPolicy.java
src/java/netxms-eclipse/PolicyManager/src/org/netxms/ui/eclipse/policymanager/actions/UninstallPolicy.java
src/java/netxms-eclipse/PolicyManager/src/org/netxms/ui/eclipse/policymanager/propertypages/ConfigFile.java
src/java/netxms-eclipse/PolicyManager/src/org/netxms/ui/eclipse/policymanager/propertypages/Policy.java
src/java/netxms-eclipse/ServerJobManager/src/org/netxms/ui/eclipse/serverjobmanager/views/ServerJobManager.java
src/java/netxms-eclipse/UserManager/src/org/netxms/ui/eclipse/usermanager/views/UserManager.java
src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/LoginJob.java
src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/messages.properties
src/java/netxms-eclipse/library/META-INF/MANIFEST.MF
src/java/netxms-eclipse/library/src/org/netxms/ui/eclipse/tools/WidgetHelper.java

index 7120f22..9faff52 100644 (file)
@@ -225,27 +225,15 @@ src/java/netxms-base/src/test/java/org/netxms/base/NXCPVariableTest.java -text
 src/java/netxms-client/pom.xml -text
 src/java/netxms-client/src/main/java/org/netxms/client/GeoLocation.java -text
 src/java/netxms-client/src/main/java/org/netxms/client/NXCAccessListElement.java -text
-src/java/netxms-client/src/main/java/org/netxms/client/NXCAgentPolicy.java -text
-src/java/netxms-client/src/main/java/org/netxms/client/NXCAgentPolicyConfig.java -text
-src/java/netxms-client/src/main/java/org/netxms/client/NXCContainer.java -text
-src/java/netxms-client/src/main/java/org/netxms/client/NXCEntireNetwork.java -text
 src/java/netxms-client/src/main/java/org/netxms/client/NXCException.java -text
-src/java/netxms-client/src/main/java/org/netxms/client/NXCInterface.java -text
 src/java/netxms-client/src/main/java/org/netxms/client/NXCListener.java -text
-src/java/netxms-client/src/main/java/org/netxms/client/NXCNode.java -text
 src/java/netxms-client/src/main/java/org/netxms/client/NXCNotification.java -text
-src/java/netxms-client/src/main/java/org/netxms/client/NXCObject.java -text
 src/java/netxms-client/src/main/java/org/netxms/client/NXCObjectCreationData.java -text
 src/java/netxms-client/src/main/java/org/netxms/client/NXCObjectModificationData.java -text
-src/java/netxms-client/src/main/java/org/netxms/client/NXCPolicyGroup.java -text
-src/java/netxms-client/src/main/java/org/netxms/client/NXCPolicyRoot.java -text
 src/java/netxms-client/src/main/java/org/netxms/client/NXCReceivedFile.java -text
 src/java/netxms-client/src/main/java/org/netxms/client/NXCServerJob.java -text
 src/java/netxms-client/src/main/java/org/netxms/client/NXCServerVariable.java -text
-src/java/netxms-client/src/main/java/org/netxms/client/NXCServiceRoot.java -text
 src/java/netxms-client/src/main/java/org/netxms/client/NXCSession.java -text
-src/java/netxms-client/src/main/java/org/netxms/client/NXCSubnet.java -text
-src/java/netxms-client/src/main/java/org/netxms/client/NXCTemplate.java -text
 src/java/netxms-client/src/main/java/org/netxms/client/NXCUser.java -text
 src/java/netxms-client/src/main/java/org/netxms/client/NXCUserDBObject.java -text
 src/java/netxms-client/src/main/java/org/netxms/client/NXCUserGroup.java -text
@@ -263,6 +251,7 @@ src/java/netxms-client/src/main/java/org/netxms/client/events/Alarm.java -text
 src/java/netxms-client/src/main/java/org/netxms/client/events/EventProcessingPolicy.java -text
 src/java/netxms-client/src/main/java/org/netxms/client/events/EventProcessingPolicyRule.java -text
 src/java/netxms-client/src/main/java/org/netxms/client/events/EventTemplate.java -text
+src/java/netxms-client/src/main/java/org/netxms/client/internal/jobs/ResyncEventTemplatesThread.java -text
 src/java/netxms-client/src/main/java/org/netxms/client/log/ColumnFilter.java -text
 src/java/netxms-client/src/main/java/org/netxms/client/log/Log.java -text
 src/java/netxms-client/src/main/java/org/netxms/client/log/LogColumn.java -text
@@ -271,9 +260,22 @@ src/java/netxms-client/src/main/java/org/netxms/client/log/OrderingColumn.java -
 src/java/netxms-client/src/main/java/org/netxms/client/maps/NetworkMapObjectData.java -text
 src/java/netxms-client/src/main/java/org/netxms/client/maps/NetworkMapObjectLink.java -text
 src/java/netxms-client/src/main/java/org/netxms/client/maps/NetworkMapPage.java -text
+src/java/netxms-client/src/main/java/org/netxms/client/objects/AgentPolicy.java -text
+src/java/netxms-client/src/main/java/org/netxms/client/objects/AgentPolicyConfig.java -text
+src/java/netxms-client/src/main/java/org/netxms/client/objects/Container.java -text
+src/java/netxms-client/src/main/java/org/netxms/client/objects/EntireNetwork.java -text
+src/java/netxms-client/src/main/java/org/netxms/client/objects/GenericObject.java -text
+src/java/netxms-client/src/main/java/org/netxms/client/objects/Interface.java -text
+src/java/netxms-client/src/main/java/org/netxms/client/objects/Node.java -text
+src/java/netxms-client/src/main/java/org/netxms/client/objects/PolicyGroup.java -text
+src/java/netxms-client/src/main/java/org/netxms/client/objects/PolicyRoot.java -text
+src/java/netxms-client/src/main/java/org/netxms/client/objects/ServiceRoot.java -text
+src/java/netxms-client/src/main/java/org/netxms/client/objects/Subnet.java -text
+src/java/netxms-client/src/main/java/org/netxms/client/objects/Template.java -text
 src/java/netxms-client/src/test/java/org/netxms/client/AlarmTest.java -text
 src/java/netxms-client/src/test/java/org/netxms/client/ConnectionTest.java -text
 src/java/netxms-client/src/test/java/org/netxms/client/DataCollectionTest.java -text
+src/java/netxms-client/src/test/java/org/netxms/client/EventDatabaseSyncTest.java -text
 src/java/netxms-client/src/test/java/org/netxms/client/JobTest.java -text
 src/java/netxms-client/src/test/java/org/netxms/client/LogTest.java -text
 src/java/netxms-client/src/test/java/org/netxms/client/ObjectTest.java -text
@@ -383,6 +385,7 @@ src/java/netxms-eclipse/LogViewer/icons/last_page.png -text
 src/java/netxms-eclipse/LogViewer/icons/log_viewer_job.png -text
 src/java/netxms-eclipse/LogViewer/icons/next_page.png -text
 src/java/netxms-eclipse/LogViewer/icons/prev_page.png -text
+src/java/netxms-eclipse/LogViewer/icons/remove.png -text
 src/java/netxms-eclipse/LogViewer/plugin.xml -text
 src/java/netxms-eclipse/LogViewer/src/org/netxms/ui/eclipse/logviewer/Activator.java -text
 src/java/netxms-eclipse/LogViewer/src/org/netxms/ui/eclipse/logviewer/Messages.java -text
index 594c141..ab99d08 100644 (file)
@@ -39,7 +39,7 @@ public class GeoLocation
         * Create geolocation object from NXCP message\r
         * @param msg NXCP message\r
         */\r
-       protected GeoLocation(final NXCPMessage msg)\r
+       public GeoLocation(final NXCPMessage msg)\r
        {\r
                type = msg.getVariableAsInteger(NXCPCodes.VID_GEOLOCATION_TYPE);\r
                latitude = msg.getVariableAsReal(NXCPCodes.VID_LATITUDE);\r
index 92023b8..aba333f 100644 (file)
@@ -6,6 +6,8 @@ package org.netxms.client;
 import java.net.InetAddress;\r
 import java.net.UnknownHostException;\r
 \r
+import org.netxms.client.objects.GenericObject;\r
+\r
 /**\r
  * @author Victor\r
  *\r
@@ -32,7 +34,7 @@ public class NXCObjectCreationData
         * Constructor.\r
         * \r
         * @param objectClass Class of new object (one of NXCObject.OBJECT_xxx constants)\r
-        * @see NXCObject\r
+        * @see GenericObject\r
         * @param name Name of new object\r
         * @param parentId Parent object ID\r
         */\r
index ff3ac6b..b87ff05 100644 (file)
@@ -55,10 +55,23 @@ import org.netxms.client.events.EventProcessingPolicy;
 import org.netxms.client.events.EventProcessingPolicyRule;\r
 import org.netxms.client.events.EventTemplate;\r
 import org.netxms.client.events.Alarm;\r
+import org.netxms.client.internal.jobs.ResyncEventTemplatesThread;\r
 import org.netxms.client.log.Log;\r
 import org.netxms.client.maps.NetworkMapObjectData;\r
 import org.netxms.client.maps.NetworkMapObjectLink;\r
 import org.netxms.client.maps.NetworkMapPage;\r
+import org.netxms.client.objects.AgentPolicy;\r
+import org.netxms.client.objects.AgentPolicyConfig;\r
+import org.netxms.client.objects.Container;\r
+import org.netxms.client.objects.EntireNetwork;\r
+import org.netxms.client.objects.Interface;\r
+import org.netxms.client.objects.Node;\r
+import org.netxms.client.objects.GenericObject;\r
+import org.netxms.client.objects.PolicyGroup;\r
+import org.netxms.client.objects.PolicyRoot;\r
+import org.netxms.client.objects.ServiceRoot;\r
+import org.netxms.client.objects.Subnet;\r
+import org.netxms.client.objects.Template;\r
 \r
 /**\r
  * @author victor\r
@@ -140,10 +153,14 @@ public class NXCSession
        private byte[] serverChallenge = new byte[CLIENT_CHALLENGE_SIZE];\r
 \r
        // Objects\r
-       private Map<Long, NXCObject> objectList = new HashMap<Long, NXCObject>();\r
+       private Map<Long, GenericObject> objectList = new HashMap<Long, GenericObject>();\r
 \r
        // Users\r
        private Map<Long, NXCUserDBObject> userDB = new HashMap<Long, NXCUserDBObject>();\r
+       \r
+       // Event templates\r
+       private Map<Long, EventTemplate> eventTemplates = new HashMap<Long, EventTemplate>();\r
+       private boolean eventTemplatesNeedSync = false;\r
 \r
        /**\r
         * Create object from message\r
@@ -152,48 +169,48 @@ public class NXCSession
         *           Source NXCP message\r
         * @return NetXMS object\r
         */\r
-       private NXCObject createObjectFromMessage(NXCPMessage msg)\r
+       private GenericObject createObjectFromMessage(NXCPMessage msg)\r
        {\r
                final int objectClass = msg.getVariableAsInteger(NXCPCodes.VID_OBJECT_CLASS);\r
-               NXCObject object;\r
+               GenericObject object;\r
 \r
                switch(objectClass)\r
                {\r
-                       case NXCObject.OBJECT_INTERFACE:\r
-                               object = new NXCInterface(msg, this);\r
+                       case GenericObject.OBJECT_INTERFACE:\r
+                               object = new Interface(msg, this);\r
                                break;\r
-                       case NXCObject.OBJECT_SUBNET:\r
-                               object = new NXCSubnet(msg, this);\r
+                       case GenericObject.OBJECT_SUBNET:\r
+                               object = new Subnet(msg, this);\r
                                break;\r
-                       case NXCObject.OBJECT_CONTAINER:\r
-                               object = new NXCContainer(msg, this);\r
+                       case GenericObject.OBJECT_CONTAINER:\r
+                               object = new Container(msg, this);\r
                                break;\r
-                       case NXCObject.OBJECT_NODE:\r
-                               object = new NXCNode(msg, this);\r
+                       case GenericObject.OBJECT_NODE:\r
+                               object = new Node(msg, this);\r
                                break;\r
-                       case NXCObject.OBJECT_TEMPLATE:\r
-                               object = new NXCTemplate(msg, this);\r
+                       case GenericObject.OBJECT_TEMPLATE:\r
+                               object = new Template(msg, this);\r
                                break;\r
-                       case NXCObject.OBJECT_NETWORK:\r
-                               object = new NXCEntireNetwork(msg, this);\r
+                       case GenericObject.OBJECT_NETWORK:\r
+                               object = new EntireNetwork(msg, this);\r
                                break;\r
-                       case NXCObject.OBJECT_SERVICEROOT:\r
-                               object = new NXCServiceRoot(msg, this);\r
+                       case GenericObject.OBJECT_SERVICEROOT:\r
+                               object = new ServiceRoot(msg, this);\r
                                break;\r
-                       case NXCObject.OBJECT_POLICYROOT:\r
-                               object = new NXCPolicyRoot(msg, this);\r
+                       case GenericObject.OBJECT_POLICYROOT:\r
+                               object = new PolicyRoot(msg, this);\r
                                break;\r
-                       case NXCObject.OBJECT_POLICYGROUP:\r
-                               object = new NXCPolicyGroup(msg, this);\r
+                       case GenericObject.OBJECT_POLICYGROUP:\r
+                               object = new PolicyGroup(msg, this);\r
                                break;\r
-                       case NXCObject.OBJECT_AGENTPOLICY:\r
-                               object = new NXCAgentPolicy(msg, this);\r
+                       case GenericObject.OBJECT_AGENTPOLICY:\r
+                               object = new AgentPolicy(msg, this);\r
                                break;\r
-                       case NXCObject.OBJECT_AGENTPOLICY_CONFIG:\r
-                               object = new NXCAgentPolicyConfig(msg, this);\r
+                       case GenericObject.OBJECT_AGENTPOLICY_CONFIG:\r
+                               object = new AgentPolicyConfig(msg, this);\r
                                break;\r
                        default:\r
-                               object = new NXCObject(msg, this);\r
+                               object = new GenericObject(msg, this);\r
                                break;\r
                }\r
 \r
@@ -237,7 +254,7 @@ public class NXCSession
                                        {\r
                                                case NXCPCodes.CMD_OBJECT:\r
                                                case NXCPCodes.CMD_OBJECT_UPDATE:\r
-                                                       final NXCObject obj = createObjectFromMessage(msg);\r
+                                                       final GenericObject obj = createObjectFromMessage(msg);\r
                                                        synchronized(objectList)\r
                                                        {\r
                                                                if (obj.isDeleted())\r
@@ -287,6 +304,9 @@ public class NXCSession
                                                case NXCPCodes.CMD_FILE_DATA:\r
                                                        processFileData(msg);\r
                                                        break;\r
+                                               case NXCPCodes.CMD_NOTIFY:\r
+                                                       processNotificationMessage(msg);\r
+                                                       break;\r
                                                default:\r
                                                        if (msg.getMessageCode() >= 0x1000)\r
                                                        {\r
@@ -306,13 +326,39 @@ public class NXCSession
                                }\r
                        }\r
                }\r
+               \r
+               /**\r
+                * Process CMD_NOTIFY message\r
+                * \r
+                * @param msg NXCP message\r
+                */\r
+               private void processNotificationMessage(final NXCPMessage msg)\r
+               {\r
+                       int code = msg.getVariableAsInteger(NXCPCodes.VID_NOTIFICATION_CODE) + NXCNotification.NOTIFY_BASE;\r
+                       int data = msg.getVariableAsInteger(NXCPCodes.VID_NOTIFICATION_DATA);\r
+                       \r
+                       NXCNotification n;\r
+                       switch(code)\r
+                       {\r
+                               case NXCNotification.EVENT_DB_CHANGED:\r
+                                       if (eventTemplatesNeedSync)\r
+                                               new ResyncEventTemplatesThread(NXCSession.this);\r
+                                       n = new NXCNotification(code);\r
+                                       break;\r
+                               default:\r
+                                       n = new NXCNotification(code, data);\r
+                                       break;\r
+                       }\r
+                       \r
+                       sendNotification(n);\r
+               }\r
 \r
                /**\r
                 * Process file data\r
                 * \r
                 * @param msg\r
                 */\r
-               private void processFileData(NXCPMessage msg)\r
+               private void processFileData(final NXCPMessage msg)\r
                {\r
                        long id = msg.getMessageId();\r
                        NXCReceivedFile file;\r
@@ -1010,9 +1056,9 @@ public class NXCSession
         *           Object identifier\r
         * @return Object with given ID or null if object cannot be found\r
         */\r
-       public NXCObject findObjectById(final long id)\r
+       public GenericObject findObjectById(final long id)\r
        {\r
-               NXCObject obj;\r
+               GenericObject obj;\r
 \r
                synchronized(objectList)\r
                {\r
@@ -1028,21 +1074,21 @@ public class NXCSession
         *           array of object identifiers\r
         * @return array of found objects\r
         */\r
-       public NXCObject[] findMultipleObjects(final long[] idList)\r
+       public GenericObject[] findMultipleObjects(final long[] idList)\r
        {\r
-               ArrayList<NXCObject> result = new ArrayList<NXCObject>(idList.length);\r
+               ArrayList<GenericObject> result = new ArrayList<GenericObject>(idList.length);\r
 \r
                synchronized(objectList)\r
                {\r
                        for(int i = 0; i < idList.length; i++)\r
                        {\r
-                               final NXCObject object = objectList.get(idList[i]);\r
+                               final GenericObject object = objectList.get(idList[i]);\r
                                if (object != null)\r
                                        result.add(object);\r
                        }\r
                }\r
 \r
-               return result.toArray(new NXCObject[result.size()]);\r
+               return result.toArray(new GenericObject[result.size()]);\r
        }\r
 \r
        /**\r
@@ -1050,12 +1096,12 @@ public class NXCSession
         * \r
         * @return List of all top level objects (either without parents or with inaccessible parents)\r
         */\r
-       public NXCObject[] getTopLevelObjects()\r
+       public GenericObject[] getTopLevelObjects()\r
        {\r
-               HashSet<NXCObject> list = new HashSet<NXCObject>();\r
+               HashSet<GenericObject> list = new HashSet<GenericObject>();\r
                synchronized(objectList)\r
                {\r
-                       for(NXCObject object : objectList.values())\r
+                       for(GenericObject object : objectList.values())\r
                        {\r
                                if (object.getNumberOfParents() == 0)\r
                                {\r
@@ -1079,7 +1125,7 @@ public class NXCSession
                                }\r
                        }\r
                }\r
-               return list.toArray(new NXCObject[list.size()]);\r
+               return list.toArray(new GenericObject[list.size()]);\r
        }\r
 \r
        /**\r
@@ -1087,13 +1133,13 @@ public class NXCSession
         * \r
         * @return List of all objects\r
         */\r
-       public NXCObject[] getAllObjects()\r
+       public GenericObject[] getAllObjects()\r
        {\r
-               NXCObject[] list;\r
+               GenericObject[] list;\r
 \r
                synchronized(objectList)\r
                {\r
-                       list = objectList.values().toArray(new NXCObject[objectList.size()]);\r
+                       list = objectList.values().toArray(new GenericObject[objectList.size()]);\r
                }\r
                return list;\r
        }\r
@@ -1332,7 +1378,7 @@ public class NXCSession
                sendMessage(msg);\r
                waitForRCC(msg.getMessageId());\r
        }\r
-\r
+       \r
        /**\r
         * Synchronize user database\r
         * \r
@@ -1777,7 +1823,7 @@ public class NXCSession
                // Class-specific attributes\r
                switch(data.getObjectClass())\r
                {\r
-                       case NXCObject.OBJECT_NODE:\r
+                       case GenericObject.OBJECT_NODE:\r
                                msg.setVariable(NXCPCodes.VID_IP_ADDRESS, data.getIpAddress());\r
                                msg.setVariable(NXCPCodes.VID_IP_NETMASK, data.getIpNetMask());\r
                                msg.setVariableInt32(NXCPCodes.VID_CREATION_FLAGS, data.getCreationFlags());\r
@@ -2327,8 +2373,46 @@ public class NXCSession
                Log log = new Log(this, response);\r
                return log;\r
        }\r
+\r
+       /**\r
+        * Synchronize event templates configuration. After call to this method session object\r
+        * will maintain internal list of configured event templates.\r
+        * \r
+        * @throws IOException if socket I/O error occurs\r
+        * @throws NXCException if NetXMS server returns an error or operation was timed out\r
+        */\r
+       public void syncEventTemplates() throws IOException, NXCException\r
+       {\r
+               List<EventTemplate> templates = getEventTemplates();\r
+               synchronized(eventTemplates)\r
+               {\r
+                       eventTemplates.clear();\r
+                       for(EventTemplate t : templates)\r
+                       {\r
+                               eventTemplates.put(t.getCode(), t);\r
+                       }\r
+                       eventTemplatesNeedSync = true;\r
+               }\r
+       }\r
        \r
        /**\r
+        * Find event template by code in event template database internally maintained by session object.\r
+        * You must call NXCSession.syncEventTemplates() first to make local copy of event template database.\r
+        * \r
+        * @param code Event code\r
+        * @return Event template object or null if not found\r
+        */\r
+       public EventTemplate findEventTemplateByCode(long code)\r
+       {\r
+               EventTemplate e = null;\r
+               synchronized(eventTemplates)\r
+               {\r
+                       e = eventTemplates.get(code);\r
+               }\r
+               return e;\r
+       }\r
+\r
+       /**\r
         * Get event templates from server\r
         * \r
         * @return List of configured event templates\r
diff --git a/src/java/netxms-client/src/main/java/org/netxms/client/internal/jobs/ResyncEventTemplatesThread.java b/src/java/netxms-client/src/main/java/org/netxms/client/internal/jobs/ResyncEventTemplatesThread.java
new file mode 100644 (file)
index 0000000..0f1dd96
--- /dev/null
@@ -0,0 +1,38 @@
+/**\r
+ * \r
+ */\r
+package org.netxms.client.internal.jobs;\r
+\r
+import org.netxms.client.NXCSession;\r
+\r
+/**\r
+ * @author victor\r
+ *\r
+ */\r
+public class ResyncEventTemplatesThread extends Thread\r
+{\r
+       private NXCSession session;\r
+       \r
+       public ResyncEventTemplatesThread(final NXCSession session)\r
+       {\r
+               this.session = session;\r
+               setDaemon(true);\r
+               start();\r
+       }\r
+\r
+       /* (non-Javadoc)\r
+        * @see java.lang.Thread#run()\r
+        */\r
+       @Override\r
+       public void run()\r
+       {\r
+               try\r
+               {\r
+                       session.syncEventTemplates();\r
+               }\r
+               catch(Exception e)\r
+               {\r
+                       /* TODO: add logger output */\r
+               }\r
+       }\r
+}\r
index ccbd523..67f55e8 100644 (file)
@@ -22,8 +22,8 @@ import java.util.HashSet;
 import java.util.Iterator;\r
 import java.util.Set;\r
 \r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.NXCSession;\r
+import org.netxms.client.objects.GenericObject;\r
 \r
 /**\r
  * Represents single map page (submap)\r
@@ -132,9 +132,9 @@ public class NetworkMapPage
         * @param session Client session which should be used for object lookup\r
         * @return NetXMS objects\r
         */\r
-       public NXCObject[] getResolvedObjects(NXCSession session)\r
+       public GenericObject[] getResolvedObjects(NXCSession session)\r
        {\r
-               NXCObject[] list = new NXCObject[objects.size()];\r
+               GenericObject[] list = new GenericObject[objects.size()];\r
                \r
                Iterator<NetworkMapObjectData> it = objects.iterator();\r
                for(int i = 0; it.hasNext(); i++)\r
@@ -153,9 +153,9 @@ public class NetworkMapPage
         * @param session Client session which should be used for object lookup\r
         * @return All objects connected to given object\r
         */\r
-       public NXCObject[] getConnectedObjects(long root, NXCSession session)\r
+       public GenericObject[] getConnectedObjects(long root, NXCSession session)\r
        {\r
-               Set<NXCObject> result = new HashSet<NXCObject>(0);\r
+               Set<GenericObject> result = new HashSet<GenericObject>(0);\r
                \r
                Iterator<NetworkMapObjectLink> it = links.iterator();\r
                while(it.hasNext())\r
@@ -164,18 +164,18 @@ public class NetworkMapPage
                        if (link.getObject1() == root)\r
                        {\r
                                long id = link.getObject2();\r
-                               NXCObject object = session.findObjectById(id);\r
+                               GenericObject object = session.findObjectById(id);\r
                                if (object != null)\r
                                        result.add(object);\r
                        }\r
                        else if (link.getObject1() == root)\r
                        {\r
                                long id = link.getObject1();\r
-                               NXCObject object = session.findObjectById(id);\r
+                               GenericObject object = session.findObjectById(id);\r
                                if (object != null)\r
                                        result.add(object);\r
                        }\r
                }\r
-               return result.toArray(new NXCObject[result.size()]);\r
+               return result.toArray(new GenericObject[result.size()]);\r
        }\r
 }\r
@@ -1,16 +1,17 @@
 /**\r
  * \r
  */\r
-package org.netxms.client;\r
+package org.netxms.client.objects;\r
 \r
 import org.netxms.base.NXCPCodes;\r
 import org.netxms.base.NXCPMessage;\r
+import org.netxms.client.NXCSession;\r
 \r
 /**\r
  * @author Victor\r
  *\r
  */\r
-public class NXCAgentPolicy extends NXCObject\r
+public class AgentPolicy extends GenericObject\r
 {\r
        private int version;\r
        private int policyType;\r
@@ -20,7 +21,7 @@ public class NXCAgentPolicy extends NXCObject
         * @param msg\r
         * @param session\r
         */\r
-       public NXCAgentPolicy(NXCPMessage msg, NXCSession session)\r
+       public AgentPolicy(NXCPMessage msg, NXCSession session)\r
        {\r
                super(msg, session);\r
                \r
@@ -1,16 +1,17 @@
 /**\r
  * \r
  */\r
-package org.netxms.client;\r
+package org.netxms.client.objects;\r
 \r
 import org.netxms.base.NXCPCodes;\r
 import org.netxms.base.NXCPMessage;\r
+import org.netxms.client.NXCSession;\r
 \r
 /**\r
  * @author Victor\r
  *\r
  */\r
-public class NXCAgentPolicyConfig extends NXCAgentPolicy\r
+public class AgentPolicyConfig extends AgentPolicy\r
 {\r
        private String fileName;\r
        private String fileContent;\r
@@ -19,7 +20,7 @@ public class NXCAgentPolicyConfig extends NXCAgentPolicy
         * @param msg\r
         * @param session\r
         */\r
-       public NXCAgentPolicyConfig(NXCPMessage msg, NXCSession session)\r
+       public AgentPolicyConfig(NXCPMessage msg, NXCSession session)\r
        {\r
                super(msg, session);\r
                fileName = msg.getVariableAsString(NXCPCodes.VID_CONFIG_FILE_NAME);\r
@@ -1,15 +1,16 @@
 /**\r
  * \r
  */\r
-package org.netxms.client;\r
+package org.netxms.client.objects;\r
 \r
 import org.netxms.base.*;\r
+import org.netxms.client.NXCSession;\r
 \r
 /**\r
  * @author Victor\r
  *\r
  */\r
-public class NXCContainer extends NXCObject\r
+public class Container extends GenericObject\r
 {\r
        private int category;\r
        private boolean autoBindEnabled;\r
@@ -18,7 +19,7 @@ public class NXCContainer extends NXCObject
        /**\r
         * @param msg\r
         */\r
-       public NXCContainer(NXCPMessage msg, NXCSession session)\r
+       public Container(NXCPMessage msg, NXCSession session)\r
        {\r
                super(msg, session);\r
                category = msg.getVariableAsInteger(NXCPCodes.VID_CATEGORY);\r
@@ -1,21 +1,22 @@
 /**\r
  * \r
  */\r
-package org.netxms.client;\r
+package org.netxms.client.objects;\r
 \r
 import org.netxms.base.NXCPMessage;\r
+import org.netxms.client.NXCSession;\r
 \r
 /**\r
  * @author Victor\r
  *\r
  */\r
-public class NXCEntireNetwork extends NXCObject\r
+public class EntireNetwork extends GenericObject\r
 {\r
        /**\r
         * @param msg Message to create object from\r
         * @param session Associated client session\r
         */\r
-       public NXCEntireNetwork(final NXCPMessage msg, final NXCSession session)\r
+       public EntireNetwork(final NXCPMessage msg, final NXCSession session)\r
        {\r
                super(msg, session);\r
        }\r
@@ -2,7 +2,7 @@
  * Generic NetXMS object class 
  */
 
-package org.netxms.client;
+package org.netxms.client.objects;
 
 import java.util.Arrays;
 import java.util.Map;
@@ -11,8 +11,11 @@ import java.util.HashSet;
 import java.util.Iterator;
 import java.net.InetAddress;
 import org.netxms.base.*;
+import org.netxms.client.GeoLocation;
+import org.netxms.client.NXCAccessListElement;
+import org.netxms.client.NXCSession;
 
-public class NXCObject
+public class GenericObject
 {
        // Object classes
        public static final int OBJECT_GENERIC            = 0;
@@ -73,7 +76,7 @@ public class NXCObject
         * @param session Associated client session
         */
        
-       NXCObject(final NXCPMessage msg, final NXCSession session)
+       public GenericObject(final NXCPMessage msg, final NXCSession session)
        {
                int i, count;
                long id, id2;
@@ -241,7 +244,7 @@ public class NXCObject
                                        rc = true;
                                        break;
                                }
-                               NXCObject object = session.findObjectById(id);
+                               GenericObject object = session.findObjectById(id);
                                if (object != null)
                                {
                                        if (object.isChildOf(objectId))
@@ -296,12 +299,12 @@ public class NXCObject
        /**
         * @return List of parent objects
         */
-       public NXCObject[] getParentsAsArray()
+       public GenericObject[] getParentsAsArray()
        {
-               final NXCObject[] list;
+               final GenericObject[] list;
                synchronized(parents)
                {
-                       list = new NXCObject[parents.size()];
+                       list = new GenericObject[parents.size()];
                        final Iterator<Long> it = parents.iterator();
                        for(int i = 0; it.hasNext(); i++)
                        {
@@ -314,12 +317,12 @@ public class NXCObject
        /**
         * @return List of child objects
         */
-       public NXCObject[] getChildsAsArray()
+       public GenericObject[] getChildsAsArray()
        {
-               final NXCObject[] list;
+               final GenericObject[] list;
                synchronized(childs)
                {
-                       list = new NXCObject[childs.size()];
+                       list = new GenericObject[childs.size()];
                        final Iterator<Long> it = childs.iterator();
                        for(int i = 0; it.hasNext(); i++)
                        {
@@ -332,12 +335,12 @@ public class NXCObject
        /**
         * @return List of trusted nodes
         */
-       public NXCObject[] getTrustedNodes()
+       public GenericObject[] getTrustedNodes()
        {
-               final NXCObject[] list;
+               final GenericObject[] list;
                synchronized(trustedNodes)
                {
-                       list = new NXCObject[trustedNodes.size()];
+                       list = new GenericObject[trustedNodes.size()];
                        final Iterator<Long> it = trustedNodes.iterator();
                        for(int i = 0; it.hasNext(); i++)
                        {
@@ -1,16 +1,17 @@
 /**\r
  *  NetXMS network interface object representation\r
  */\r
-package org.netxms.client;\r
+package org.netxms.client.objects;\r
 \r
 import java.net.InetAddress;\r
 import org.netxms.base.*;\r
+import org.netxms.client.NXCSession;\r
 \r
 /**\r
  * @author Victor\r
  *\r
  */\r
-public class NXCInterface extends NXCObject\r
+public class Interface extends GenericObject\r
 {\r
        private InetAddress subnetMask;\r
        private int ifIndex;\r
@@ -21,7 +22,7 @@ public class NXCInterface extends NXCObject
        /**\r
         * @param msg\r
         */\r
-       public NXCInterface(NXCPMessage msg, NXCSession session)\r
+       public Interface(NXCPMessage msg, NXCSession session)\r
        {\r
                super(msg, session);\r
                \r
@@ -1,9 +1,10 @@
 /**\r
  * \r
  */\r
-package org.netxms.client;\r
+package org.netxms.client.objects;\r
 \r
 import org.netxms.base.*;\r
+import org.netxms.client.NXCSession;\r
 \r
 /**\r
  * This class represents NetXMS NODE objects.\r
@@ -11,7 +12,7 @@ import org.netxms.base.*;
  * @author Victor\r
  *\r
  */\r
-public class NXCNode extends NXCObject\r
+public class Node extends GenericObject\r
 {\r
        public static final int SNMP_VERSION_1 = 0;\r
        public static final int SNMP_VERSION_2C = 1;\r
@@ -45,7 +46,7 @@ public class NXCNode extends NXCObject
        /**\r
         * @param msg\r
         */\r
-       public NXCNode(NXCPMessage msg, NXCSession session)\r
+       public Node(NXCPMessage msg, NXCSession session)\r
        {\r
                super(msg, session);\r
 \r
@@ -1,21 +1,22 @@
 /**\r
  * \r
  */\r
-package org.netxms.client;\r
+package org.netxms.client.objects;\r
 \r
 import org.netxms.base.NXCPMessage;\r
+import org.netxms.client.NXCSession;\r
 \r
 /**\r
  * @author Victor\r
  *\r
  */\r
-public class NXCPolicyGroup extends NXCObject\r
+public class PolicyGroup extends GenericObject\r
 {\r
        /**\r
         * @param msg Message to create object from\r
         * @param session Associated client session\r
         */\r
-       public NXCPolicyGroup(NXCPMessage msg, NXCSession session)\r
+       public PolicyGroup(NXCPMessage msg, NXCSession session)\r
        {\r
                super(msg, session);\r
        }\r
@@ -1,21 +1,22 @@
 /**\r
  * \r
  */\r
-package org.netxms.client;\r
+package org.netxms.client.objects;\r
 \r
 import org.netxms.base.NXCPMessage;\r
+import org.netxms.client.NXCSession;\r
 \r
 /**\r
  * @author Victor\r
  *\r
  */\r
-public class NXCPolicyRoot extends NXCObject\r
+public class PolicyRoot extends GenericObject\r
 {\r
        /**\r
         * @param msg Message to create object from\r
         * @param session Associated client session\r
         */\r
-       public NXCPolicyRoot(NXCPMessage msg, NXCSession session)\r
+       public PolicyRoot(NXCPMessage msg, NXCSession session)\r
        {\r
                super(msg, session);\r
        }\r
@@ -1,21 +1,22 @@
 /**\r
  * \r
  */\r
-package org.netxms.client;\r
+package org.netxms.client.objects;\r
 \r
 import org.netxms.base.NXCPMessage;\r
+import org.netxms.client.NXCSession;\r
 \r
 /**\r
  * @author Victor\r
  *\r
  */\r
-public class NXCServiceRoot extends NXCObject\r
+public class ServiceRoot extends GenericObject\r
 {\r
        /**\r
         * @param msg Message to create object from\r
         * @param session Associated client session\r
         */\r
-       public NXCServiceRoot(final NXCPMessage msg, final NXCSession session)\r
+       public ServiceRoot(final NXCPMessage msg, final NXCSession session)\r
        {\r
                super(msg, session);\r
        }\r
@@ -1,24 +1,25 @@
 /**
  * 
  */
-package org.netxms.client;
+package org.netxms.client.objects;
 
 import java.net.InetAddress;
 import org.netxms.base.*;
+import org.netxms.client.NXCSession;
 
 
 /**
  * @author victor
  *
  */
-public class NXCSubnet extends NXCObject
+public class Subnet extends GenericObject
 {
        private InetAddress subnetMask;
 
        /**
         * @param msg
         */
-       public NXCSubnet(NXCPMessage msg, NXCSession session)
+       public Subnet(NXCPMessage msg, NXCSession session)
        {
                super(msg, session);
                
@@ -1,10 +1,11 @@
 /**\r
  * \r
  */\r
-package org.netxms.client;\r
+package org.netxms.client.objects;\r
 \r
 import org.netxms.base.NXCPCodes;\r
 import org.netxms.base.NXCPMessage;\r
+import org.netxms.client.NXCSession;\r
 \r
 /**\r
  * This class represents NetXMS TEMPLATE objects.\r
@@ -12,7 +13,7 @@ import org.netxms.base.NXCPMessage;
  * @author Victor\r
  *\r
  */\r
-public class NXCTemplate extends NXCObject\r
+public class Template extends GenericObject\r
 {\r
        private int version;\r
        private boolean autoApplyEnabled;\r
@@ -22,7 +23,7 @@ public class NXCTemplate extends NXCObject
         * @param msg\r
         * @param session\r
         */\r
-       public NXCTemplate(NXCPMessage msg, NXCSession session)\r
+       public Template(NXCPMessage msg, NXCSession session)\r
        {\r
                super(msg, session);\r
                \r
diff --git a/src/java/netxms-client/src/test/java/org/netxms/client/EventDatabaseSyncTest.java b/src/java/netxms-client/src/test/java/org/netxms/client/EventDatabaseSyncTest.java
new file mode 100644 (file)
index 0000000..28cb883
--- /dev/null
@@ -0,0 +1,22 @@
+/**\r
+ * \r
+ */\r
+package org.netxms.client;\r
+\r
+/**\r
+ * @author victor\r
+ *\r
+ */\r
+public class EventDatabaseSyncTest extends SessionTest\r
+{\r
+       public void testSyncEventDatabase() throws Exception\r
+       {\r
+               final NXCSession session = connect();\r
+               \r
+               assertNull(session.findEventTemplateByCode(1L));\r
+               session.syncEventTemplates();\r
+               assertNotNull(session.findEventTemplateByCode(1L));\r
+               \r
+               session.disconnect();\r
+       }\r
+}\r
index 856352e..62f60a8 100644 (file)
@@ -20,6 +20,8 @@ package org.netxms.client;
 \r
 import java.net.InetAddress;\r
 \r
+import org.netxms.client.objects.GenericObject;\r
+\r
 /**\r
  * @author Victor\r
  *\r
@@ -31,7 +33,7 @@ public class ObjectTest extends SessionTest
                final NXCSession session = connect();\r
                \r
                session.syncObjects();\r
-               final NXCObject obj = session.findObjectById(1);\r
+               final GenericObject obj = session.findObjectById(1);\r
                assertEquals(true, obj != null);\r
                assertEquals(1, obj.getObjectId());\r
                assertEquals("Entire Network", obj.getObjectName());\r
@@ -45,7 +47,7 @@ public class ObjectTest extends SessionTest
                \r
                session.syncObjects();\r
                \r
-               NXCObject object = session.findObjectById(2);\r
+               GenericObject object = session.findObjectById(2);\r
                assertEquals(false, object.isChildOf(1));\r
                \r
                object = session.findObjectById(12);\r
@@ -60,7 +62,7 @@ public class ObjectTest extends SessionTest
                \r
                session.syncObjects();\r
                \r
-               NXCObject object = session.findObjectById(1);\r
+               GenericObject object = session.findObjectById(1);\r
                assertNotNull(object);\r
                \r
                session.setObjectName(1, "test name");\r
@@ -84,10 +86,10 @@ public class ObjectTest extends SessionTest
                \r
                session.syncObjects();\r
                \r
-               NXCObject object = session.findObjectById(2);\r
+               GenericObject object = session.findObjectById(2);\r
                assertNotNull(object);\r
                \r
-               NXCObjectCreationData cd = new NXCObjectCreationData(NXCObject.OBJECT_NODE, "TestNode", 2);\r
+               NXCObjectCreationData cd = new NXCObjectCreationData(GenericObject.OBJECT_NODE, "TestNode", 2);\r
                cd.setCreationFlags(NXCObjectCreationData.CF_CREATE_UNMANAGED);\r
                cd.setIpAddress(InetAddress.getByName("192.168.10.1"));\r
                long id = session.createObject(cd);\r
index 5479102..807821e 100644 (file)
@@ -8,8 +8,8 @@ import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerComparator;\r
 import org.eclipse.swt.SWT;\r
 import org.eclipse.swt.widgets.TableColumn;\r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.events.Alarm;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.eclipse.alarmviewer.widgets.AlarmList;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 \r
@@ -56,8 +56,8 @@ public class AlarmComparator extends ViewerComparator
                                rc = compareNumbers(((Alarm)e1).getState(), ((Alarm)e2).getState());\r
                                break;\r
                        case AlarmList.COLUMN_SOURCE:\r
-                               NXCObject obj1 = NXMCSharedData.getInstance().getSession().findObjectById(((Alarm)e1).getSourceObjectId());\r
-                               NXCObject obj2 = NXMCSharedData.getInstance().getSession().findObjectById(((Alarm)e2).getSourceObjectId());\r
+                               GenericObject obj1 = NXMCSharedData.getInstance().getSession().findObjectById(((Alarm)e1).getSourceObjectId());\r
+                               GenericObject obj2 = NXMCSharedData.getInstance().getSession().findObjectById(((Alarm)e2).getSourceObjectId());\r
                                String name1 = (obj1 != null) ? obj1.getObjectName() : "<unknown>";\r
                                String name2 = (obj2 != null) ? obj2.getObjectName() : "<unknown>";\r
                                rc = name1.compareToIgnoreCase(name2);\r
index b78435c..27bdde7 100644 (file)
@@ -5,8 +5,8 @@ package org.netxms.ui.eclipse.alarmviewer;
 \r
 import org.eclipse.jface.viewers.Viewer;\r
 import org.eclipse.jface.viewers.ViewerFilter;\r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.events.Alarm;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 \r
 /**\r
@@ -35,7 +35,7 @@ public class AlarmListFilter extends ViewerFilter
                if ((rootObject == 0) || (rootObject == ((Alarm)element).getSourceObjectId()))\r
                        return true;    // No filtering by object ID or root object is a source\r
                \r
-               NXCObject object = NXMCSharedData.getInstance().getSession().findObjectById(((Alarm)element).getSourceObjectId());\r
+               GenericObject object = NXMCSharedData.getInstance().getSession().findObjectById(((Alarm)element).getSourceObjectId());\r
                if (object != null)\r
                        return object.isChildOf(rootObject);\r
                return false;\r
index a73e3d5..a3859dc 100644 (file)
@@ -8,9 +8,9 @@ import java.text.DateFormat;
 import org.eclipse.jface.viewers.ILabelProviderListener;\r
 import org.eclipse.jface.viewers.ITableLabelProvider;\r
 import org.eclipse.swt.graphics.Image;\r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.constants.Severity;\r
 import org.netxms.client.events.Alarm;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.eclipse.alarmviewer.widgets.AlarmList;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 import org.netxms.ui.eclipse.shared.StatusDisplayInfo;\r
@@ -76,7 +76,7 @@ public class AlarmListLabelProvider implements ITableLabelProvider
                        case AlarmList.COLUMN_STATE:\r
                                return stateText[((Alarm)element).getState()];\r
                        case AlarmList.COLUMN_SOURCE:\r
-                               NXCObject object = NXMCSharedData.getInstance().getSession().findObjectById(((Alarm)element).getSourceObjectId());\r
+                               GenericObject object = NXMCSharedData.getInstance().getSession().findObjectById(((Alarm)element).getSourceObjectId());\r
                                return (object != null) ? object.getObjectName() : null;\r
                        case AlarmList.COLUMN_MESSAGE:\r
                                return ((Alarm)element).getMessage();\r
index 1f4ca28..d4cb4d3 100644 (file)
@@ -17,7 +17,7 @@
          point="org.eclipse.ui.popupMenus">\r
       <objectContribution\r
             id="org.netxms.ui.eclipse.datacollection.actions.popup.object.dceditor_NXCNode"\r
-            objectClass="org.netxms.client.NXCNode">\r
+            objectClass="org.netxms.client.objects.Node">\r
          <action\r
                class="org.netxms.ui.eclipse.datacollection.actions.OpenEditor"\r
                enablesFor="1"\r
@@ -29,7 +29,7 @@
       </objectContribution>\r
       <objectContribution\r
             id="org.netxms.ui.eclipse.datacollection.actions.popup.object.dceditor_NXCTemplate"\r
-            objectClass="org.netxms.client.NXCTemplate">\r
+            objectClass="org.netxms.client.objects.Template">\r
          <action\r
                class="org.netxms.ui.eclipse.datacollection.actions.OpenEditor"\r
                enablesFor="1"\r
index da2ffe4..b965a9e 100644 (file)
@@ -23,9 +23,9 @@ import java.util.HashMap;
 import org.eclipse.jface.viewers.ILabelProviderListener;\r
 import org.eclipse.jface.viewers.ITableLabelProvider;\r
 import org.eclipse.swt.graphics.Image;\r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.NXCSession;\r
 import org.netxms.client.datacollection.DataCollectionItem;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.eclipse.datacollection.views.DataCollectionEditor;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 \r
@@ -116,7 +116,7 @@ public class DciLabelProvider implements ITableLabelProvider
                        case DataCollectionEditor.COLUMN_TEMPLATE:\r
                                if (dci.getTemplateId() == 0)\r
                                        return null;\r
-                               NXCObject object = session.findObjectById(dci.getTemplateId());\r
+                               GenericObject object = session.findObjectById(dci.getTemplateId());\r
                                return (object != null) ? object.getObjectName() : "<unknown>";\r
                }\r
                return null;\r
index 922c1d6..27b1166 100644 (file)
@@ -12,9 +12,9 @@ import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchPart;\r
 import org.eclipse.ui.IWorkbenchWindow;\r
 import org.eclipse.ui.PartInitException;\r
-import org.netxms.client.NXCNode;\r
-import org.netxms.client.NXCObject;\r
-import org.netxms.client.NXCTemplate;\r
+import org.netxms.client.objects.GenericObject;\r
+import org.netxms.client.objects.Node;\r
+import org.netxms.client.objects.Template;\r
 import org.netxms.ui.eclipse.datacollection.views.DataCollectionEditor;\r
 \r
 /**\r
@@ -24,7 +24,7 @@ import org.netxms.ui.eclipse.datacollection.views.DataCollectionEditor;
 public class OpenEditor implements IObjectActionDelegate\r
 {\r
        private IWorkbenchWindow window;\r
-       private NXCObject object;\r
+       private GenericObject object;\r
 \r
        /* (non-Javadoc)\r
         * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)\r
@@ -63,9 +63,9 @@ public class OpenEditor implements IObjectActionDelegate
                if (selection instanceof IStructuredSelection)\r
                {\r
                        Object element = ((IStructuredSelection)selection).getFirstElement();\r
-                       if ((element instanceof NXCNode) || (element instanceof NXCTemplate))\r
+                       if ((element instanceof Node) || (element instanceof Template))\r
                        {\r
-                               object = (NXCObject)element;\r
+                               object = (GenericObject)element;\r
                        }\r
                        else\r
                        {\r
index 302999c..fbf4382 100644 (file)
@@ -30,8 +30,8 @@ import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.dialogs.PropertyPage;\r
 import org.eclipse.ui.progress.UIJob;\r
 import org.netxms.client.NXCException;\r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.datacollection.DataCollectionItem;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.eclipse.datacollection.Activator;\r
 import org.netxms.ui.eclipse.objectbrowser.widgets.ObjectSelector;\r
 import org.netxms.ui.eclipse.tools.WidgetHelper;\r
@@ -168,7 +168,7 @@ public class General extends PropertyPage
       fd.top = new FormAttachment(origin.getParent(), WidgetHelper.OUTER_SPACING, SWT.BOTTOM);\r
       fd.right = new FormAttachment(100, 0);\r
       proxyNode.setLayoutData(fd);\r
-      proxyNode.setObjectClass(NXCObject.OBJECT_NODE);\r
+      proxyNode.setObjectClass(GenericObject.OBJECT_NODE);\r
       proxyNode.setObjectId(dci.getProxyNode());\r
       proxyNode.setEnabled(dci.getOrigin() != DataCollectionItem.PUSH);\r
       \r
index fab85a0..4b88086 100644 (file)
@@ -37,12 +37,12 @@ import org.eclipse.ui.part.ViewPart;
 import org.eclipse.ui.progress.IWorkbenchSiteProgressService;\r
 import org.eclipse.ui.progress.UIJob;\r
 import org.netxms.client.NXCException;\r
-import org.netxms.client.NXCNode;\r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.NXCSession;\r
-import org.netxms.client.NXCTemplate;\r
 import org.netxms.client.datacollection.DataCollectionConfiguration;\r
 import org.netxms.client.datacollection.DataCollectionItem;\r
+import org.netxms.client.objects.GenericObject;\r
+import org.netxms.client.objects.Node;\r
+import org.netxms.client.objects.Template;\r
 import org.netxms.ui.eclipse.datacollection.Activator;\r
 import org.netxms.ui.eclipse.datacollection.DciComparator;\r
 import org.netxms.ui.eclipse.datacollection.DciLabelProvider;\r
@@ -72,7 +72,7 @@ public class DataCollectionEditor extends ViewPart
 \r
        private TableViewer viewer;\r
        private NXCSession session;\r
-       private NXCObject object;\r
+       private GenericObject object;\r
        private DataCollectionConfiguration dciConfig = null;\r
        private Action actionCreate;\r
        private Action actionEdit;\r
@@ -94,8 +94,8 @@ public class DataCollectionEditor extends ViewPart
                super.init(site);\r
                \r
                session = NXMCSharedData.getInstance().getSession();\r
-               NXCObject obj = session.findObjectById(Long.parseLong(site.getSecondaryId()));\r
-               object = ((obj != null) && ((obj instanceof NXCNode) || (obj instanceof NXCTemplate))) ? obj : null;\r
+               GenericObject obj = session.findObjectById(Long.parseLong(site.getSecondaryId()));\r
+               object = ((obj != null) && ((obj instanceof Node) || (obj instanceof Template))) ? obj : null;\r
                setPartName("Data Collection Configuration - " + ((object != null) ? object.getObjectName() : "<error>"));\r
        }\r
 \r
index 39e6194..09ca8bb 100644 (file)
@@ -17,7 +17,7 @@
          point="org.eclipse.ui.popupMenus">\r
       <objectContribution\r
             id="org.netxms.ui.eclipse.googlemaps.actions.popup.object.showmap_NXCNode"\r
-            objectClass="org.netxms.client.NXCNode">\r
+            objectClass="org.netxms.client.objects.Node">\r
          <action\r
                class="org.netxms.ui.eclipse.googlemaps.actions.OpenLocationMap"\r
                enablesFor="1"\r
index 517a62a..4c4e6e0 100644 (file)
@@ -9,13 +9,13 @@ import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchPart;\r
 import org.eclipse.ui.IWorkbenchWindow;\r
 import org.eclipse.ui.PartInitException;\r
-import org.netxms.client.NXCObject;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.eclipse.googlemaps.views.LocationMap;\r
 \r
 public class OpenLocationMap implements IObjectActionDelegate\r
 {\r
        private IWorkbenchWindow window;\r
-       private NXCObject object;\r
+       private GenericObject object;\r
        \r
        /* (non-Javadoc)\r
         * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)\r
@@ -53,9 +53,9 @@ public class OpenLocationMap implements IObjectActionDelegate
        {\r
                Object obj;\r
                if ((selection instanceof IStructuredSelection) &&\r
-                        ((obj = ((IStructuredSelection)selection).getFirstElement()) instanceof NXCObject))\r
+                        ((obj = ((IStructuredSelection)selection).getFirstElement()) instanceof GenericObject))\r
                {\r
-                       object = (NXCObject)obj;\r
+                       object = (GenericObject)obj;\r
                }\r
                else\r
                {\r
index c2ceff6..64b25ae 100644 (file)
@@ -11,6 +11,7 @@ LoginDialog.server=\u0421\u0435\u0440\u0432\u0435\u0440:
 LoginDialog.title=NetXMS - \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443\r
 LoginJob.connecting=\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f...\r
 LoginJob.subscribe=\u041f\u043e\u0434\u043f\u0438\u0441\u043a\u0430 \u043d\u0430 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f...\r
+LoginJob.sync_event_db=\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u0439...\r
 LoginJob.sync_objects=\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432...\r
 LoginJob.sync_users=\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0430\u0437\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439...\r
 NXMCActionBarAdvisor.menu_configuration=&\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438\r
diff --git a/src/java/netxms-eclipse/LogViewer/icons/remove.png b/src/java/netxms-eclipse/LogViewer/icons/remove.png
new file mode 100644 (file)
index 0000000..1514d51
Binary files /dev/null and b/src/java/netxms-eclipse/LogViewer/icons/remove.png differ
index 555f0e2..04e7ae3 100644 (file)
@@ -25,6 +25,11 @@ import java.util.List;
 import java.util.Set;\r
 import java.util.Map.Entry;\r
 \r
+import org.eclipse.jface.action.Action;\r
+import org.eclipse.jface.action.IMenuListener;\r
+import org.eclipse.jface.action.IMenuManager;\r
+import org.eclipse.jface.action.MenuManager;\r
+import org.eclipse.jface.action.Separator;\r
 import org.eclipse.jface.dialogs.Dialog;\r
 import org.eclipse.jface.dialogs.MessageDialog;\r
 import org.eclipse.jface.viewers.ArrayContentProvider;\r
@@ -41,17 +46,20 @@ import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;\r
 import org.eclipse.swt.layout.GridData;\r
 import org.eclipse.swt.layout.GridLayout;\r
+import org.eclipse.swt.layout.RowData;\r
 import org.eclipse.swt.layout.RowLayout;\r
 import org.eclipse.swt.widgets.Button;\r
 import org.eclipse.swt.widgets.Composite;\r
 import org.eclipse.swt.widgets.Control;\r
 import org.eclipse.swt.widgets.Group;\r
+import org.eclipse.swt.widgets.Menu;\r
 import org.eclipse.swt.widgets.Shell;\r
 import org.netxms.client.log.ColumnFilter;\r
 import org.netxms.client.log.Log;\r
 import org.netxms.client.log.LogColumn;\r
 import org.netxms.client.log.LogFilter;\r
 import org.netxms.client.log.OrderingColumn;\r
+import org.netxms.ui.eclipse.logviewer.Activator;\r
 import org.netxms.ui.eclipse.logviewer.dialogs.helpers.FilterTreeContentProvider;\r
 import org.netxms.ui.eclipse.logviewer.dialogs.helpers.FilterTreeElement;\r
 import org.netxms.ui.eclipse.logviewer.dialogs.helpers.FilterTreeLabelProvider;\r
@@ -67,6 +75,7 @@ public class QueryBuilder extends Dialog
 {\r
        private Log logHandle;\r
        private LogFilter filter;\r
+       \r
        private TreeViewer filterTree;\r
        private ArrayList<FilterTreeElement> elements;\r
        private FilterTreeElement rootElement;\r
@@ -75,6 +84,7 @@ public class QueryBuilder extends Dialog
        private Button buttonAddOrSet;\r
        private Button buttonAddOperation;\r
        private Button buttonRemove;\r
+       \r
        private HashSet<OrderingColumn> orderingColumns;\r
        private TableViewer orderingList;\r
        private Button buttonAddOrderingColumn;\r
@@ -82,6 +92,13 @@ public class QueryBuilder extends Dialog
        private Button buttonMoveDown;\r
        private Button buttonRemoveOrderingColumn;\r
        \r
+       private Action actionAddColumn;\r
+       private Action actionAddCondition;\r
+       private Action actionAddAndGroup;\r
+       private Action actionAddOrGroup;\r
+       private Action actionRemoveColumn;\r
+       private Action actionRemoveOrderingColumn;\r
+       \r
        /**\r
         * @param parentShell\r
         */\r
@@ -165,8 +182,90 @@ public class QueryBuilder extends Dialog
                gd.grabExcessHorizontalSpace = true;\r
                orderingListArea.setLayoutData(gd);\r
                \r
+               createActions();\r
+               \r
                return dialogArea;\r
        }\r
+       \r
+       /**\r
+        * Create actions\r
+        */\r
+       private void createActions()\r
+       {\r
+               actionAddColumn = new Action() {\r
+                       /* (non-Javadoc)\r
+                        * @see org.eclipse.jface.action.Action#run()\r
+                        */\r
+                       @Override\r
+                       public void run()\r
+                       {\r
+                               addColumn();\r
+                       }\r
+               };\r
+               actionAddColumn.setText("Add &column");\r
+               \r
+               actionAddAndGroup = new Action() {\r
+                       /* (non-Javadoc)\r
+                        * @see org.eclipse.jface.action.Action#run()\r
+                        */\r
+                       @Override\r
+                       public void run()\r
+                       {\r
+                               addFilterSet(ColumnFilter.AND);\r
+                       }\r
+               };\r
+               actionAddAndGroup.setText("Add &AND filter set");\r
+               \r
+               actionAddOrGroup = new Action() {\r
+                       /* (non-Javadoc)\r
+                        * @see org.eclipse.jface.action.Action#run()\r
+                        */\r
+                       @Override\r
+                       public void run()\r
+                       {\r
+                               addFilterSet(ColumnFilter.OR);\r
+                       }\r
+               };\r
+               actionAddOrGroup.setText("Add &OR filter set");\r
+               \r
+               actionAddCondition = new Action() {\r
+                       /* (non-Javadoc)\r
+                        * @see org.eclipse.jface.action.Action#run()\r
+                        */\r
+                       @Override\r
+                       public void run()\r
+                       {\r
+                               addCondition();\r
+                       }\r
+               };\r
+               actionAddCondition.setText("Add co&ndition");\r
+               \r
+               actionRemoveColumn = new Action() {\r
+                       /* (non-Javadoc)\r
+                        * @see org.eclipse.jface.action.Action#run()\r
+                        */\r
+                       @Override\r
+                       public void run()\r
+                       {\r
+                               removeFilterTreeElement();\r
+                       }\r
+               };\r
+               actionRemoveColumn.setText("&Remove");\r
+               actionRemoveColumn.setImageDescriptor(Activator.getImageDescriptor("icons/remove.png"));\r
+\r
+               actionRemoveOrderingColumn = new Action() {\r
+                       /* (non-Javadoc)\r
+                        * @see org.eclipse.jface.action.Action#run()\r
+                        */\r
+                       @Override\r
+                       public void run()\r
+                       {\r
+                               removeOrderingColumn();\r
+                       }\r
+               };\r
+               actionRemoveOrderingColumn.setText("&Remove");\r
+               actionRemoveOrderingColumn.setImageDescriptor(Activator.getImageDescriptor("icons/remove.png"));\r
+       }\r
 \r
        /**\r
         * Create filter tree control\r
@@ -230,6 +329,9 @@ public class QueryBuilder extends Dialog
                                addColumn();\r
                        }\r
                });\r
+               RowData rd = new RowData();\r
+               rd.width = WidgetHelper.WIDE_BUTTON_WIDTH_HINT;\r
+               buttonAddColumn.setLayoutData(rd);\r
 \r
                buttonAddAndSet = new Button(buttons, SWT.PUSH);\r
                buttonAddAndSet.setText("Add &AND group");\r
@@ -264,7 +366,7 @@ public class QueryBuilder extends Dialog
                });\r
                \r
                buttonAddOperation = new Button(buttons, SWT.PUSH);\r
-               buttonAddOperation.setText("Add &condition");\r
+               buttonAddOperation.setText("Add co&ndition");\r
                buttonAddOperation.addSelectionListener(new SelectionListener() {\r
                        @Override\r
                        public void widgetDefaultSelected(SelectionEvent e)\r
@@ -281,11 +383,85 @@ public class QueryBuilder extends Dialog
                \r
                buttonRemove = new Button(buttons, SWT.PUSH);\r
                buttonRemove.setText("&Remove");\r
+               buttonRemove.addSelectionListener(new SelectionListener() {\r
+                       @Override\r
+                       public void widgetDefaultSelected(SelectionEvent e)\r
+                       {\r
+                               widgetSelected(e);\r
+                       }\r
+\r
+                       @Override\r
+                       public void widgetSelected(SelectionEvent e)\r
+                       {\r
+                               removeFilterTreeElement();\r
+                       }\r
+               });\r
+               \r
+               createFilterPopupMenu();\r
                \r
                return group;\r
        }\r
        \r
        /**\r
+        * Create pop-up menu for ordering list\r
+        */\r
+       private void createFilterPopupMenu()\r
+       {\r
+               // Create menu manager.\r
+               MenuManager menuMgr = new MenuManager();\r
+               menuMgr.setRemoveAllWhenShown(true);\r
+               menuMgr.addMenuListener(new IMenuListener()\r
+               {\r
+                       public void menuAboutToShow(IMenuManager mgr)\r
+                       {\r
+                               fillFilterContextMenu(mgr);\r
+                       }\r
+               });\r
+\r
+               // Create menu.\r
+               Menu menu = menuMgr.createContextMenu(filterTree.getControl());\r
+               filterTree.getControl().setMenu(menu);\r
+       }\r
+       \r
+       /**\r
+        * Fill context menu for ordering column list\r
+        * \r
+        * @param mgr Menu manager\r
+        */\r
+       private void fillFilterContextMenu(final IMenuManager mgr)\r
+       {\r
+               final IStructuredSelection selection = (IStructuredSelection)filterTree.getSelection();\r
+               if (selection.isEmpty())\r
+                       return;\r
+               \r
+               FilterTreeElement element = (FilterTreeElement)selection.getFirstElement();\r
+               switch(element.getType())\r
+               {\r
+                       case FilterTreeElement.ROOT:\r
+                               mgr.add(actionAddColumn);\r
+                               break;\r
+                       case FilterTreeElement.COLUMN:\r
+                               mgr.add(actionAddAndGroup);\r
+                               mgr.add(actionAddOrGroup);\r
+                               mgr.add(actionAddCondition);\r
+                               mgr.add(new Separator());\r
+                               mgr.add(actionRemoveColumn);\r
+                               break;\r
+                       case FilterTreeElement.FILTER:\r
+                               final ColumnFilter cf = (ColumnFilter)element.getObject();\r
+                               if (cf.getType() == ColumnFilter.SET)\r
+                               {\r
+                                       mgr.add(actionAddAndGroup);\r
+                                       mgr.add(actionAddOrGroup);\r
+                                       mgr.add(actionAddCondition);\r
+                                       mgr.add(new Separator());\r
+                               }\r
+                               mgr.add(actionRemoveColumn);\r
+                               break;\r
+               }\r
+       }\r
+       \r
+       /**\r
         * Create list control containing ordering columns\r
         * \r
         * @param parent Parent widget\r
@@ -346,7 +522,7 @@ public class QueryBuilder extends Dialog
                buttons.setLayoutData(gd);\r
                \r
                buttonAddOrderingColumn = new Button(buttons, SWT.PUSH);\r
-               buttonAddOrderingColumn.setText("Add c&olumn");\r
+               buttonAddOrderingColumn.setText("&Add column");\r
                buttonAddOrderingColumn.addSelectionListener(new SelectionListener() {\r
                        @Override\r
                        public void widgetDefaultSelected(SelectionEvent e)\r
@@ -360,6 +536,9 @@ public class QueryBuilder extends Dialog
                                addOrderingColumn();\r
                        }\r
                });\r
+               RowData rd = new RowData();\r
+               rd.width = WidgetHelper.WIDE_BUTTON_WIDTH_HINT;\r
+               buttonAddOrderingColumn.setLayoutData(rd);\r
 \r
                buttonRemoveOrderingColumn = new Button(buttons, SWT.PUSH);\r
                buttonRemoveOrderingColumn.setText("R&emove");\r
@@ -377,11 +556,46 @@ public class QueryBuilder extends Dialog
                        }\r
                });\r
                buttonRemoveOrderingColumn.setEnabled(false);\r
+               \r
+               createOrderingPopupMenu();\r
 \r
                return group;\r
        }\r
        \r
        /**\r
+        * Create pop-up menu for ordering list\r
+        */\r
+       private void createOrderingPopupMenu()\r
+       {\r
+               // Create menu manager.\r
+               MenuManager menuMgr = new MenuManager();\r
+               menuMgr.setRemoveAllWhenShown(true);\r
+               menuMgr.addMenuListener(new IMenuListener()\r
+               {\r
+                       public void menuAboutToShow(IMenuManager mgr)\r
+                       {\r
+                               fillOrderingContextMenu(mgr);\r
+                       }\r
+               });\r
+\r
+               // Create menu.\r
+               Menu menu = menuMgr.createContextMenu(orderingList.getControl());\r
+               orderingList.getControl().setMenu(menu);\r
+       }\r
+       \r
+       /**\r
+        * Fill context menu for ordering column list\r
+        * \r
+        * @param mgr Menu manager\r
+        */\r
+       private void fillOrderingContextMenu(final IMenuManager mgr)\r
+       {\r
+               final IStructuredSelection selection = (IStructuredSelection)orderingList.getSelection();\r
+               if (!selection.isEmpty())\r
+                       mgr.add(actionRemoveOrderingColumn);\r
+       }\r
+       \r
+       /**\r
         * Add column to filter\r
         */\r
        private void addColumn()\r
@@ -495,6 +709,24 @@ public class QueryBuilder extends Dialog
                        filterTree.setSelection(new StructuredSelection(condition), true);\r
                }\r
        }\r
+       \r
+       /**\r
+        * Remove selected element from filter tree\r
+        */\r
+       private void removeFilterTreeElement()\r
+       {\r
+               IStructuredSelection selection = (IStructuredSelection)filterTree.getSelection();\r
+               FilterTreeElement element = (FilterTreeElement)selection.getFirstElement();\r
+               if (selection.isEmpty() || (element.getType() == FilterTreeElement.ROOT))\r
+               {\r
+                       MessageDialog.openWarning(getShell(), "Warning", "Only columns and filters can be deleted");\r
+                       return;\r
+               }\r
+               \r
+               FilterTreeElement parent = element.getParent();\r
+               parent.removeChild(element);\r
+               filterTree.refresh();\r
+       }\r
 \r
        /**\r
         * Get filter created by builder\r
@@ -540,6 +772,7 @@ public class QueryBuilder extends Dialog
                        ColumnFilter cf = buildColumnFilter(columns[i].getChilds()[0]);\r
                        filter.setColumnFilter(((LogColumn)columns[i].getObject()).getName(), cf);\r
                }\r
+               filter.setOrderingColumns(new ArrayList<OrderingColumn>(orderingColumns));\r
        }\r
        \r
        /**\r
index 7e63c03..bb555ee 100644 (file)
@@ -22,6 +22,7 @@ import java.util.Collection;
 \r
 import org.eclipse.core.runtime.IProgressMonitor;\r
 import org.eclipse.core.runtime.IStatus;\r
+import org.eclipse.core.runtime.Platform;\r
 import org.eclipse.core.runtime.Status;\r
 import org.eclipse.jface.action.Action;\r
 import org.eclipse.jface.action.IMenuManager;\r
@@ -41,6 +42,7 @@ import org.eclipse.ui.IViewSite;
 import org.eclipse.ui.PartInitException;\r
 import org.eclipse.ui.part.ViewPart;\r
 import org.eclipse.ui.progress.UIJob;\r
+import org.netxms.client.NXCAccessListElement;\r
 import org.netxms.client.NXCSession;\r
 import org.netxms.client.Table;\r
 import org.netxms.client.log.Log;\r
@@ -102,6 +104,9 @@ public class LogViewer extends ViewPart
                        this.setTitleImage(titleImage);\r
                }\r
                filter = new LogFilter();\r
+\r
+               // Initiate loading of user manager plugin if it was not loaded before\r
+               Platform.getAdapterManager().loadAdapter(new NXCAccessListElement(0, 0), "org.eclipse.ui.model.IWorkbenchAdapter");\r
        }\r
        \r
        /* (non-Javadoc)\r
index 71a99f1..13d203b 100644 (file)
@@ -27,10 +27,13 @@ import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.viewers.ILabelProviderListener;\r
 import org.eclipse.jface.viewers.ITableLabelProvider;\r
 import org.eclipse.swt.graphics.Image;\r
-import org.netxms.client.NXCObject;\r
+import org.eclipse.ui.model.WorkbenchLabelProvider;\r
 import org.netxms.client.NXCSession;\r
+import org.netxms.client.NXCUserDBObject;\r
+import org.netxms.client.events.EventTemplate;\r
 import org.netxms.client.log.Log;\r
 import org.netxms.client.log.LogColumn;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 import org.netxms.ui.eclipse.shared.StatusDisplayInfo;\r
 \r
@@ -43,6 +46,7 @@ public class LogLabelProvider implements ITableLabelProvider
        private LogColumn[] columns;\r
        private NXCSession session;\r
        private Image[] statusImages;\r
+       private WorkbenchLabelProvider wbLabelProvider;\r
        \r
        public LogLabelProvider(Log logHandle)\r
        {\r
@@ -56,6 +60,8 @@ public class LogLabelProvider implements ITableLabelProvider
                        ImageDescriptor d = StatusDisplayInfo.getStatusImageDescriptor(i);\r
                        statusImages[i] = (d != null) ? d.createImage() : null;\r
                }\r
+               \r
+               wbLabelProvider = new WorkbenchLabelProvider();\r
        }\r
        \r
        /* (non-Javadoc)\r
@@ -78,6 +84,28 @@ public class LogLabelProvider implements ITableLabelProvider
                                {\r
                                        return null;\r
                                }\r
+                       case LogColumn.LC_OBJECT_ID:\r
+                               try\r
+                               {\r
+                                       long id = Long.parseLong(value);\r
+                                       GenericObject object = session.findObjectById(id);\r
+                                       return (object != null) ? wbLabelProvider.getImage(object) : null;\r
+                               }\r
+                               catch(NumberFormatException e)\r
+                               {\r
+                                       return null;\r
+                               }\r
+                       case LogColumn.LC_USER_ID:\r
+                               try\r
+                               {\r
+                                       long id = Long.parseLong(value);\r
+                                       NXCUserDBObject user = session.findUserDBObjectById(id);\r
+                                       return (user != null) ? wbLabelProvider.getImage(user) : null;\r
+                               }\r
+                               catch(NumberFormatException e)\r
+                               {\r
+                                       return null;\r
+                               }\r
                        default:\r
                                return null;\r
                }\r
@@ -110,7 +138,7 @@ public class LogLabelProvider implements ITableLabelProvider
                                        long id = Long.parseLong(value);\r
                                        if (id == 0)\r
                                                return "";\r
-                                       NXCObject object = session.findObjectById(id);\r
+                                       GenericObject object = session.findObjectById(id);\r
                                        return (object != null) ? object.getObjectName() : "<unknown>";\r
                                }\r
                                catch(NumberFormatException e)\r
@@ -127,6 +155,28 @@ public class LogLabelProvider implements ITableLabelProvider
                                {\r
                                        return "<error>";\r
                                }\r
+                       case LogColumn.LC_USER_ID:\r
+                               try\r
+                               {\r
+                                       long id = Long.parseLong(value);\r
+                                       NXCUserDBObject user = session.findUserDBObjectById(id);\r
+                                       return (user != null) ? wbLabelProvider.getText(user) : null;\r
+                               }\r
+                               catch(NumberFormatException e)\r
+                               {\r
+                                       return null;\r
+                               }\r
+                       case LogColumn.LC_EVENT_CODE:\r
+                               try\r
+                               {\r
+                                       long code = Long.parseLong(value);\r
+                                       EventTemplate evt = session.findEventTemplateByCode(code);\r
+                                       return (evt != null) ? evt.getName() : null;\r
+                               }\r
+                               catch(NumberFormatException e)\r
+                               {\r
+                                       return null;\r
+                               }\r
                        default:\r
                                return value;\r
                }\r
@@ -138,8 +188,6 @@ public class LogLabelProvider implements ITableLabelProvider
        @Override\r
        public void addListener(ILabelProviderListener listener)\r
        {\r
-               // TODO Auto-generated method stub\r
-\r
        }\r
 \r
        /* (non-Javadoc)\r
@@ -159,7 +207,6 @@ public class LogLabelProvider implements ITableLabelProvider
        @Override\r
        public boolean isLabelProperty(Object element, String property)\r
        {\r
-               // TODO Auto-generated method stub\r
                return false;\r
        }\r
 \r
@@ -169,8 +216,5 @@ public class LogLabelProvider implements ITableLabelProvider
        @Override\r
        public void removeListener(ILabelProviderListener listener)\r
        {\r
-               // TODO Auto-generated method stub\r
-\r
        }\r
-\r
 }\r
index 4816a69..ebc01db 100644 (file)
@@ -17,7 +17,7 @@
          point="org.eclipse.ui.popupMenus">\r
       <objectContribution\r
             id="org.netxms.ui.eclipse.quickmaps.actions.popup.object.ip_neighbors"\r
-            objectClass="org.netxms.client.NXCNode">\r
+            objectClass="org.netxms.client.objects.Node">\r
          <action\r
                class="org.netxms.ui.eclipse.networkmaps.actions.ShowIPNeighbors"\r
                enablesFor="1"\r
index baeefee..68e97c6 100644 (file)
@@ -11,7 +11,7 @@ import org.eclipse.draw2d.geometry.Rectangle;
 import org.eclipse.jface.dialogs.MessageDialog;\r
 import org.eclipse.swt.SWT;\r
 import org.eclipse.swt.graphics.Color;\r
-import org.netxms.client.NXCObject;\r
+import org.netxms.client.objects.GenericObject;\r
 \r
 /**\r
  * @author Victor\r
@@ -21,7 +21,7 @@ public class ObjectFigure extends Figure
 {\r
        private static final Dimension corner = new Dimension(8, 8);\r
 \r
-       private NXCObject object;\r
+       private GenericObject object;\r
        private boolean selected = false;\r
        private Color bkColorNormal = new Color(null, 255, 255, 255);\r
        private Color bkColorSelected = new Color(null, 0, 0, 255);\r
@@ -32,7 +32,7 @@ public class ObjectFigure extends Figure
         * Create new object figure\r
         * @param element\r
         */\r
-       public ObjectFigure(NXCObject object)\r
+       public ObjectFigure(GenericObject object)\r
        {\r
                super();\r
                this.object = object;\r
index 85be44e..7cf1c47 100644 (file)
@@ -12,7 +12,7 @@ import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchPart;\r
 import org.eclipse.ui.IWorkbenchWindow;\r
 import org.eclipse.ui.PartInitException;\r
-import org.netxms.client.NXCNode;\r
+import org.netxms.client.objects.Node;\r
 import org.netxms.ui.eclipse.networkmaps.views.IPNeighbors;\r
 \r
 /**\r
@@ -22,7 +22,7 @@ import org.netxms.ui.eclipse.networkmaps.views.IPNeighbors;
 public class ShowIPNeighbors implements IObjectActionDelegate\r
 {\r
        private IWorkbenchWindow window;\r
-       private NXCNode node;\r
+       private Node node;\r
 \r
        /* (non-Javadoc)\r
         * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)\r
@@ -60,9 +60,9 @@ public class ShowIPNeighbors implements IObjectActionDelegate
        {\r
                Object obj;\r
                if ((selection instanceof TreeSelection) &&\r
-                        ((obj = ((TreeSelection)selection).getFirstElement()) instanceof NXCNode))\r
+                        ((obj = ((TreeSelection)selection).getFirstElement()) instanceof Node))\r
                {\r
-                       node = (NXCNode)obj;\r
+                       node = (Node)obj;\r
                }\r
                else\r
                {\r
index a2fb4e7..0a8c764 100644 (file)
@@ -7,9 +7,9 @@ import java.util.Iterator;
 \r
 import org.eclipse.ui.IViewSite;\r
 import org.eclipse.ui.PartInitException;\r
-import org.netxms.client.NXCNode;\r
-import org.netxms.client.NXCObject;\r
-import org.netxms.client.NXCSubnet;\r
+import org.netxms.client.objects.GenericObject;\r
+import org.netxms.client.objects.Node;\r
+import org.netxms.client.objects.Subnet;\r
 import org.netxms.client.maps.NetworkMapObjectData;\r
 import org.netxms.client.maps.NetworkMapObjectLink;\r
 import org.netxms.client.maps.NetworkMapPage;\r
@@ -53,12 +53,12 @@ public class IPNeighbors extends NetworkMap
                while(it.hasNext())\r
                {\r
                        long id = it.next();\r
-                       NXCObject object = session.findObjectById(id);\r
-                       if ((object != null) && (object instanceof NXCSubnet))\r
+                       GenericObject object = session.findObjectById(id);\r
+                       if ((object != null) && (object instanceof Subnet))\r
                        {\r
                                mapPage.addObject(new NetworkMapObjectData(id));\r
                                mapPage.addLink(new NetworkMapObjectLink(NetworkMapObjectLink.NORMAL, node.getObjectId(), id));\r
-                               addNodesFromSubnet((NXCSubnet)object, node.getObjectId());\r
+                               addNodesFromSubnet((Subnet)object, node.getObjectId());\r
                        }\r
                }\r
        }\r
@@ -68,7 +68,7 @@ public class IPNeighbors extends NetworkMap
         * @param subnet Subnet object\r
         * @param rootNodeId ID of map's root node (used to prevent recursion)\r
         */\r
-       private void addNodesFromSubnet(NXCSubnet subnet, long rootNodeId)\r
+       private void addNodesFromSubnet(Subnet subnet, long rootNodeId)\r
        {\r
                Iterator<Long> it = subnet.getChilds();\r
                while(it.hasNext())\r
@@ -76,8 +76,8 @@ public class IPNeighbors extends NetworkMap
                        long id = it.next();\r
                        if (id != rootNodeId)\r
                        {\r
-                               NXCObject object = session.findObjectById(id);\r
-                               if ((object != null) && (object instanceof NXCNode))\r
+                               GenericObject object = session.findObjectById(id);\r
+                               if ((object != null) && (object instanceof Node))\r
                                {\r
                                        mapPage.addObject(new NetworkMapObjectData(id));\r
                                        mapPage.addLink(new NetworkMapObjectLink(NetworkMapObjectLink.NORMAL, subnet.getObjectId(), id));\r
index e3a6b0a..1b66c37 100644 (file)
@@ -23,10 +23,10 @@ import org.eclipse.zest.core.viewers.IFigureProvider;
 import org.eclipse.zest.core.viewers.IGraphEntityContentProvider;\r
 import org.eclipse.zest.layouts.LayoutStyles;\r
 import org.eclipse.zest.layouts.algorithms.SpringLayoutAlgorithm;\r
-import org.netxms.client.NXCNode;\r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.NXCSession;\r
 import org.netxms.client.maps.NetworkMapPage;\r
+import org.netxms.client.objects.GenericObject;\r
+import org.netxms.client.objects.Node;\r
 import org.netxms.ui.eclipse.networkmaps.Activator;\r
 import org.netxms.ui.eclipse.shared.IActionConstants;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
@@ -54,10 +54,10 @@ public abstract class NetworkMap extends ViewPart
                @Override\r
                public Object[] getConnectedTo(Object entity)\r
                {\r
-                       if (!(entity instanceof NXCObject) || (page == null))\r
+                       if (!(entity instanceof GenericObject) || (page == null))\r
                                return null;\r
                        \r
-                       return page.getConnectedObjects(((NXCObject)entity).getObjectId(), session);\r
+                       return page.getConnectedObjects(((GenericObject)entity).getObjectId(), session);\r
                }\r
 \r
                @Override\r
@@ -86,8 +86,8 @@ public abstract class NetworkMap extends ViewPart
                @Override\r
                public String getText(Object element)\r
                {\r
-                       if (element instanceof NXCObject)\r
-                               return ((NXCObject)element).getObjectName();\r
+                       if (element instanceof GenericObject)\r
+                               return ((GenericObject)element).getObjectName();\r
                        return null;\r
                }\r
 \r
@@ -97,8 +97,8 @@ public abstract class NetworkMap extends ViewPart
                @Override\r
                public Image getImage(Object element)\r
                {\r
-                       if (element instanceof NXCObject)\r
-                               return ((NXCObject)element).getObjectClass() == NXCObject.OBJECT_NODE ? imgNode : imgSubnet;\r
+                       if (element instanceof GenericObject)\r
+                               return ((GenericObject)element).getObjectClass() == GenericObject.OBJECT_NODE ? imgNode : imgSubnet;\r
                        return null;\r
                }\r
 \r
@@ -109,12 +109,12 @@ public abstract class NetworkMap extends ViewPart
                public IFigure getFigure(Object element)\r
                {\r
                        return null;\r
-                       //return new ObjectFigure((NXCObject)element);\r
+                       //return new ObjectFigure((GenericObject)element);\r
                }\r
        }\r
        \r
        protected NXCSession session;\r
-       protected NXCNode node;\r
+       protected Node node;\r
        protected NetworkMapPage mapPage;\r
        protected GraphViewer viewer;\r
        protected Image imgNode;\r
@@ -136,8 +136,8 @@ public abstract class NetworkMap extends ViewPart
                super.init(site);\r
 \r
                session = NXMCSharedData.getInstance().getSession();\r
-               NXCObject obj = session.findObjectById(Long.parseLong(site.getSecondaryId()));\r
-               node = ((obj != null) && (obj instanceof NXCNode)) ? (NXCNode)obj : null;\r
+               GenericObject obj = session.findObjectById(Long.parseLong(site.getSecondaryId()));\r
+               node = ((obj != null) && (obj instanceof Node)) ? (Node)obj : null;\r
        \r
                buildMapPage();\r
        }\r
index 923052c..ea99c5a 100644 (file)
@@ -51,7 +51,7 @@
      point="org.eclipse.core.runtime.adapters">\r
         <factory \r
            class="org.netxms.ui.eclipse.objectbrowser.ObjectAdapterFactory" \r
-           adaptableType="org.netxms.client.NXCObject">\r
+           adaptableType="org.netxms.client.objects.GenericObject">\r
           <adapter type="org.eclipse.ui.model.IWorkbenchAdapter"/>\r
         </factory>\r
   </extension>\r
@@ -65,7 +65,7 @@
           lightweight= "false"\r
           class="org.netxms.ui.eclipse.objectbrowser.ObjectDecorator">\r
          <enablement>\r
-           <objectClass name="org.netxms.client.NXCObject"/>\r
+           <objectClass name="org.netxms.client.objects.GenericObject"/>\r
          </enablement>\r
     </decorator>\r
   </extension>\r
index cbd09f7..042e06c 100644 (file)
@@ -8,8 +8,8 @@ import java.util.Iterator;
 import org.eclipse.core.runtime.IAdapterFactory;\r
 import org.eclipse.jface.resource.ImageDescriptor;\r
 import org.eclipse.ui.model.IWorkbenchAdapter;\r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.NXCSession;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 \r
 /**\r
@@ -43,46 +43,46 @@ public class ObjectAdapterFactory implements IAdapterFactory
        {\r
                if (adapterType == IWorkbenchAdapter.class)\r
                {\r
-                       if (adaptableObject instanceof NXCObject)\r
+                       if (adaptableObject instanceof GenericObject)\r
                        {\r
                                return new IWorkbenchAdapter() {\r
                                        @Override\r
                                        public Object[] getChildren(Object o)\r
                                        {\r
-                                               return ((NXCObject)o).getChildsAsArray();\r
+                                               return ((GenericObject)o).getChildsAsArray();\r
                                        }\r
 \r
                                        @Override\r
                                        public ImageDescriptor getImageDescriptor(Object object)\r
                                        {\r
-                                               switch(((NXCObject)object).getObjectClass())\r
+                                               switch(((GenericObject)object).getObjectClass())\r
                                                {\r
-                                                       case NXCObject.OBJECT_NETWORK:\r
+                                                       case GenericObject.OBJECT_NETWORK:\r
                                                                return Activator.getImageDescriptor("icons/network.png");\r
-                                                       case NXCObject.OBJECT_SERVICEROOT:\r
+                                                       case GenericObject.OBJECT_SERVICEROOT:\r
                                                                return Activator.getImageDescriptor("icons/service_root.png");\r
-                                                       case NXCObject.OBJECT_CONTAINER:\r
+                                                       case GenericObject.OBJECT_CONTAINER:\r
                                                                return Activator.getImageDescriptor("icons/container.png");\r
-                                                       case NXCObject.OBJECT_SUBNET:\r
+                                                       case GenericObject.OBJECT_SUBNET:\r
                                                                return Activator.getImageDescriptor("icons/subnet.png");\r
-                                                       case NXCObject.OBJECT_NODE:\r
+                                                       case GenericObject.OBJECT_NODE:\r
                                                                return Activator.getImageDescriptor("icons/node.png");\r
-                                                       case NXCObject.OBJECT_INTERFACE:\r
+                                                       case GenericObject.OBJECT_INTERFACE:\r
                                                                return Activator.getImageDescriptor("icons/interface.png");\r
-                                                       case NXCObject.OBJECT_CONDITION:\r
+                                                       case GenericObject.OBJECT_CONDITION:\r
                                                                return Activator.getImageDescriptor("icons/condition.png");\r
-                                                       case NXCObject.OBJECT_TEMPLATEROOT:\r
+                                                       case GenericObject.OBJECT_TEMPLATEROOT:\r
                                                                return Activator.getImageDescriptor("icons/template_root.png");\r
-                                                       case NXCObject.OBJECT_TEMPLATEGROUP:\r
+                                                       case GenericObject.OBJECT_TEMPLATEGROUP:\r
                                                                return Activator.getImageDescriptor("icons/template_group.png");\r
-                                                       case NXCObject.OBJECT_TEMPLATE:\r
+                                                       case GenericObject.OBJECT_TEMPLATE:\r
                                                                return Activator.getImageDescriptor("icons/template.png");\r
-                                                       case NXCObject.OBJECT_POLICYROOT:\r
+                                                       case GenericObject.OBJECT_POLICYROOT:\r
                                                                return Activator.getImageDescriptor("icons/policy_root.png");\r
-                                                       case NXCObject.OBJECT_POLICYGROUP:\r
+                                                       case GenericObject.OBJECT_POLICYGROUP:\r
                                                                return Activator.getImageDescriptor("icons/policy_group.png");\r
-                                                       case NXCObject.OBJECT_AGENTPOLICY:\r
-                                                       case NXCObject.OBJECT_AGENTPOLICY_CONFIG:\r
+                                                       case GenericObject.OBJECT_AGENTPOLICY:\r
+                                                       case GenericObject.OBJECT_AGENTPOLICY_CONFIG:\r
                                                                return Activator.getImageDescriptor("icons/policy.png");\r
                                                        default:\r
                                                                return null;\r
@@ -92,7 +92,7 @@ public class ObjectAdapterFactory implements IAdapterFactory
                                        @Override\r
                                        public String getLabel(Object o)\r
                                        {\r
-                                               return ((NXCObject)o).getObjectName();\r
+                                               return ((GenericObject)o).getObjectName();\r
                                        }\r
 \r
                                        @Override\r
@@ -101,7 +101,7 @@ public class ObjectAdapterFactory implements IAdapterFactory
                                                NXCSession session = NXMCSharedData.getInstance().getSession();\r
                                                if (session != null)\r
                                                {\r
-                                                       Iterator<Long> it = ((NXCObject)o).getParents();\r
+                                                       Iterator<Long> it = ((GenericObject)o).getParents();\r
                                                        return it.hasNext() ? session.findObjectById(it.next()) : null;\r
                                                }\r
                                                return null;\r
index 75b2e69..b6f5922 100644 (file)
@@ -9,7 +9,7 @@ import org.eclipse.jface.viewers.IDecoration;
 import org.eclipse.jface.viewers.ILabelDecorator;\r
 import org.eclipse.jface.viewers.ILabelProviderListener;\r
 import org.eclipse.swt.graphics.Image;\r
-import org.netxms.client.NXCObject;\r
+import org.netxms.client.objects.GenericObject;\r
 \r
 /**\r
  * @author Victor\r
@@ -43,7 +43,7 @@ public class ObjectDecorator implements ILabelDecorator
        @Override\r
        public Image decorateImage(Image image, Object element)\r
        {\r
-               int status = ((NXCObject)element).getStatus();\r
+               int status = ((GenericObject)element).getStatus();\r
                if (statusImages[status] == null)\r
                        return null;\r
                DecorationOverlayIcon overlay = new DecorationOverlayIcon(image, statusImages[status], IDecoration.BOTTOM_RIGHT);\r
index c1c37c1..f426455 100644 (file)
@@ -20,8 +20,8 @@ import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.widgets.Composite;\r
 import org.eclipse.swt.widgets.Control;\r
 import org.eclipse.swt.widgets.Shell;\r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.NXCSession;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.eclipse.objectbrowser.Activator;\r
 import org.netxms.ui.eclipse.objectbrowser.widgets.ObjectTree;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
@@ -47,11 +47,11 @@ public class ObjectSelectionDialog extends Dialog
        public static Set<Integer> createNodeSelectionFilter()\r
        {\r
                HashSet<Integer> classFilter = new HashSet<Integer>(5);\r
-               classFilter.add(NXCObject.OBJECT_NETWORK);\r
-               classFilter.add(NXCObject.OBJECT_SUBNET);\r
-               classFilter.add(NXCObject.OBJECT_SERVICEROOT);\r
-               classFilter.add(NXCObject.OBJECT_CONTAINER);\r
-               classFilter.add(NXCObject.OBJECT_NODE);\r
+               classFilter.add(GenericObject.OBJECT_NETWORK);\r
+               classFilter.add(GenericObject.OBJECT_SUBNET);\r
+               classFilter.add(GenericObject.OBJECT_SERVICEROOT);\r
+               classFilter.add(GenericObject.OBJECT_CONTAINER);\r
+               classFilter.add(GenericObject.OBJECT_NODE);\r
                return classFilter;\r
        }\r
 \r
@@ -185,10 +185,10 @@ public class ObjectSelectionDialog extends Dialog
         * \r
         * @return\r
         */\r
-       public NXCObject[] getCheckedObjects()\r
+       public GenericObject[] getCheckedObjects()\r
        {\r
                if (selectedObjects == null)\r
-                       return new NXCObject[0];\r
+                       return new GenericObject[0];\r
 \r
                return NXMCSharedData.getInstance().getSession().findMultipleObjects(selectedObjects);\r
        }\r
@@ -198,7 +198,7 @@ public class ObjectSelectionDialog extends Dialog
         * \r
         * @return\r
         */\r
-       public NXCObject[] getAllCheckedObjects()\r
+       public GenericObject[] getAllCheckedObjects()\r
        {\r
                return getAllCheckedObjects(-1);\r
        }\r
@@ -208,15 +208,15 @@ public class ObjectSelectionDialog extends Dialog
         * \r
         * @return\r
         */\r
-       public NXCObject[] getAllCheckedObjects(int objectType)\r
+       public GenericObject[] getAllCheckedObjects(int objectType)\r
        {\r
                if (selectedObjects == null)\r
-                       return new NXCObject[0];\r
+                       return new GenericObject[0];\r
 \r
                final NXCSession session = NXMCSharedData.getInstance().getSession();\r
 \r
-               final List<NXCObject> resuls = new ArrayList<NXCObject>();\r
-               final NXCObject[] objects = session.findMultipleObjects(selectedObjects);\r
+               final List<GenericObject> resuls = new ArrayList<GenericObject>();\r
+               final GenericObject[] objects = session.findMultipleObjects(selectedObjects);\r
                for(int i = 0; i < objects.length; i++)\r
                {\r
                        resuls.addAll(extractAllObjects(session, objects[i]));\r
@@ -224,21 +224,21 @@ public class ObjectSelectionDialog extends Dialog
 \r
                if (objectType != -1)\r
                {\r
-                       final Iterator<NXCObject> it = resuls.iterator();\r
+                       final Iterator<GenericObject> it = resuls.iterator();\r
                        while (it.hasNext()) {\r
-                               final NXCObject next = it.next();\r
+                               final GenericObject next = it.next();\r
                                if (next.getObjectClass() != objectType) {\r
                                        it.remove();\r
                                }\r
                        }\r
                }\r
 \r
-               return resuls.toArray(new NXCObject[] {});\r
+               return resuls.toArray(new GenericObject[] {});\r
        }\r
 \r
-       private List<NXCObject> extractAllObjects(NXCSession session, NXCObject object)\r
+       private List<GenericObject> extractAllObjects(NXCSession session, GenericObject object)\r
        {\r
-               final List<NXCObject> ret = new ArrayList<NXCObject>(0);\r
+               final List<GenericObject> ret = new ArrayList<GenericObject>(0);\r
 \r
                ret.add(object);\r
 \r
@@ -246,7 +246,7 @@ public class ObjectSelectionDialog extends Dialog
                while(it.hasNext())\r
                {\r
                        final Long childId = it.next();\r
-                       final NXCObject child = session.findObjectById(childId);\r
+                       final GenericObject child = session.findObjectById(childId);\r
                        if (child != null)\r
                        {\r
                                ret.addAll(extractAllObjects(session, child));\r
index 9429da1..a0f8824 100644 (file)
@@ -5,7 +5,7 @@ package org.netxms.ui.eclipse.objectbrowser.widgets;
 \r
 import org.eclipse.jface.window.Window;\r
 import org.eclipse.swt.widgets.Composite;\r
-import org.netxms.client.NXCObject;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.eclipse.objectbrowser.dialogs.ObjectSelectionDialog;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 import org.netxms.ui.eclipse.widgets.AbstractSelector;\r
@@ -17,7 +17,7 @@ import org.netxms.ui.eclipse.widgets.AbstractSelector;
 public class ObjectSelector extends AbstractSelector\r
 {\r
        private long objectId = 0;\r
-       private int objectClass = NXCObject.OBJECT_NODE;\r
+       private int objectClass = GenericObject.OBJECT_NODE;\r
        \r
        /**\r
         * @param parent\r
@@ -39,7 +39,7 @@ public class ObjectSelector extends AbstractSelector
                dlg.enableMultiSelection(false);\r
                if (dlg.open() == Window.OK)\r
                {\r
-                       NXCObject[] objects = dlg.getAllCheckedObjects(objectClass);\r
+                       GenericObject[] objects = dlg.getAllCheckedObjects(objectClass);\r
                        if (objects.length > 0)\r
                        {\r
                                objectId = objects[0].getObjectId();\r
@@ -73,7 +73,7 @@ public class ObjectSelector extends AbstractSelector
                }\r
                else\r
                {\r
-                       final NXCObject object = NXMCSharedData.getInstance().getSession().findObjectById(objectId);\r
+                       final GenericObject object = NXMCSharedData.getInstance().getSession().findObjectById(objectId);\r
                        setText((object != null) ? object.getObjectName() : "<unknown>");\r
                }\r
        }\r
index 011c9c7..dbd3318 100644 (file)
@@ -33,8 +33,8 @@ import org.eclipse.ui.model.WorkbenchLabelProvider;
 import org.eclipse.ui.progress.UIJob;\r
 import org.netxms.client.NXCListener;\r
 import org.netxms.client.NXCNotification;\r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.NXCSession;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.eclipse.objectbrowser.Messages;\r
 import org.netxms.ui.eclipse.objectbrowser.widgets.internal.ObjectTreeComparator;\r
 import org.netxms.ui.eclipse.objectbrowser.widgets.internal.ObjectTreeContentProvider;\r
@@ -90,11 +90,11 @@ public class ObjectTree extends Composite
                        {\r
                                filter.setFilterString(filterText.getText());\r
                                objectTree.refresh(false);\r
-                               NXCObject obj = filter.getLastMatch();\r
+                               GenericObject obj = filter.getLastMatch();\r
                                if (obj != null)\r
                                {\r
                                        objectTree.setSelection(new StructuredSelection(obj), true);\r
-                                       NXCObject parent = filter.getParent(obj);\r
+                                       GenericObject parent = filter.getParent(obj);\r
                                        if (parent != null)\r
                                                objectTree.expandToLevel(parent, 1);\r
                                        objectTree.reveal(obj);\r
@@ -161,7 +161,7 @@ public class ObjectTree extends Composite
                                boolean isChecked = item.getChecked();\r
                                checkItems(item, isChecked);\r
                                checkPath(item.getParentItem(), isChecked, false);\r
-                               Long id = ((NXCObject)item.getData()).getObjectId();\r
+                               Long id = ((GenericObject)item.getData()).getObjectId();\r
                                if (isChecked)\r
                                        checkedObjects.add(id);\r
                                else\r
@@ -302,7 +302,7 @@ public class ObjectTree extends Composite
                Object[] elements = objectTree.getExpandedElements();\r
                expandedElements = new long[elements.length];\r
                for(int i = 0; i < elements.length; i++)\r
-                       expandedElements[i] = ((NXCObject)elements[i]).getObjectId();\r
+                       expandedElements[i] = ((GenericObject)elements[i]).getObjectId();\r
        }\r
        \r
        /**\r
@@ -313,7 +313,7 @@ public class ObjectTree extends Composite
                if (expandedElements == null)\r
                        return;\r
                \r
-               NXCObject[] objects = session.findMultipleObjects(expandedElements);\r
+               GenericObject[] objects = session.findMultipleObjects(expandedElements);\r
                objectTree.setExpandedElements(objects);\r
        }\r
        \r
@@ -327,6 +327,6 @@ public class ObjectTree extends Composite
                IStructuredSelection selection = (IStructuredSelection)objectTree.getSelection();\r
                if (selection.isEmpty())\r
                        return 0;\r
-               return ((NXCObject)selection.getFirstElement()).getObjectId();\r
+               return ((GenericObject)selection.getFirstElement()).getObjectId();\r
        }\r
 }\r
index beb588c..8c9b91a 100644 (file)
@@ -5,7 +5,7 @@ package org.netxms.ui.eclipse.objectbrowser.widgets.internal;
 \r
 import org.eclipse.jface.viewers.Viewer;\r
 import org.eclipse.jface.viewers.ViewerFilter;\r
-import org.netxms.client.NXCObject;\r
+import org.netxms.client.objects.GenericObject;\r
 \r
 /**\r
  * @author Victor\r
@@ -24,7 +24,7 @@ public class ObjectListFilter extends ViewerFilter
                if (filterString == null)\r
                        return true;\r
                \r
-               return ((NXCObject)element).getObjectName().toLowerCase().startsWith(filterString);\r
+               return ((GenericObject)element).getObjectName().toLowerCase().startsWith(filterString);\r
        }\r
        \r
        \r
index 19a85d4..532588d 100644 (file)
@@ -5,7 +5,7 @@ package org.netxms.ui.eclipse.objectbrowser.widgets.internal;
 \r
 import org.eclipse.jface.viewers.Viewer;\r
 import org.eclipse.jface.viewers.ViewerComparator;\r
-import org.netxms.client.NXCObject;\r
+import org.netxms.client.objects.GenericObject;\r
 \r
 /**\r
  * @author Victor\r
@@ -23,11 +23,11 @@ public class ObjectTreeComparator extends ViewerComparator
        @Override\r
        public int category(Object element)\r
        {\r
-               if (((NXCObject)element).getObjectId() < 10)\r
-                       return (int)((NXCObject)element).getObjectId();\r
-               if ((((NXCObject)element).getObjectClass() == NXCObject.OBJECT_CONTAINER) ||\r
-                   (((NXCObject)element).getObjectClass() == NXCObject.OBJECT_TEMPLATEGROUP) ||\r
-                   (((NXCObject)element).getObjectClass() == NXCObject.OBJECT_POLICYGROUP))\r
+               if (((GenericObject)element).getObjectId() < 10)\r
+                       return (int)((GenericObject)element).getObjectId();\r
+               if ((((GenericObject)element).getObjectClass() == GenericObject.OBJECT_CONTAINER) ||\r
+                   (((GenericObject)element).getObjectClass() == GenericObject.OBJECT_TEMPLATEGROUP) ||\r
+                   (((GenericObject)element).getObjectClass() == GenericObject.OBJECT_POLICYGROUP))\r
                        return CATEGORY_CONTAINER;\r
                return CATEGORY_OTHER;\r
        }\r
index 725a345..f4889bf 100644 (file)
@@ -7,7 +7,8 @@ import java.util.Iterator;
 \r
 import org.eclipse.jface.viewers.TreeNodeContentProvider;\r
 import org.eclipse.jface.viewers.Viewer;\r
-import org.netxms.client.*;\r
+import org.netxms.client.NXCSession;\r
+import org.netxms.client.objects.GenericObject;\r
 \r
 /**\r
  * @author Victor\r
@@ -30,7 +31,7 @@ public class ObjectTreeContentProvider extends TreeNodeContentProvider
        @Override\r
        public Object[] getChildren(Object parentElement)\r
        {\r
-               return ((NXCObject)parentElement).getChildsAsArray();\r
+               return ((GenericObject)parentElement).getChildsAsArray();\r
        }\r
 \r
        /* (non-Javadoc)\r
@@ -43,7 +44,7 @@ public class ObjectTreeContentProvider extends TreeNodeContentProvider
                {\r
                        return (rootObjects != null) ? session.findMultipleObjects(rootObjects) : session.getTopLevelObjects();\r
                }\r
-               return new NXCObject[0];\r
+               return new GenericObject[0];\r
        }\r
 \r
        /* (non-Javadoc)\r
@@ -55,7 +56,7 @@ public class ObjectTreeContentProvider extends TreeNodeContentProvider
                if (session == null)\r
                        return null;\r
                \r
-               Iterator<Long> it = ((NXCObject)element).getParents();\r
+               Iterator<Long> it = ((GenericObject)element).getParents();\r
                return it.hasNext() ? session.findObjectById(it.next()) : null;\r
        }\r
 \r
@@ -65,7 +66,7 @@ public class ObjectTreeContentProvider extends TreeNodeContentProvider
        @Override\r
        public boolean hasChildren(Object element)\r
        {\r
-               return ((NXCObject)element).getNumberOfChilds() > 0;\r
+               return ((GenericObject)element).getNumberOfChilds() > 0;\r
        }\r
 \r
        /* (non-Javadoc)\r
index 73d7b68..9c718ca 100644 (file)
@@ -10,7 +10,7 @@ import java.util.Set;
 \r
 import org.eclipse.jface.viewers.Viewer;\r
 import org.eclipse.jface.viewers.ViewerFilter;\r
-import org.netxms.client.NXCObject;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 \r
 /**\r
@@ -20,8 +20,8 @@ import org.netxms.ui.eclipse.shared.NXMCSharedData;
 public class ObjectTreeFilter extends ViewerFilter\r
 {\r
        private String filterString = null;\r
-       private Map<Long, NXCObject> objectList = null;\r
-       private NXCObject lastMatch = null;\r
+       private Map<Long, GenericObject> objectList = null;\r
+       private GenericObject lastMatch = null;\r
        private long[] rootObjects = null;\r
        private Set<Integer> classFilter = null;\r
        \r
@@ -46,21 +46,21 @@ public class ObjectTreeFilter extends ViewerFilter
        {\r
                if (classFilter != null)\r
                {\r
-                       if (!classFilter.contains(((NXCObject)element).getObjectClass()))\r
+                       if (!classFilter.contains(((GenericObject)element).getObjectClass()))\r
                                return false;\r
                }\r
                \r
                if (objectList == null)\r
                        return true;\r
 \r
-               boolean pass = objectList.containsKey(((NXCObject)element).getObjectId());\r
-               if (!pass && (((NXCObject)element).getNumberOfChilds() > 0))\r
+               boolean pass = objectList.containsKey(((GenericObject)element).getObjectId());\r
+               if (!pass && (((GenericObject)element).getNumberOfChilds() > 0))\r
                {\r
-                       Iterator<NXCObject> it = objectList.values().iterator();\r
+                       Iterator<GenericObject> it = objectList.values().iterator();\r
                        while(it.hasNext())\r
                        {\r
-                               NXCObject obj = it.next();\r
-                               if (obj.isChildOf(((NXCObject)element).getObjectId()))\r
+                               GenericObject obj = it.next();\r
+                               if (obj.isChildOf(((GenericObject)element).getObjectId()))\r
                                {\r
                                        pass = true;\r
                                        break;\r
@@ -94,8 +94,8 @@ public class ObjectTreeFilter extends ViewerFilter
                {\r
                        if (doFullSearch)\r
                        {\r
-                               NXCObject[] fullList = NXMCSharedData.getInstance().getSession().getAllObjects();\r
-                               objectList = new HashMap<Long, NXCObject>();\r
+                               GenericObject[] fullList = NXMCSharedData.getInstance().getSession().getAllObjects();\r
+                               objectList = new HashMap<Long, GenericObject>();\r
                                for(int i = 0; i < fullList.length; i++)\r
                                        if ((fullList[i].getObjectName().toLowerCase().startsWith(filterString)) &&\r
                                            ((rootObjects == null) || fullList[i].isChildOf(rootObjects)))\r
@@ -107,10 +107,10 @@ public class ObjectTreeFilter extends ViewerFilter
                        else\r
                        {\r
                                lastMatch = null;\r
-                               Iterator<NXCObject> it = objectList.values().iterator();\r
+                               Iterator<GenericObject> it = objectList.values().iterator();\r
                                while(it.hasNext())\r
                                {\r
-                                       NXCObject obj = it.next();\r
+                                       GenericObject obj = it.next();\r
                                        if (!obj.getObjectName().toLowerCase().startsWith(filterString))\r
                                                it.remove();\r
                                        else\r
@@ -129,7 +129,7 @@ public class ObjectTreeFilter extends ViewerFilter
         * Get last matched object\r
         * @return Last matched object\r
         */\r
-       public final NXCObject getLastMatch()\r
+       public final GenericObject getLastMatch()\r
        {\r
                return lastMatch;\r
        }\r
@@ -137,10 +137,10 @@ public class ObjectTreeFilter extends ViewerFilter
        /**\r
         * Get parent for given object\r
         */\r
-       public NXCObject getParent(final NXCObject childObject)\r
+       public GenericObject getParent(final GenericObject childObject)\r
        {\r
-               NXCObject[] parents = childObject.getParentsAsArray();\r
-               for(NXCObject object : parents)\r
+               GenericObject[] parents = childObject.getParentsAsArray();\r
+               for(GenericObject object : parents)\r
                {\r
                        if (object != null)\r
                        {\r
index 59a42b1..be6a16a 100644 (file)
@@ -10,7 +10,7 @@
               class="org.netxms.ui.eclipse.objectmanager.propertypages.General">\r
           <enabledWhen>\r
              <instanceof\r
-                  value="org.netxms.client.NXCObject">\r
+                  value="org.netxms.client.objects.GenericObject">\r
              </instanceof>\r
           </enabledWhen>\r
         </page>\r
@@ -21,7 +21,7 @@
               class="org.netxms.ui.eclipse.objectmanager.propertypages.CustomAttributes">\r
           <enabledWhen>\r
              <instanceof\r
-                  value="org.netxms.client.NXCObject">\r
+                  value="org.netxms.client.objects.GenericObject">\r
              </instanceof>\r
           </enabledWhen>\r
         </page>\r
@@ -32,7 +32,7 @@
               class="org.netxms.ui.eclipse.objectmanager.propertypages.Comments">\r
           <enabledWhen>\r
              <instanceof\r
-                  value="org.netxms.client.NXCObject">\r
+                  value="org.netxms.client.objects.GenericObject">\r
              </instanceof>\r
           </enabledWhen>\r
         </page>\r
@@ -43,7 +43,7 @@
               class="org.netxms.ui.eclipse.objectmanager.propertypages.AccessControl">\r
           <enabledWhen>\r
              <instanceof\r
-                  value="org.netxms.client.NXCObject">\r
+                  value="org.netxms.client.objects.GenericObject">\r
              </instanceof>\r
           </enabledWhen>\r
         </page>\r
@@ -54,7 +54,7 @@
               class="org.netxms.ui.eclipse.objectmanager.propertypages.AutoApply">\r
           <enabledWhen>\r
              <instanceof\r
-                  value="org.netxms.client.NXCTemplate">\r
+                  value="org.netxms.client.objects.Template">\r
              </instanceof>\r
           </enabledWhen>\r
         </page>\r
@@ -65,7 +65,7 @@
               class="org.netxms.ui.eclipse.objectmanager.propertypages.AutoBind">\r
           <enabledWhen>\r
              <instanceof\r
-                  value="org.netxms.client.NXCContainer">\r
+                  value="org.netxms.client.objects.Container">\r
              </instanceof>\r
           </enabledWhen>\r
         </page>\r
@@ -76,7 +76,7 @@
               class="org.netxms.ui.eclipse.objectmanager.propertypages.Communication">\r
           <enabledWhen>\r
              <instanceof\r
-                  value="org.netxms.client.NXCNode">\r
+                  value="org.netxms.client.objects.Node">\r
              </instanceof>\r
           </enabledWhen>\r
         </page>\r
@@ -87,7 +87,7 @@
               class="org.netxms.ui.eclipse.objectmanager.propertypages.TrustedNodes">\r
           <enabledWhen>\r
              <instanceof\r
-                  value="org.netxms.client.NXCNode">\r
+                  value="org.netxms.client.objects.Node">\r
              </instanceof>\r
           </enabledWhen>\r
         </page>\r
@@ -97,7 +97,7 @@
          point="org.eclipse.ui.popupMenus">\r
       <objectContribution\r
             id="org.netxms.ui.eclipse.objectmanager.actions.popup.object.delete"\r
-            objectClass="org.netxms.client.NXCObject">\r
+            objectClass="org.netxms.client.objects.GenericObject">\r
          <action\r
                class="org.netxms.ui.eclipse.objectmanager.actions.DeleteObject"\r
                enablesFor="+"\r
 \r
       <objectContribution\r
             id="org.netxms.ui.eclipse.objectmanager.actions.popup.object.bind_NXCContainer"\r
-            objectClass="org.netxms.client.NXCContainer">\r
+            objectClass="org.netxms.client.objects.Container">\r
          <action\r
                class="org.netxms.ui.eclipse.objectmanager.actions.BindObject"\r
                enablesFor="1"\r
 \r
       <objectContribution\r
             id="org.netxms.ui.eclipse.objectmanager.actions.popup.object.bind_NXCServiceRoot"\r
-            objectClass="org.netxms.client.NXCServiceRoot">\r
+            objectClass="org.netxms.client.objects.ServiceRoot">\r
          <action\r
                class="org.netxms.ui.eclipse.objectmanager.actions.BindObject"\r
                enablesFor="1"\r
 \r
       <objectContribution\r
             id="org.netxms.ui.eclipse.objectmanager.actions.popup.object.changeIpAddress"\r
-            objectClass="org.netxms.client.NXCNode">\r
+            objectClass="org.netxms.client.objects.Node">\r
          <action\r
                class="org.netxms.ui.eclipse.objectmanager.actions.ChangeIpAddress"\r
                enablesFor="1"\r
 \r
       <objectContribution\r
             id="org.netxms.ui.eclipse.objectmanager.actions.popup.object.unmanage"\r
-            objectClass="org.netxms.client.NXCObject">\r
+            objectClass="org.netxms.client.objects.GenericObject">\r
          <action\r
                class="org.netxms.ui.eclipse.objectmanager.actions.Unmanage"\r
                enablesFor="+"\r
 \r
       <objectContribution\r
             id="org.netxms.ui.eclipse.objectmanager.actions.popup.object.manage"\r
-            objectClass="org.netxms.client.NXCObject">\r
+            objectClass="org.netxms.client.objects.GenericObject">\r
          <action\r
                class="org.netxms.ui.eclipse.objectmanager.actions.Manage"\r
                enablesFor="+"\r
index bdd0187..474fbd1 100644 (file)
@@ -8,7 +8,7 @@ import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerComparator;\r
 import org.eclipse.swt.SWT;\r
 import org.eclipse.swt.widgets.TableColumn;\r
-import org.netxms.client.NXCObject;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.eclipse.objectmanager.propertypages.TrustedNodes;\r
 \r
 /**\r
@@ -30,7 +30,7 @@ public class TrustedNodesComparator extends ViewerComparator
                int rc;\r
                if ((Integer)sortColumn.getData("ID") == TrustedNodes.COLUMN_NAME)\r
                {\r
-                       rc =  ((NXCObject)e1).getObjectName().compareToIgnoreCase(((NXCObject)e2).getObjectName());\r
+                       rc =  ((GenericObject)e1).getObjectName().compareToIgnoreCase(((GenericObject)e2).getObjectName());\r
                }\r
                else\r
                {\r
index 6d98133..aec265d 100644 (file)
@@ -8,7 +8,8 @@ import org.eclipse.jface.window.Window;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IObjectActionDelegate;
 import org.eclipse.ui.IWorkbenchPart;
-import org.netxms.client.*;
+import org.netxms.client.objects.Container;
+import org.netxms.client.objects.ServiceRoot;
 import org.netxms.ui.eclipse.objectbrowser.dialogs.ObjectSelectionDialog;
 
 public class BindObject implements IObjectActionDelegate
@@ -51,7 +52,7 @@ public class BindObject implements IObjectActionDelegate
                if (selection instanceof IStructuredSelection)
                {
                        Object obj = ((IStructuredSelection)selection).getFirstElement();
-                       action.setEnabled((obj instanceof NXCServiceRoot) || (obj instanceof NXCContainer));
+                       action.setEnabled((obj instanceof ServiceRoot) || (obj instanceof Container));
                }
        }
 }
index e6fd5fa..26b25ee 100644 (file)
@@ -14,8 +14,8 @@ import org.eclipse.ui.IObjectActionDelegate;
 import org.eclipse.ui.IWorkbenchPart;\r
 import org.eclipse.ui.IWorkbenchWindow;\r
 import org.netxms.client.NXCException;\r
-import org.netxms.client.NXCNode;\r
 import org.netxms.client.NXCSession;\r
+import org.netxms.client.objects.Node;\r
 import org.netxms.ui.eclipse.objectmanager.Activator;\r
 import org.netxms.ui.eclipse.objectmanager.dialogs.EnterIpAddressDialog;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
@@ -23,7 +23,7 @@ import org.netxms.ui.eclipse.shared.NXMCSharedData;
 public class ChangeIpAddress implements IObjectActionDelegate\r
 {\r
        private IWorkbenchWindow window;\r
-       private NXCNode node;\r
+       private Node node;\r
 \r
        @Override\r
        public void setActivePart(IAction action, IWorkbenchPart targetPart)\r
@@ -72,9 +72,9 @@ public class ChangeIpAddress implements IObjectActionDelegate
                if (selection instanceof IStructuredSelection)\r
                {\r
                        final Object obj = ((IStructuredSelection)selection).getFirstElement();\r
-                       if (obj instanceof NXCNode)\r
+                       if (obj instanceof Node)\r
                        {\r
-                               node = (NXCNode)obj;\r
+                               node = (Node)obj;\r
                        }\r
                        else\r
                        {\r
index eaa7090..d45b8f3 100644 (file)
@@ -2,7 +2,7 @@ package org.netxms.ui.eclipse.objectmanager.actions;
 \r
 import org.eclipse.jface.dialogs.MessageDialog;\r
 import org.eclipse.jface.viewers.IStructuredSelection;\r
-import org.netxms.client.NXCObject;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.client.NXCSession;\r
 \r
 public class DeleteObject extends MultipleObjectAction\r
@@ -16,7 +16,7 @@ public class DeleteObject extends MultipleObjectAction
                String question;\r
                if (selection.size() == 1)\r
                {\r
-                       question = "Are you sure you want to delete '" + ((NXCObject)selection.getFirstElement()).getObjectName() + "'?";\r
+                       question = "Are you sure you want to delete '" + ((GenericObject)selection.getFirstElement()).getObjectName() + "'?";\r
                }\r
                else\r
                {\r
@@ -48,7 +48,7 @@ public class DeleteObject extends MultipleObjectAction
         * @see org.netxms.ui.eclipse.objectmanager.actions.MultipleObjectAction#runObjectAction(org.netxms.client.NXCSession, org.netxms.client.NXCObject)\r
         */\r
        @Override\r
-       protected void runObjectAction(NXCSession session, NXCObject object) throws Exception\r
+       protected void runObjectAction(NXCSession session, GenericObject object) throws Exception\r
        {\r
                session.deleteObject(object.getObjectId());\r
        }\r
index 21b1b78..e241a0b 100644 (file)
@@ -1,7 +1,7 @@
 package org.netxms.ui.eclipse.objectmanager.actions;\r
 \r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.NXCSession;\r
+import org.netxms.client.objects.GenericObject;\r
 \r
 public class Manage extends MultipleObjectAction\r
 {\r
@@ -18,7 +18,7 @@ public class Manage extends MultipleObjectAction
        }\r
 \r
        @Override\r
-       protected void runObjectAction(NXCSession session, NXCObject object) throws Exception\r
+       protected void runObjectAction(final NXCSession session, final GenericObject object) throws Exception\r
        {\r
                session.setObjectManaged(object.getObjectId(), true);\r
        }\r
index f679e68..097771e 100644 (file)
@@ -14,8 +14,8 @@ import org.eclipse.ui.IObjectActionDelegate;
 import org.eclipse.ui.IWorkbenchPart;\r
 import org.eclipse.ui.IWorkbenchWindow;\r
 import org.netxms.client.NXCException;\r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.NXCSession;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.eclipse.objectmanager.Activator;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 \r
@@ -43,7 +43,7 @@ public abstract class MultipleObjectAction implements IObjectActionDelegate
         * \r
         * @throws Exception\r
         */\r
-       abstract protected void runObjectAction(final NXCSession session, final NXCObject object) throws Exception;\r
+       abstract protected void runObjectAction(final NXCSession session, final GenericObject object) throws Exception;\r
        \r
        /**\r
         * Hook for possible confirmation. Default implementation always returns true.\r
@@ -77,10 +77,10 @@ public abstract class MultipleObjectAction implements IObjectActionDelegate
                if (!confirm())\r
                        return;\r
                \r
-               Iterator<NXCObject> it = selection.iterator();\r
+               Iterator<GenericObject> it = selection.iterator();\r
                while(it.hasNext())\r
                {\r
-                       final NXCObject object = it.next();\r
+                       final GenericObject object = it.next();\r
                        new Job(jobDescription() + " " + object.getObjectName() + " [" + object.getObjectId() + "]") {\r
                                @Override\r
                                protected IStatus run(IProgressMonitor monitor)\r
index 76bbc94..b9c772b 100644 (file)
@@ -1,7 +1,7 @@
 package org.netxms.ui.eclipse.objectmanager.actions;\r
 \r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.NXCSession;\r
+import org.netxms.client.objects.GenericObject;\r
 \r
 public class Unmanage extends MultipleObjectAction\r
 {\r
@@ -18,7 +18,7 @@ public class Unmanage extends MultipleObjectAction
        }\r
 \r
        @Override\r
-       protected void runObjectAction(NXCSession session, NXCObject object) throws Exception\r
+       protected void runObjectAction(NXCSession session, GenericObject object) throws Exception\r
        {\r
                session.setObjectManaged(object.getObjectId(), false);\r
        }\r
index 39e0752..02ab795 100644 (file)
@@ -31,9 +31,9 @@ import org.eclipse.ui.dialogs.PropertyPage;
 import org.eclipse.ui.progress.UIJob;\r
 import org.netxms.client.NXCAccessListElement;\r
 import org.netxms.client.NXCException;\r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.NXCObjectModificationData;\r
 import org.netxms.client.NXCUserDBObject;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.eclipse.objectmanager.AccessListComparator;\r
 import org.netxms.ui.eclipse.objectmanager.AccessListLabelProvider;\r
 import org.netxms.ui.eclipse.objectmanager.Activator;\r
@@ -48,7 +48,7 @@ import org.netxms.ui.eclipse.usermanager.dialogs.SelectUserDialog;
  */\r
 public class AccessControl extends PropertyPage\r
 {\r
-       private NXCObject object;\r
+       private GenericObject object;\r
        private SortableTableViewer userList;\r
        private HashMap<Integer, Button> accessChecks = new HashMap<Integer, Button>(11);\r
        private HashMap<Long, NXCAccessListElement> acl;\r
@@ -59,7 +59,7 @@ public class AccessControl extends PropertyPage
        @Override\r
        protected Control createContents(Composite parent)\r
        {\r
-               object = (NXCObject)getElement().getAdapter(NXCObject.class);\r
+               object = (GenericObject)getElement().getAdapter(GenericObject.class);\r
                \r
                NXCAccessListElement[] origAcl = object.getAccessList();\r
                acl = new HashMap<Long, NXCAccessListElement>(origAcl.length);\r
index 2fc091b..57804a1 100644 (file)
@@ -22,7 +22,7 @@ import org.eclipse.ui.dialogs.PropertyPage;
 import org.eclipse.ui.progress.UIJob;\r
 import org.netxms.client.NXCException;\r
 import org.netxms.client.NXCObjectModificationData;\r
-import org.netxms.client.NXCTemplate;\r
+import org.netxms.client.objects.Template;\r
 import org.netxms.ui.eclipse.objectmanager.Activator;\r
 import org.netxms.ui.eclipse.shared.IUIConstants;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
@@ -34,7 +34,7 @@ import org.netxms.ui.eclipse.tools.WidgetHelper;
  */\r
 public class AutoApply extends PropertyPage\r
 {\r
-       private NXCTemplate object;\r
+       private Template object;\r
        private Button checkboxEnable;\r
        private Text filterSource;\r
        private boolean initialApplyFlag;\r
@@ -48,7 +48,7 @@ public class AutoApply extends PropertyPage
        {\r
                Composite dialogArea = new Composite(parent, SWT.NONE);\r
                \r
-               object = (NXCTemplate)getElement().getAdapter(NXCTemplate.class);\r
+               object = (Template)getElement().getAdapter(Template.class);\r
                if (object == null)     // Paranoid check\r
                        return dialogArea;\r
                \r
index 9d8323a..06cf551 100644 (file)
@@ -20,9 +20,9 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;\r
 import org.eclipse.ui.dialogs.PropertyPage;\r
 import org.eclipse.ui.progress.UIJob;\r
-import org.netxms.client.NXCContainer;\r
 import org.netxms.client.NXCException;\r
 import org.netxms.client.NXCObjectModificationData;\r
+import org.netxms.client.objects.Container;\r
 import org.netxms.ui.eclipse.objectmanager.Activator;\r
 import org.netxms.ui.eclipse.shared.IUIConstants;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
@@ -34,7 +34,7 @@ import org.netxms.ui.eclipse.tools.WidgetHelper;
  */\r
 public class AutoBind extends PropertyPage\r
 {\r
-       private NXCContainer object;\r
+       private Container object;\r
        private Button checkboxEnable;\r
        private Text filterSource;\r
        private boolean initialAutoBindFlag;\r
@@ -48,7 +48,7 @@ public class AutoBind extends PropertyPage
        {\r
                Composite dialogArea = new Composite(parent, SWT.NONE);\r
                \r
-               object = (NXCContainer)getElement().getAdapter(NXCContainer.class);\r
+               object = (Container)getElement().getAdapter(Container.class);\r
                if (object == null)     // Paranoid check\r
                        return dialogArea;\r
                \r
index 1c9a947..c3e37d7 100644 (file)
@@ -16,7 +16,7 @@ import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.dialogs.PropertyPage;\r
 import org.eclipse.ui.progress.UIJob;\r
 import org.netxms.client.NXCException;\r
-import org.netxms.client.NXCObject;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.eclipse.objectmanager.Activator;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 import org.netxms.ui.eclipse.tools.WidgetHelper;\r
@@ -27,7 +27,7 @@ import org.netxms.ui.eclipse.tools.WidgetHelper;
  */\r
 public class Comments extends PropertyPage\r
 {\r
-       private NXCObject object;\r
+       private GenericObject object;\r
        private Text comments;\r
        private String initialComments;\r
        \r
@@ -39,7 +39,7 @@ public class Comments extends PropertyPage
        {\r
                Composite dialogArea = new Composite(parent, SWT.NONE);\r
                \r
-               object = (NXCObject)getElement().getAdapter(NXCObject.class);\r
+               object = (GenericObject)getElement().getAdapter(GenericObject.class);\r
                initialComments = object.getComments();\r
                if (initialComments == null)\r
                        initialComments = "";\r
index ddf4e5c..2621b09 100644 (file)
@@ -23,8 +23,8 @@ import org.eclipse.swt.widgets.Group;
 import org.eclipse.ui.dialogs.PropertyPage;\r
 import org.eclipse.ui.progress.UIJob;\r
 import org.netxms.client.NXCException;\r
-import org.netxms.client.NXCNode;\r
 import org.netxms.client.NXCObjectModificationData;\r
+import org.netxms.client.objects.Node;\r
 import org.netxms.ui.eclipse.objectbrowser.widgets.ObjectSelector;\r
 import org.netxms.ui.eclipse.objectmanager.Activator;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
@@ -37,7 +37,7 @@ import org.netxms.ui.eclipse.widgets.LabeledText;
  */\r
 public class Communication extends PropertyPage\r
 {\r
-       private NXCNode node;\r
+       private Node node;\r
        private LabeledText agentPort;\r
        private LabeledText agentSharedSecret;\r
        private Combo agentAuthMethod;\r
@@ -57,7 +57,7 @@ public class Communication extends PropertyPage
        @Override\r
        protected Control createContents(Composite parent)\r
        {\r
-               node = (NXCNode)getElement().getAdapter(NXCNode.class);\r
+               node = (Node)getElement().getAdapter(Node.class);\r
 \r
                Composite dialogArea = new Composite(parent, SWT.NONE);\r
                GridLayout dialogLayout = new GridLayout();\r
@@ -122,7 +122,7 @@ public class Communication extends PropertyPage
                        @Override\r
                        public void widgetSelected(SelectionEvent e)\r
                        {\r
-                               agentSharedSecret.getTextControl().setEnabled(agentAuthMethod.getSelectionIndex() != NXCNode.AGENT_AUTH_NONE);\r
+                               agentSharedSecret.getTextControl().setEnabled(agentAuthMethod.getSelectionIndex() != Node.AGENT_AUTH_NONE);\r
                        }\r
                });\r
                \r
@@ -134,7 +134,7 @@ public class Communication extends PropertyPage
                fd.right = new FormAttachment(100, 0);\r
                fd.top = new FormAttachment(agentForceEncryption, 0, SWT.BOTTOM);\r
                agentSharedSecret.setLayoutData(fd);\r
-               agentSharedSecret.getTextControl().setEnabled(node.getAgentAuthMethod() != NXCNode.AGENT_AUTH_NONE);\r
+               agentSharedSecret.getTextControl().setEnabled(node.getAgentAuthMethod() != Node.AGENT_AUTH_NONE);\r
        \r
                // SNMP\r
                Group snmpGroup = new Group(dialogArea, SWT.NONE);\r
@@ -180,7 +180,7 @@ public class Communication extends PropertyPage
                snmpAuth.add("MD5");\r
                snmpAuth.add("SHA1");\r
                snmpAuth.select(node.getSnmpAuthMethod());\r
-               snmpAuth.setEnabled(node.getSnmpVersion() == NXCNode.SNMP_VERSION_3);\r
+               snmpAuth.setEnabled(node.getSnmpVersion() == Node.SNMP_VERSION_3);\r
                \r
                fd = new FormData();\r
                fd.left = new FormAttachment(snmpAuth.getParent(), 0, SWT.RIGHT);\r
@@ -190,7 +190,7 @@ public class Communication extends PropertyPage
                snmpPriv.add("DES");\r
                snmpPriv.add("AES");\r
                snmpPriv.select(node.getSnmpPrivMethod());\r
-               snmpPriv.setEnabled(node.getSnmpVersion() == NXCNode.SNMP_VERSION_3);\r
+               snmpPriv.setEnabled(node.getSnmpVersion() == Node.SNMP_VERSION_3);\r
                \r
                snmpProxy = new ObjectSelector(snmpGroup, SWT.NONE);\r
                snmpProxy.setLabel("Proxy");\r
@@ -202,7 +202,7 @@ public class Communication extends PropertyPage
                snmpProxy.setLayoutData(fd);\r
                \r
                snmpAuthName = new LabeledText(snmpGroup, SWT.NONE);\r
-               snmpAuthName.setLabel(node.getSnmpVersion() == NXCNode.SNMP_VERSION_3 ? "User name" : "Community string");\r
+               snmpAuthName.setLabel(node.getSnmpVersion() == Node.SNMP_VERSION_3 ? "User name" : "Community string");\r
                snmpAuthName.setText(node.getSnmpAuthName());\r
                fd = new FormData();\r
                fd.left = new FormAttachment(snmpProxy, 0, SWT.RIGHT);\r
@@ -218,7 +218,7 @@ public class Communication extends PropertyPage
                fd.top = new FormAttachment(snmpAuth.getParent(), 0, SWT.TOP);\r
                fd.right = new FormAttachment(100, 0);\r
                snmpAuthPassword.setLayoutData(fd);\r
-               snmpAuthPassword.getTextControl().setEnabled(node.getSnmpVersion() == NXCNode.SNMP_VERSION_3);\r
+               snmpAuthPassword.getTextControl().setEnabled(node.getSnmpVersion() == Node.SNMP_VERSION_3);\r
                \r
                snmpPrivPassword = new LabeledText(snmpGroup, SWT.NONE);\r
                snmpPrivPassword.setLabel("Encryption password");\r
@@ -228,7 +228,7 @@ public class Communication extends PropertyPage
                fd.top = new FormAttachment(snmpProxy, 0, SWT.TOP);\r
                fd.right = new FormAttachment(100, 0);\r
                snmpPrivPassword.setLayoutData(fd);\r
-               snmpPrivPassword.getTextControl().setEnabled(node.getSnmpVersion() == NXCNode.SNMP_VERSION_3);\r
+               snmpPrivPassword.getTextControl().setEnabled(node.getSnmpVersion() == Node.SNMP_VERSION_3);\r
                \r
                return dialogArea;\r
        }\r
@@ -243,11 +243,11 @@ public class Communication extends PropertyPage
        {\r
                switch(version)\r
                {\r
-                       case NXCNode.SNMP_VERSION_1:\r
+                       case Node.SNMP_VERSION_1:\r
                                return 0;\r
-                       case NXCNode.SNMP_VERSION_2C:\r
+                       case Node.SNMP_VERSION_2C:\r
                                return 1;\r
-                       case NXCNode.SNMP_VERSION_3:\r
+                       case Node.SNMP_VERSION_3:\r
                                return 2;\r
                }\r
                return 0;\r
@@ -258,7 +258,7 @@ public class Communication extends PropertyPage
         */\r
        private int snmpIndexToVersion(int index)\r
        {\r
-               final int[] versions = { NXCNode.SNMP_VERSION_1, NXCNode.SNMP_VERSION_2C, NXCNode.SNMP_VERSION_3 };\r
+               final int[] versions = { Node.SNMP_VERSION_1, Node.SNMP_VERSION_2C, Node.SNMP_VERSION_3 };\r
                return versions[index];\r
        }\r
        \r
index 0b19c25..443fd8c 100644 (file)
@@ -31,8 +31,8 @@ import org.eclipse.swt.widgets.Event;
 import org.eclipse.ui.dialogs.PropertyPage;\r
 import org.eclipse.ui.progress.UIJob;\r
 import org.netxms.client.NXCException;\r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.NXCObjectModificationData;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.eclipse.objectmanager.Activator;\r
 import org.netxms.ui.eclipse.objectmanager.AttrListLabelProvider;\r
 import org.netxms.ui.eclipse.objectmanager.AttrViewerComparator;\r
@@ -50,7 +50,7 @@ public class CustomAttributes extends PropertyPage
        public static final int COLUMN_NAME = 0;\r
        public static final int COLUMN_VALUE = 1;\r
        \r
-       private NXCObject object = null;\r
+       private GenericObject object = null;\r
        private SortableTableViewer viewer;\r
        private Button addButton;\r
        private Button editButton;\r
@@ -66,7 +66,7 @@ public class CustomAttributes extends PropertyPage
        {\r
                Composite dialogArea = new Composite(parent, SWT.NONE);\r
                \r
-               object = (NXCObject)getElement().getAdapter(NXCObject.class);\r
+               object = (GenericObject)getElement().getAdapter(GenericObject.class);\r
                if (object == null)     // Paranoid check\r
                        return dialogArea;\r
                \r
index 818a4b3..cd32409 100644 (file)
@@ -15,7 +15,7 @@ import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.dialogs.PropertyPage;\r
 import org.eclipse.ui.progress.UIJob;\r
 import org.netxms.client.NXCException;\r
-import org.netxms.client.NXCObject;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.eclipse.objectmanager.Activator;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 import org.netxms.ui.eclipse.tools.WidgetHelper;\r
@@ -28,7 +28,7 @@ public class General extends PropertyPage
 {\r
        private Text textName;\r
        private String initialName;\r
-       private NXCObject object;\r
+       private GenericObject object;\r
        \r
        /* (non-Javadoc)\r
         * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)\r
@@ -38,7 +38,7 @@ public class General extends PropertyPage
        {\r
                Composite dialogArea = new Composite(parent, SWT.NONE);\r
                \r
-               object = (NXCObject)getElement().getAdapter(NXCObject.class);\r
+               object = (GenericObject)getElement().getAdapter(GenericObject.class);\r
                if (object == null)     // Paranoid check\r
                        return dialogArea;\r
                \r
index 9e218a1..4fe8da2 100644 (file)
@@ -27,8 +27,8 @@ import org.eclipse.ui.dialogs.PropertyPage;
 import org.eclipse.ui.model.WorkbenchLabelProvider;\r
 import org.eclipse.ui.progress.UIJob;\r
 import org.netxms.client.NXCException;\r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.NXCObjectModificationData;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.eclipse.objectbrowser.dialogs.ObjectSelectionDialog;\r
 import org.netxms.ui.eclipse.objectmanager.Activator;\r
 import org.netxms.ui.eclipse.objectmanager.TrustedNodesComparator;\r
@@ -44,11 +44,11 @@ public class TrustedNodes extends PropertyPage
 {\r
        public static final int COLUMN_NAME = 0;\r
        \r
-       private NXCObject object = null;\r
+       private GenericObject object = null;\r
        private SortableTableViewer viewer;\r
        private Button addButton;\r
        private Button deleteButton;\r
-       private HashMap<Long, NXCObject> trustedNodes = new HashMap<Long, NXCObject>(0);\r
+       private HashMap<Long, GenericObject> trustedNodes = new HashMap<Long, GenericObject>(0);\r
        private boolean isModified = false;\r
 \r
        /* (non-Javadoc)\r
@@ -59,7 +59,7 @@ public class TrustedNodes extends PropertyPage
        {\r
                Composite dialogArea = new Composite(parent, SWT.NONE);\r
                \r
-               object = (NXCObject)getElement().getAdapter(NXCObject.class);\r
+               object = (GenericObject)getElement().getAdapter(GenericObject.class);\r
                \r
                GridLayout layout = new GridLayout();\r
                layout.verticalSpacing = WidgetHelper.OUTER_SPACING;\r
@@ -75,7 +75,7 @@ public class TrustedNodes extends PropertyPage
       viewer.setLabelProvider(new WorkbenchLabelProvider());\r
       viewer.setComparator(new TrustedNodesComparator());\r
       \r
-      NXCObject[] nodes = object.getTrustedNodes();\r
+      GenericObject[] nodes = object.getTrustedNodes();\r
       for(int i = 0; i < nodes.length; i++)\r
        trustedNodes.put(nodes[i].getObjectId(), nodes[i]);\r
       viewer.setInput(nodes);\r
@@ -113,7 +113,7 @@ public class TrustedNodes extends PropertyPage
                                ObjectSelectionDialog dlg = new ObjectSelectionDialog(getShell(), null, ObjectSelectionDialog.createNodeSelectionFilter());\r
                                if (dlg.open() == Window.OK)\r
                                {\r
-                                       NXCObject[] nodes = dlg.getAllCheckedObjects(NXCObject.OBJECT_NODE);\r
+                                       GenericObject[] nodes = dlg.getAllCheckedObjects(GenericObject.OBJECT_NODE);\r
                              for(int i = 0; i < nodes.length; i++)\r
                                trustedNodes.put(nodes[i].getObjectId(), nodes[i]);\r
                              viewer.setInput(trustedNodes.values().toArray());\r
@@ -136,12 +136,12 @@ public class TrustedNodes extends PropertyPage
                        public void widgetSelected(SelectionEvent e)\r
                        {\r
                                IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();\r
-                               Iterator<NXCObject> it = selection.iterator();\r
+                               Iterator<GenericObject> it = selection.iterator();\r
                                if (it.hasNext())\r
                                {\r
                                        while(it.hasNext())\r
                                        {\r
-                                               NXCObject object = it.next();\r
+                                               GenericObject object = it.next();\r
                                                trustedNodes.remove(object.getObjectId());\r
                                        }\r
                              viewer.setInput(trustedNodes.values().toArray());\r
@@ -238,7 +238,7 @@ public class TrustedNodes extends PropertyPage
        protected void performDefaults()\r
        {\r
                trustedNodes.clear();\r
-               viewer.setInput(new NXCObject[0]);\r
+               viewer.setInput(new GenericObject[0]);\r
                isModified = true;\r
                super.performDefaults();\r
        }\r
index 59bd98b..fb1dfc5 100644 (file)
@@ -17,7 +17,7 @@
          point="org.eclipse.ui.popupMenus">\r
       <objectContribution\r
             id="org.netxms.ui.eclipse.objectview.actions.popup.object.lastvalues"\r
-            objectClass="org.netxms.client.NXCNode">\r
+            objectClass="org.netxms.client.objects.Node">\r
          <action\r
                class="org.netxms.ui.eclipse.objectview.actions.ShowLastValues"\r
                enablesFor="1"\r
index 04655cf..0a3a08a 100644 (file)
@@ -38,9 +38,9 @@ import org.eclipse.ui.part.ViewPart;
 import org.eclipse.ui.progress.IWorkbenchSiteProgressService;\r
 import org.eclipse.ui.progress.UIJob;\r
 import org.netxms.client.NXCException;\r
-import org.netxms.client.NXCNode;\r
 import org.netxms.client.NXCSession;\r
 import org.netxms.client.datacollection.DciValue;\r
+import org.netxms.client.objects.Node;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 import org.netxms.ui.eclipse.tools.SortableTableViewer;\r
 \r
@@ -59,11 +59,11 @@ public class LastValuesView extends Composite
        public static final int COLUMN_TIMESTAMP = 3;\r
        \r
        private final ViewPart viewPart;\r
-       private final NXCNode node;\r
+       private final Node node;\r
        private NXCSession session;\r
        private TableViewer dataViewer;\r
        \r
-       public LastValuesView(ViewPart viewPart, Composite parent, int style, NXCNode _node)\r
+       public LastValuesView(ViewPart viewPart, Composite parent, int style, Node _node)\r
        {\r
                super(parent, style);\r
                session = NXMCSharedData.getInstance().getSession();\r
index c1cdad4..15860c7 100644 (file)
@@ -12,7 +12,7 @@ import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchPart;\r
 import org.eclipse.ui.IWorkbenchWindow;\r
 import org.eclipse.ui.PartInitException;\r
-import org.netxms.client.NXCNode;\r
+import org.netxms.client.objects.Node;\r
 import org.netxms.ui.eclipse.objectview.views.LastValues;\r
 \r
 /**\r
@@ -22,7 +22,7 @@ import org.netxms.ui.eclipse.objectview.views.LastValues;
 public class ShowLastValues implements IObjectActionDelegate\r
 {\r
        private IWorkbenchWindow window;\r
-       private NXCNode node;\r
+       private Node node;\r
 \r
        /* (non-Javadoc)\r
         * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)\r
@@ -60,9 +60,9 @@ public class ShowLastValues implements IObjectActionDelegate
        {\r
                Object obj;\r
                if ((selection instanceof IStructuredSelection) &&\r
-                        ((obj = ((IStructuredSelection)selection).getFirstElement()) instanceof NXCNode))\r
+                        ((obj = ((IStructuredSelection)selection).getFirstElement()) instanceof Node))\r
                {\r
-                       node = (NXCNode)obj;\r
+                       node = (Node)obj;\r
                }\r
                else\r
                {\r
index 30f4868..f9c765c 100644 (file)
@@ -11,9 +11,9 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.IViewSite;\r
 import org.eclipse.ui.PartInitException;\r
 import org.eclipse.ui.part.ViewPart;\r
-import org.netxms.client.NXCNode;\r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.NXCSession;\r
+import org.netxms.client.objects.GenericObject;\r
+import org.netxms.client.objects.Node;\r
 import org.netxms.ui.eclipse.objectview.LastValuesView;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 \r
@@ -26,7 +26,7 @@ public class LastValues extends ViewPart
        public static final String ID = "org.netxms.ui.eclipse.objectview.view.last_values";\r
        \r
        private NXCSession session;\r
-       private NXCNode node;\r
+       private Node node;\r
        private LastValuesView dataView;\r
        \r
        /* (non-Javadoc)\r
@@ -38,8 +38,8 @@ public class LastValues extends ViewPart
                super.init(site);\r
                \r
                session = NXMCSharedData.getInstance().getSession();\r
-               NXCObject obj = session.findObjectById(Long.parseLong(site.getSecondaryId()));\r
-               node = ((obj != null) && (obj instanceof NXCNode)) ? (NXCNode)obj : null;\r
+               GenericObject obj = session.findObjectById(Long.parseLong(site.getSecondaryId()));\r
+               node = ((obj != null) && (obj instanceof Node)) ? (Node)obj : null;\r
                setPartName("Last Values - " + ((node != null) ? node.getObjectName() : "<error>"));\r
        }\r
 \r
index 189663b..54fbef1 100644 (file)
@@ -10,7 +10,7 @@
               class="org.netxms.ui.eclipse.policymanager.propertypages.Policy">\r
           <enabledWhen>\r
              <instanceof\r
-                  value="org.netxms.client.NXCAgentPolicy">\r
+                  value="org.netxms.client.objects.AgentPolicy">\r
              </instanceof>\r
           </enabledWhen>\r
         </page>\r
@@ -21,7 +21,7 @@
               class="org.netxms.ui.eclipse.policymanager.propertypages.ConfigFile">\r
           <enabledWhen>\r
              <instanceof\r
-                  value="org.netxms.client.NXCAgentPolicyConfig">\r
+                  value="org.netxms.client.objects.AgentPolicyConfig">\r
              </instanceof>\r
           </enabledWhen>\r
         </page>\r
@@ -31,7 +31,7 @@
          point="org.eclipse.ui.popupMenus">\r
       <objectContribution\r
             id="org.netxms.ui.eclipse.objectmanager.actions.popup.object.createPolicyGroup_NXCPolicyRoot"\r
-            objectClass="org.netxms.client.NXCPolicyRoot">\r
+            objectClass="org.netxms.client.objects.PolicyRoot">\r
          <action\r
                class="org.netxms.ui.eclipse.policymanager.actions.CreatePolicyGroup"\r
                enablesFor="1"\r
@@ -43,7 +43,7 @@
 \r
       <objectContribution\r
             id="org.netxms.ui.eclipse.objectmanager.actions.popup.object.createPolicyGroup_NXCPolicyGroup"\r
-            objectClass="org.netxms.client.NXCPolicyGroup">\r
+            objectClass="org.netxms.client.objects.PolicyGroup">\r
          <action\r
                class="org.netxms.ui.eclipse.policymanager.actions.CreatePolicyGroup"\r
                enablesFor="1"\r
@@ -55,7 +55,7 @@
 \r
       <objectContribution\r
             id="org.netxms.ui.eclipse.objectmanager.actions.popup.object.createAgentPolicyConfig_NXCPolicyRoot"\r
-            objectClass="org.netxms.client.NXCPolicyRoot">\r
+            objectClass="org.netxms.client.objects.PolicyRoot">\r
          <action\r
                class="org.netxms.ui.eclipse.policymanager.actions.CreateAgentPolicyConfig"\r
                enablesFor="1"\r
@@ -67,7 +67,7 @@
 \r
       <objectContribution\r
             id="org.netxms.ui.eclipse.objectmanager.actions.popup.object.createAgentPolicyConfig_NXCPolicyGroup"\r
-            objectClass="org.netxms.client.NXCPolicyGroup">\r
+            objectClass="org.netxms.client.objects.PolicyGroup">\r
          <action\r
                class="org.netxms.ui.eclipse.policymanager.actions.CreateAgentPolicyConfig"\r
                enablesFor="1"\r
@@ -79,7 +79,7 @@
 \r
       <objectContribution\r
             id="org.netxms.ui.eclipse.objectmanager.actions.popup.object.uninstallPolicy"\r
-            objectClass="org.netxms.client.NXCAgentPolicy">\r
+            objectClass="org.netxms.client.objects.AgentPolicy">\r
          <action\r
                class="org.netxms.ui.eclipse.policymanager.actions.UninstallPolicy"\r
                enablesFor="1"\r
@@ -91,7 +91,7 @@
 \r
       <objectContribution\r
             id="org.netxms.ui.eclipse.objectmanager.actions.popup.object.deployPolicy"\r
-            objectClass="org.netxms.client.NXCAgentPolicy">\r
+            objectClass="org.netxms.client.objects.AgentPolicy">\r
          <action\r
                class="org.netxms.ui.eclipse.policymanager.actions.DeployPolicy"\r
                enablesFor="1"\r
index f6c45c2..44bea11 100644 (file)
@@ -15,10 +15,10 @@ import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IObjectActionDelegate;\r
 import org.eclipse.ui.IWorkbenchPart;\r
 import org.netxms.client.NXCException;\r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.NXCObjectCreationData;\r
-import org.netxms.client.NXCPolicyGroup;\r
-import org.netxms.client.NXCPolicyRoot;\r
+import org.netxms.client.objects.GenericObject;\r
+import org.netxms.client.objects.PolicyGroup;\r
+import org.netxms.client.objects.PolicyRoot;\r
 import org.netxms.ui.eclipse.objectbrowser.dialogs.CreateObjectDialog;\r
 import org.netxms.ui.eclipse.policymanager.Activator;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
@@ -30,7 +30,7 @@ import org.netxms.ui.eclipse.shared.NXMCSharedData;
 public class CreateAgentPolicyConfig implements IObjectActionDelegate\r
 {\r
        private Shell shell;\r
-       private NXCObject currentObject;\r
+       private GenericObject currentObject;\r
        \r
        /* (non-Javadoc)\r
         * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)\r
@@ -57,7 +57,7 @@ public class CreateAgentPolicyConfig implements IObjectActionDelegate
                                        IStatus status;\r
                                        try\r
                                        {\r
-                                               NXCObjectCreationData cd = new NXCObjectCreationData(NXCObject.OBJECT_AGENTPOLICY_CONFIG, dlg.getObjectName(), currentObject.getObjectId());\r
+                                               NXCObjectCreationData cd = new NXCObjectCreationData(GenericObject.OBJECT_AGENTPOLICY_CONFIG, dlg.getObjectName(), currentObject.getObjectId());\r
                                                NXMCSharedData.getInstance().getSession().createObject(cd);\r
                                                status = Status.OK_STATUS;\r
                                        }\r
@@ -81,8 +81,8 @@ public class CreateAgentPolicyConfig implements IObjectActionDelegate
        {\r
                if (selection instanceof TreeSelection)\r
                {\r
-                       currentObject = (NXCObject)((TreeSelection)selection).getFirstElement();\r
-                       action.setEnabled((currentObject instanceof NXCPolicyRoot) || (currentObject instanceof NXCPolicyGroup));\r
+                       currentObject = (GenericObject)((TreeSelection)selection).getFirstElement();\r
+                       action.setEnabled((currentObject instanceof PolicyRoot) || (currentObject instanceof PolicyGroup));\r
                }\r
        }\r
 }\r
index 8ca9e94..b3da951 100644 (file)
@@ -15,10 +15,10 @@ import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IObjectActionDelegate;\r
 import org.eclipse.ui.IWorkbenchPart;\r
 import org.netxms.client.NXCException;\r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.NXCObjectCreationData;\r
-import org.netxms.client.NXCPolicyGroup;\r
-import org.netxms.client.NXCPolicyRoot;\r
+import org.netxms.client.objects.GenericObject;\r
+import org.netxms.client.objects.PolicyGroup;\r
+import org.netxms.client.objects.PolicyRoot;\r
 import org.netxms.ui.eclipse.objectbrowser.dialogs.CreateObjectDialog;\r
 import org.netxms.ui.eclipse.policymanager.Activator;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
@@ -30,7 +30,7 @@ import org.netxms.ui.eclipse.shared.NXMCSharedData;
 public class CreatePolicyGroup implements IObjectActionDelegate\r
 {\r
        private Shell shell;\r
-       private NXCObject currentObject;\r
+       private GenericObject currentObject;\r
        \r
        /* (non-Javadoc)\r
         * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)\r
@@ -57,7 +57,7 @@ public class CreatePolicyGroup implements IObjectActionDelegate
                                        IStatus status;\r
                                        try\r
                                        {\r
-                                               NXCObjectCreationData cd = new NXCObjectCreationData(NXCObject.OBJECT_POLICYGROUP, dlg.getObjectName(), currentObject.getObjectId());\r
+                                               NXCObjectCreationData cd = new NXCObjectCreationData(GenericObject.OBJECT_POLICYGROUP, dlg.getObjectName(), currentObject.getObjectId());\r
                                                NXMCSharedData.getInstance().getSession().createObject(cd);\r
                                                status = Status.OK_STATUS;\r
                                        }\r
@@ -81,8 +81,8 @@ public class CreatePolicyGroup implements IObjectActionDelegate
        {\r
                if (selection instanceof TreeSelection)\r
                {\r
-                       currentObject = (NXCObject)((TreeSelection)selection).getFirstElement();\r
-                       action.setEnabled((currentObject instanceof NXCPolicyRoot) || (currentObject instanceof NXCPolicyGroup));\r
+                       currentObject = (GenericObject)((TreeSelection)selection).getFirstElement();\r
+                       action.setEnabled((currentObject instanceof PolicyRoot) || (currentObject instanceof PolicyGroup));\r
                }\r
        }\r
 }\r
index aceb853..61e7024 100644 (file)
@@ -14,10 +14,10 @@ import org.eclipse.jface.window.Window;
 import org.eclipse.swt.widgets.Shell;\r
 import org.eclipse.ui.IObjectActionDelegate;\r
 import org.eclipse.ui.IWorkbenchPart;\r
-import org.netxms.client.NXCAgentPolicy;\r
 import org.netxms.client.NXCException;\r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.NXCSession;\r
+import org.netxms.client.objects.AgentPolicy;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.eclipse.objectbrowser.dialogs.ObjectSelectionDialog;\r
 import org.netxms.ui.eclipse.policymanager.Activator;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
@@ -29,7 +29,7 @@ import org.netxms.ui.eclipse.shared.NXMCSharedData;
 public class DeployPolicy implements IObjectActionDelegate\r
 {\r
        private Shell shell;\r
-       private NXCObject currentObject;\r
+       private GenericObject currentObject;\r
        \r
        /* (non-Javadoc)\r
         * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)\r
@@ -65,7 +65,7 @@ public class DeployPolicy implements IObjectActionDelegate
                                        try\r
                                        {\r
                                                NXCSession session = NXMCSharedData.getInstance().getSession();\r
-                                               NXCObject[] nodeList = dlg.getAllCheckedObjects(NXCObject.OBJECT_NODE);\r
+                                               GenericObject[] nodeList = dlg.getAllCheckedObjects(GenericObject.OBJECT_NODE);\r
                                                for(int i = 0; i < nodeList.length; i++)\r
                                                        session.deployAgentPolicy(currentObject.getObjectId(), nodeList[i].getObjectId());\r
                                                status = Status.OK_STATUS;\r
@@ -90,8 +90,8 @@ public class DeployPolicy implements IObjectActionDelegate
        {\r
                if (selection instanceof TreeSelection)\r
                {\r
-                       currentObject = (NXCObject)((TreeSelection)selection).getFirstElement();\r
-                       action.setEnabled(currentObject instanceof NXCAgentPolicy);\r
+                       currentObject = (GenericObject)((TreeSelection)selection).getFirstElement();\r
+                       action.setEnabled(currentObject instanceof AgentPolicy);\r
                }\r
        }\r
 }\r
index ccc7f1f..1317413 100644 (file)
@@ -14,10 +14,10 @@ import org.eclipse.jface.window.Window;
 import org.eclipse.swt.widgets.Shell;\r
 import org.eclipse.ui.IObjectActionDelegate;\r
 import org.eclipse.ui.IWorkbenchPart;\r
-import org.netxms.client.NXCAgentPolicy;\r
 import org.netxms.client.NXCException;\r
-import org.netxms.client.NXCObject;\r
 import org.netxms.client.NXCSession;\r
+import org.netxms.client.objects.AgentPolicy;\r
+import org.netxms.client.objects.GenericObject;\r
 import org.netxms.ui.eclipse.objectbrowser.dialogs.ObjectSelectionDialog;\r
 import org.netxms.ui.eclipse.policymanager.Activator;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
@@ -29,7 +29,7 @@ import org.netxms.ui.eclipse.shared.NXMCSharedData;
 public class UninstallPolicy implements IObjectActionDelegate\r
 {\r
        private Shell shell;\r
-       private NXCObject currentObject;\r
+       private GenericObject currentObject;\r
        \r
        /* (non-Javadoc)\r
         * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)\r
@@ -65,7 +65,7 @@ public class UninstallPolicy implements IObjectActionDelegate
                                        try\r
                                        {\r
                                                NXCSession session = NXMCSharedData.getInstance().getSession();\r
-                                               NXCObject[] nodeList = dlg.getAllCheckedObjects(NXCObject.OBJECT_NODE);\r
+                                               GenericObject[] nodeList = dlg.getAllCheckedObjects(GenericObject.OBJECT_NODE);\r
                                                for(int i = 0; i < nodeList.length; i++)\r
                                                        session.uninstallAgentPolicy(currentObject.getObjectId(), nodeList[i].getObjectId());\r
                                                status = Status.OK_STATUS;\r
@@ -90,8 +90,8 @@ public class UninstallPolicy implements IObjectActionDelegate
        {\r
                if (selection instanceof TreeSelection)\r
                {\r
-                       currentObject = (NXCObject)((TreeSelection)selection).getFirstElement();\r
-                       action.setEnabled(currentObject instanceof NXCAgentPolicy);\r
+                       currentObject = (GenericObject)((TreeSelection)selection).getFirstElement();\r
+                       action.setEnabled(currentObject instanceof AgentPolicy);\r
                }\r
        }\r
 }\r
index 6fd7ca6..c67749c 100644 (file)
@@ -16,9 +16,9 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;\r
 import org.eclipse.ui.dialogs.PropertyPage;\r
 import org.eclipse.ui.progress.UIJob;\r
-import org.netxms.client.NXCAgentPolicyConfig;\r
 import org.netxms.client.NXCException;\r
 import org.netxms.client.NXCObjectModificationData;\r
+import org.netxms.client.objects.AgentPolicyConfig;\r
 import org.netxms.ui.eclipse.policymanager.Activator;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 import org.netxms.ui.eclipse.tools.WidgetHelper;\r
@@ -33,7 +33,7 @@ public class ConfigFile extends PropertyPage
        private Text textContent;\r
        private String initialName;\r
        private String initialContent;\r
-       private NXCAgentPolicyConfig object;\r
+       private AgentPolicyConfig object;\r
        \r
        \r
        /* (non-Javadoc)\r
@@ -44,7 +44,7 @@ public class ConfigFile extends PropertyPage
        {\r
                Composite dialogArea = new Composite(parent, SWT.NONE);\r
                \r
-               object = (NXCAgentPolicyConfig)getElement().getAdapter(NXCAgentPolicyConfig.class);\r
+               object = (AgentPolicyConfig)getElement().getAdapter(AgentPolicyConfig.class);\r
                if (object == null)     // Paranoid check\r
                        return dialogArea;\r
                \r
index 0ec2d98..14fd24a 100644 (file)
@@ -14,9 +14,9 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Text;\r
 import org.eclipse.ui.dialogs.PropertyPage;\r
 import org.eclipse.ui.progress.UIJob;\r
-import org.netxms.client.NXCAgentPolicy;\r
 import org.netxms.client.NXCException;\r
 import org.netxms.client.NXCObjectModificationData;\r
+import org.netxms.client.objects.AgentPolicy;\r
 import org.netxms.ui.eclipse.policymanager.Activator;\r
 import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 import org.netxms.ui.eclipse.tools.WidgetHelper;\r
@@ -29,7 +29,7 @@ public class Policy extends PropertyPage
 {\r
        private Text textDescription;\r
        private String initialDescription;\r
-       private NXCAgentPolicy object;\r
+       private AgentPolicy object;\r
        \r
        \r
        /* (non-Javadoc)\r
@@ -40,7 +40,7 @@ public class Policy extends PropertyPage
        {\r
                Composite dialogArea = new Composite(parent, SWT.NONE);\r
                \r
-               object = (NXCAgentPolicy)getElement().getAdapter(NXCAgentPolicy.class);\r
+               object = (AgentPolicy)getElement().getAdapter(AgentPolicy.class);\r
                if (object == null)     // Paranoid check\r
                        return dialogArea;\r
                \r
index 355ba3e..dc4e4a1 100644 (file)
@@ -39,10 +39,10 @@ import org.eclipse.ui.progress.UIJob;
 import org.netxms.client.NXCException;
 import org.netxms.client.NXCListener;
 import org.netxms.client.NXCNotification;
-import org.netxms.client.NXCObject;
 import org.netxms.client.NXCServerJob;
 import org.netxms.client.NXCSession;
 import org.netxms.client.constants.RCC;
+import org.netxms.client.objects.GenericObject;
 import org.netxms.ui.eclipse.serverjobmanager.Activator;
 import org.netxms.ui.eclipse.shared.NXMCSharedData;
 import org.netxms.ui.eclipse.tools.RefreshAction;
@@ -119,7 +119,7 @@ public class ServerJobManager extends ViewPart
                                        case COLUMN_STATUS:
                                                return statusTexts.get(((NXCServerJob)obj).getStatus());
                                        case COLUMN_NODE:
-                                               NXCObject object = session.findObjectById(((NXCServerJob)obj).getNodeId());
+                                               GenericObject object = session.findObjectById(((NXCServerJob)obj).getNodeId());
                                                return (object != null) ? object.getObjectName() : "<unknown>";
                                        case COLUMN_DESCRIPTION:
                                                return ((NXCServerJob)obj).getDescription();
@@ -182,8 +182,8 @@ public class ServerJobManager extends ViewPart
                                        result = ((NXCServerJob)e1).getStatus() - ((NXCServerJob)e2).getStatus();
                                        break;
                                case COLUMN_NODE:
-                                       NXCObject object1 = session.findObjectById(((NXCServerJob)e1).getNodeId());
-                                       NXCObject object2 = session.findObjectById(((NXCServerJob)e2).getNodeId());
+                                       GenericObject object1 = session.findObjectById(((NXCServerJob)e1).getNodeId());
+                                       GenericObject object2 = session.findObjectById(((NXCServerJob)e2).getNodeId());
                                        String name1 = (object1 != null) ? object1.getObjectName() : "<unknown>";
                                        String name2 = (object2 != null) ? object2.getObjectName() : "<unknown>";
                                        result = name1.compareToIgnoreCase(name2);
index a4077bb..c6ad255 100644 (file)
@@ -333,7 +333,7 @@ public class UserManager extends ViewPart
        }\r
 \r
        /**\r
-        * Create pop-up menu for variable list\r
+        * Create pop-up menu for user list\r
         */\r
        private void createPopupMenu()\r
        {\r
index 4a2a299..ebe08a2 100644 (file)
@@ -48,6 +48,10 @@ public class LoginJob implements IRunnableWithProgress
                        session.syncUserDatabase();\r
                        monitor.worked(5);\r
                        \r
+                       monitor.setTaskName(Messages.getString("LoginJob.sync_event_db")); //$NON-NLS-1$\r
+                       session.syncEventTemplates();\r
+                       monitor.worked(5);\r
+                       \r
                        monitor.setTaskName(Messages.getString("LoginJob.subscribe")); //$NON-NLS-1$\r
                        session.subscribe(NXCSession.CHANNEL_ALARMS | NXCSession.CHANNEL_OBJECTS);\r
                        monitor.worked(5);\r
index b33ebf4..77c165b 100644 (file)
@@ -11,6 +11,7 @@ LoginDialog.server=Server:
 LoginDialog.title=NetXMS Console - Connect to Server\r
 LoginJob.connecting=Connecting...\r
 LoginJob.subscribe=Subscribing to notifications...\r
+LoginJob.sync_event_db=Synchronizing events configuration...\r
 LoginJob.sync_objects=Synchronizing objects...\r
 LoginJob.sync_users=Synchronizing user database...\r
 NXMCActionBarAdvisor.menu_configuration=&Configuration\r
index 275266a..7396b8d 100644 (file)
@@ -32,6 +32,7 @@ Export-Package: com.keypoint,
  org.netxms.client.events,
  org.netxms.client.log,
  org.netxms.client.maps,
+ org.netxms.client.objects,
  org.netxms.ui.eclipse.jobs,
  org.netxms.ui.eclipse.shared,
  org.netxms.ui.eclipse.tools,
index 2546ac0..5811680 100644 (file)
@@ -36,6 +36,7 @@ public class WidgetHelper
        public static int INNER_SPACING = 2;\r
        public static int OUTER_SPACING = 4;\r
        public static int BUTTON_WIDTH_HINT = 90;\r
+       public static int WIDE_BUTTON_WIDTH_HINT = 120;\r
        public static String DEFAULT_LAYOUT_DATA = "WidgetHelper::default_layout_data";\r
        \r
        \r