perfsonar-dev - r1489 - in trunk/perfsonar: ant ant/tops conf schema/example-instances/sonar schema/example-instances/sonar/TOPS schema/example-instances/sonar/TOPS/test src/org/perfsonar/service/topologyService src/org/perfsonar/service/web
Subject: perfsonar development work
List archive
r1489 - in trunk/perfsonar: ant ant/tops conf schema/example-instances/sonar schema/example-instances/sonar/TOPS schema/example-instances/sonar/TOPS/test src/org/perfsonar/service/topologyService src/org/perfsonar/service/web
Chronological Thread
- From:
- To:
- Subject: r1489 - in trunk/perfsonar: ant ant/tops conf schema/example-instances/sonar schema/example-instances/sonar/TOPS schema/example-instances/sonar/TOPS/test src/org/perfsonar/service/topologyService src/org/perfsonar/service/web
- Date: Thu, 27 Jul 2006 05:40:44 -0400
Author: ulisses.alonso
Date: 2006-07-27 05:40:43 -0400 (Thu, 27 Jul 2006)
New Revision: 1489
Added:
trunk/perfsonar/schema/example-instances/sonar/TOPS/
trunk/perfsonar/schema/example-instances/sonar/TOPS/test/
trunk/perfsonar/schema/example-instances/sonar/TOPS/test/TOPSDownloadDBRequest.xml
trunk/perfsonar/schema/example-instances/sonar/TOPS/test/TOPSDownloadDBResponse.xml
trunk/perfsonar/schema/example-instances/sonar/TOPS/test/Void.xml
Modified:
trunk/perfsonar/ant/build-tops.xml
trunk/perfsonar/ant/tops/tops-axis-deploy-targets.xml
trunk/perfsonar/ant/tops/tops-client-run-targets.xml
trunk/perfsonar/ant/tops/tops-java-compile-targets.xml
trunk/perfsonar/conf/components.properties.tops
trunk/perfsonar/conf/service.properties.tops
trunk/perfsonar/src/org/perfsonar/service/topologyService/TopServiceEngine.java
trunk/perfsonar/src/org/perfsonar/service/topologyService/TopsAction.java
trunk/perfsonar/src/org/perfsonar/service/topologyService/TopsDownloadDBAction.java
trunk/perfsonar/src/org/perfsonar/service/topologyService/TopsJDBCComponent.java
trunk/perfsonar/src/org/perfsonar/service/topologyService/TopsLSRegistrationComponent.java
trunk/perfsonar/src/org/perfsonar/service/web/RequestHandler.java
Log:
Large update.
Modified: trunk/perfsonar/ant/build-tops.xml
===================================================================
--- trunk/perfsonar/ant/build-tops.xml 2006-07-26 13:12:04 UTC (rev 1488)
+++ trunk/perfsonar/ant/build-tops.xml 2006-07-27 09:40:43 UTC (rev 1489)
@@ -45,7 +45,6 @@
<import file="java-compile-targets.xml"/>
<import file="axis-deploy-targets.xml"/>
-
<!-- dependencies -->
@@ -54,5 +53,6 @@
<import file="tops/tops-java-compile-targets.xml"/>
<import file="tops/tops-axis-deploy-targets.xml"/>
<import file="tops/tops-client-run-targets.xml"/>
+ <import file="tops/tops-test-run-targets.xml"/>
</project>
\ No newline at end of file
Modified: trunk/perfsonar/ant/tops/tops-axis-deploy-targets.xml
===================================================================
--- trunk/perfsonar/ant/tops/tops-axis-deploy-targets.xml 2006-07-26
13:12:04 UTC (rev 1488)
+++ trunk/perfsonar/ant/tops/tops-axis-deploy-targets.xml 2006-07-27
09:40:43 UTC (rev 1489)
@@ -25,10 +25,9 @@
<property name="adminService"
value="http://${target.server}:${target.port}/axis/services/AdminService" />
- <property name="deployFile"
value="../${build}/${wsdd.path}/${wsdd.file.deploy}" />
- <property name="undeployFile"
value="../${build}/${wsdd.path}/${wsdd.file.undeploy}" />
+ <!-- <property name="deployFile"
value="../${build}/${wsdd.path}/tops-service-deploy.wsdd" /> -->
+ <!-- <property name="undeployFile"
value="../${build}/${wsdd.path}/tops-service-undeploy.wsdd" /> -->
-
<target name="copy-jars-for-tops" depends="jar-tops">
<copy file="./lib/xml/jdom.jar"
todir="${axis.home}/WEB-INF/lib"/>
Modified: trunk/perfsonar/ant/tops/tops-client-run-targets.xml
===================================================================
--- trunk/perfsonar/ant/tops/tops-client-run-targets.xml 2006-07-26
13:12:04 UTC (rev 1488)
+++ trunk/perfsonar/ant/tops/tops-client-run-targets.xml 2006-07-27
09:40:43 UTC (rev 1489)
@@ -44,7 +44,7 @@
<arg value="${tops.test.server}"/>
<arg
value="${basedir}/schema/example-instances/sonar/TOPS/test/TOPSDownloadDBRequest.xml"/>
- <arg
value="${basedir}/schema/example-instances/sonar/TOPS/test/TOPSDownloadDBReply.xml"/>
+ <arg
value="${basedir}/schema/example-instances/sonar/TOPS/test/TOPSDownloadDBResponse.xml"/>
</java>
</target>
Modified: trunk/perfsonar/ant/tops/tops-java-compile-targets.xml
===================================================================
--- trunk/perfsonar/ant/tops/tops-java-compile-targets.xml 2006-07-26
13:12:04 UTC (rev 1488)
+++ trunk/perfsonar/ant/tops/tops-java-compile-targets.xml 2006-07-27
09:40:43 UTC (rev 1489)
@@ -47,6 +47,8 @@
<!-- TODO: include
name="org/perfsonar/client/testHarness/TopsTestClient.java" / -->
<classpath refid="classpath"/>
+
+ <compilerarg value="-Xlint:unchecked"/>
</javac>
<copy failonerror="false"
todir="${build}/${package.root}/${wsdd.home}">
Modified: trunk/perfsonar/conf/components.properties.tops
===================================================================
--- trunk/perfsonar/conf/components.properties.tops 2006-07-26 13:12:04
UTC (rev 1488)
+++ trunk/perfsonar/conf/components.properties.tops 2006-07-27 09:40:43
UTC (rev 1489)
@@ -12,6 +12,6 @@
# ---------------- Service specific components -------------------
tops_scheduler=org.perfsonar.commons.auxiliary.components.simplescheduler.Scheduler
-tops-registrator=org.perfsonar.service.topologyService.TopService.TopsLSRegistrationComponent
-tops-jdbc=org.perfsonar.service.topologyService.TopService.TopsJDBCComponent
+tops-registrator=org.perfsonar.service.topologyService.TopsLSRegistrationComponent
+tops-jdbc=org.perfsonar.service.topologyService.TopsJDBCComponent
Modified: trunk/perfsonar/conf/service.properties.tops
===================================================================
--- trunk/perfsonar/conf/service.properties.tops 2006-07-26 13:12:04
UTC (rev 1488)
+++ trunk/perfsonar/conf/service.properties.tops 2006-07-27 09:40:43
UTC (rev 1489)
@@ -17,9 +17,9 @@
# --- directories
-------------------------------------------------------------------------
-service.basepath=/home/ulisses/rediris/jra1/sonar/perfsonar/
-service.log.log4j.config=/home/ulisses/rediris/jra1/sonar/perfsonar//conf/log4j.properties
-service.sax_parser.config=/home/ulisses/rediris/jra1/sonar/perfsonar//src/objects.config
+service.basepath=/home/ulisses/rediris/jra1/perfsonar/
+service.log.log4j.config=/home/ulisses/rediris/jra1/perfsonar/conf/log4j.properties
+service.sax_parser.config=/home/ulisses/rediris/jra1/perfsonar/src/objects.config
# --- registration
------------------------------------------------------------------------
@@ -59,7 +59,7 @@
#
component.tops-registrator.scheduler_component=tops_scheduler
# TODO
-component.tops-registrator.register_file=/home/ulisses/rediris/jra1/sonar/perfsonar/conf/rrd-database_TEST.xml
+component.tops-registrator.register_file=/home/ulisses/rediris/jra1/perfsonar/conf/rrd-database_TEST.xml
component.tops-jdbc.jdbc_uri=jdbc:postgresql:ulisses
component.tops-jdbc.jdbc_user=ulisses
@@ -71,7 +71,7 @@
service.ls.class_name=org.perfsonar.service.lookupService.xmlType.XmlTypeLSServiceEngine
service.ls.message_types=LSQueryRequest,LSRegisterRequest,LSDeregisterRequest
-service.tops.class_name=org.perfsonar.service.topologyService.TopService.TopServiceEngine
+service.tops.class_name=org.perfsonar.service.topologyService.TopServiceEngine
service.tops.message_types=TOPSDownloadDBRequest
Added:
trunk/perfsonar/schema/example-instances/sonar/TOPS/test/TOPSDownloadDBRequest.xml
Added:
trunk/perfsonar/schema/example-instances/sonar/TOPS/test/TOPSDownloadDBResponse.xml
Added: trunk/perfsonar/schema/example-instances/sonar/TOPS/test/Void.xml
Modified:
trunk/perfsonar/src/org/perfsonar/service/topologyService/TopServiceEngine.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/topologyService/TopServiceEngine.java
2006-07-26 13:12:04 UTC (rev 1488)
+++
trunk/perfsonar/src/org/perfsonar/service/topologyService/TopServiceEngine.java
2006-07-27 09:40:43 UTC (rev 1489)
@@ -2,10 +2,11 @@
* Created on 2005-08-10
*
*/
-package org.perfsonar.service.topologyService.TopService;
+package org.perfsonar.service.topologyService;
import org.ggf.ns.nmwg.base.v2_0.*;
+import org.perfsonar.commons.util.XMLUtils;
import org.perfsonar.commons.auxiliary.AuxiliaryComponentManager;
import org.perfsonar.commons.auxiliary.ComponentNames;
import org.perfsonar.commons.auxiliary.components.logger.LoggerComponent;
@@ -120,7 +121,7 @@
}
String mm = "TopServiceEngine: trying to get registrator component";
- logger.error(mm);
+ logger.debug(mm);
topsRegistration=
(TopsLSRegistrationComponent)AuxiliaryComponentManager.
getInstance().getComponent(TOPS_REGISTRATOR_COMPONENT);
@@ -218,7 +219,11 @@
// ------end of serving actions
---------------------------------------
+ // logger.debug("TopServiceEngine: takeAction: returning the
message");
// return the Message
+ String m;
+ m= "finally response in Topology Service:\n" +
XMLUtils.serializeXML(response);
+ logger.debug(m);
return response;
} //takeAction
Modified:
trunk/perfsonar/src/org/perfsonar/service/topologyService/TopsAction.java
===================================================================
--- trunk/perfsonar/src/org/perfsonar/service/topologyService/TopsAction.java
2006-07-26 13:12:04 UTC (rev 1488)
+++ trunk/perfsonar/src/org/perfsonar/service/topologyService/TopsAction.java
2006-07-27 09:40:43 UTC (rev 1489)
@@ -1,4 +1,4 @@
-package org.perfsonar.service.topologyService.TopService;
+package org.perfsonar.service.topologyService;
import java.sql.*;
Modified:
trunk/perfsonar/src/org/perfsonar/service/topologyService/TopsDownloadDBAction.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/topologyService/TopsDownloadDBAction.java
2006-07-26 13:12:04 UTC (rev 1488)
+++
trunk/perfsonar/src/org/perfsonar/service/topologyService/TopsDownloadDBAction.java
2006-07-27 09:40:43 UTC (rev 1489)
@@ -1,12 +1,17 @@
-package org.perfsonar.service.topologyService.TopService;
+package org.perfsonar.service.topologyService;
import org.ggf.ns.nmwg.base.v2_0.*;
+
+import org.ggf.ns.nmwg.topology.base.v3_0.*;
+import org.ggf.ns.nmwg.topology.l3.v3_0.*;
import org.perfsonar.commons.util.XMLUtils;
import org.perfsonar.service.commons.exceptions.DataFormatException;
import org.perfsonar.service.commons.exceptions.RequestException;
import org.perfsonar.service.commons.exceptions.SystemException;
import org.perfsonar.service.commons.storage.StorageManager;
+import java.util.Hashtable;
+
import java.sql.*; // for jdbc
// import org.postgresql.Driver;
@@ -19,6 +24,7 @@
* @author Ulisses, using Maciej Glowiak's code as skeleton
*
*/
+
public class TopsDownloadDBAction extends TopsAction {
// --------------------------------------------------------------
Constants
@@ -26,71 +32,674 @@
// ----------------------------------------------------- instance
variables
-
+ private Connection conn = null; // The
object to connect to the SQL database
+
// -----------------------------------------------------------
Constructor
public TopsDownloadDBAction(Connection jdbc)
- throws SystemException {
+ throws SystemException {
+
+
+ super(jdbc); // TODO: is this right?, if I don't put this here it
doesn't compile/works
- // Esto est� bien? sino se pone no compila
- super(jdbc);
-
+ conn= jdbc;
}
// --------------------------------------------------------- Public
methods
- public Message performAction(Message request)
- throws SystemException, RequestException, DataFormatException {
-
- logger.debug(
- "TopServiceEngine: performing TopsDownloadDBAction...");
-
+ public Message performAction(Message request) throws SystemException,
RequestException, DataFormatException {
- //create ServiceEngineResponse and put there the results
+ Hashtable<Integer, String> nodes_interfaces;
+ String m;
+
+ logger.debug("TopServiceEngine: performing TopsDownloadDBAction...");
+
Message response = new Message();
- response.setType("TopsDownloadDBResponse");
-
- //add empty metadata block to ServiceEngineResponse
+ response.setType("TOPSDownloadDBResponse");
Metadata responseMetadata = new Metadata();
-
- String metadataId = "TopsDownloadDBResponseMetadata";
- responseMetadata.setId(metadataId);
+
+ responseMetadata.setId("TOPSDownloadDBResponseMetadata");
response.addChild(responseMetadata);
-
- // add data elements to ServiceEngineResponse
- String[] results;
+
Data responseData = new Data();
- String dataId = "TopsDownloadDByResponseData";
- responseData.setId(dataId);
- responseData.setMetadataIdRef(metadataId);
-
- //iterate results, create Datum for them and put all
- //these Datum into Data
+ Data nodesData = new Data();
+ Data networksData = new Data();
- /* TODO
+ responseData.setId("TOPSDownloadDBResponse");
- for (int i=0; i < results.length; i++) {
+ responseData.setMetadata(responseMetadata); // Maciej says
.addChild(responseMetadata); is equivalent
+ responseData.setMetadataIdRef("TOPSDownloadDBResponseMetadata");
- org.ggf.ns.nmwg.tools.org.perfsonar.service.v1_0.Datum datum =
- new org.ggf.ns.nmwg.tools.org.perfsonar.service.v1_0.Datum();
+ // fill the responseData, first networks, nodes afterwards because
nodes will
+ // use references to the network interfaces
+
+ nodes_interfaces= fillNodesNetworks(networksData);
+ fillNodes(nodesData, nodes_interfaces);
- datum.setValue(results[i]);
- responseData.setDatum(datum);
- }
+ // We insert the Networks and the Nodes separately or because adding
networks and Nodes
+ // doesn't has an ordering, and there after networks and links will
be inter-mixed
- */
+ responseData.addChild(networksData);
+ responseData.addChild(nodesData);
- // Encapsulate Data in Response Message
- response.addChild(responseData);
-
+ response.addChild(responseData); // this is equivalent to
response.setData(responseData);
+
+ m= "TopServiceEngine: final response is:\n" +
XMLUtils.serializeXML(response);
+ logger.debug(m);
+
return response;
-
}
-
-} //TopsDownloadDBAction
+ // private & protected methods
+ protected Long getSpeedOfInterface(Long speed, Long if_highspeed, Long
if_speed) {
+
+ // The reason of encapsulating this in a method is to allow
consistency checks
+ // with the values filled
+
+ Long retval;
+
+ // speed > if_high_speed > if_speed, where '>' means higher preference
+
+ if (speed > 0) {
+ retval= speed;
+ } else if (if_highspeed > 0) {
+ retval= if_highspeed;
+ } else {
+ retval= if_speed;
+ }
+
+ return retval;
+ }
+
+ protected String convertIfTypeToDescription(int ifType) {
+
+ String conv[] = {
+ "unused",
+ "other", // (1), -- none of the following
+ "regular1822", // (2),
+ "hdh1822", // (3),
+ "ddnX25", // (4),
+ "rfc877x25", // (5),
+ "ethernetCsmacd", // (6),
+ "iso88023Csmacd", // (7), -- Deprecated via
RFC-draft-ietf-hubmib-etherif-mib-v3 ethernetCsmacd (6) should be used
instead
+ "iso88024TokenBus", // (8),
+ "iso88025TokenRing", // (9),
+ "iso88026Man", // (10),
+ "starLan", // (11), -- Deprecated via
RFC-draft-ietf-hubmib-etherif-mib-v3 ethernetCsmacd (6) should be used
instead
+ "proteon10Mbit", // (12),
+ "proteon80Mbit", // (13),
+ "hyperchannel", // (14),
+ "fddi", // (15),
+ "lapb", // (16),
+ "sdlc", // (17),
+ "ds1", // (18), -- DS1-MIB
+ "e1", // (19), -- Obsolete see DS1-MIB
+ "basicISDN", // (20),
+ "primaryISDN", // (21),
+ "propPointToPointSerial", // (22), -- proprietary serial
+ "ppp", // (23),
+ "softwareLoopback", // (24),
+ "eon", // (25), -- CLNP over IP
+ "ethernet3Mbit", // (26),
+ "nsip", // (27), -- XNS over IP
+ "slip", // (28), -- generic SLIP
+ "ultra", // (29), -- ULTRA technologies
+ "ds3", // (30), -- DS3-MIB
+ "sip", // (31), -- SMDS, coffee
+ "frameRelay", // (32), -- DTE only.
+ "rs232", // (33),
+ "para", // (34), -- parallel-port
+ "arcnet", // (35), -- arcnet
+ "arcnetPlus", // (36), -- arcnet plus
+ "atm", // (37), -- ATM cells
+ "miox25", // (38),
+ "sonet", // (39), -- SONET or SDH
+ "x25ple", // (40),
+ "iso88022llc", // (41),
+ "localTalk", // (42),
+ "smdsDxi", // (43),
+ "frameRelayService", // (44), -- FRNETSERV-MIB
+ "v35", // (45),
+ "hssi", // (46),
+ "hippi", // (47),
+ "modem", // (48), -- Generic modem
+ "aal5", // (49), -- AAL5 over ATM
+ "sonetPath", // (50),
+ "sonetVT", // (51),
+ "smdsIcip", // (52), -- SMDS InterCarrier
Interface
+ "propVirtual", // (53), -- proprietary
virtual/internal
+ "propMultiplexor", // (54),-- proprietary multiplexing
+ "ieee80212", // (55), -- 100BaseVG
+ "fibreChannel", // (56), -- Fibre Channel
+ "hippiInterface", // (57), -- HIPPI interfaces
+ "frameRelayInterconnect", // (58), -- Obsolete use
either
+ "frameRelay", // (32) or
+ "frameRelayService", // (44).
+ "aflane8023", // (59), -- ATM Emulated LAN for
802.3
+ "aflane8025", // (60), -- ATM Emulated LAN for
802.5
+ "cctEmul", // (61), -- ATM Emulated circuit
+ "fastEther", // (62), -- Obsoleted via
RFC-draft-ietf-hubmib-etherif-mib-v3 ethernetCsmacd (6) should be used
instead
+ "isdn", // (63), -- ISDN and X.25
+ "v11", // (64), -- CCITT V.11/X.21
+ "v36", // (65), -- CCITT V.36
+ "g703at64k", // (66), -- CCITT G703 at 64Kbps
+ "g703at2mb", // (67), -- Obsolete see DS1-MIB
+ "qllc", // (68), -- SNA QLLC
+ "fastEtherFX", // (69), -- Obsoleted via
RFC-draft-ietf-hubmib-etherif-mib-v3 ethernetCsmacd (6) should be used
instead
+ "channel", // (70), -- channel
+ "ieee80211", // (71), -- radio spread
spectrum
+ "ibm370parChan", // (72), -- IBM System 360/370 OEMI
Channel
+ "escon", // (73), -- IBM Enterprise Systems
Connection
+ "dlsw", // (74), -- Data Link Switching
+ "isdns", // (75), -- ISDN S/T interface
+ "isdnu", // (76), -- ISDN U interface
+ "lapd", // (77), -- Link Access Protocol D
+ "ipSwitch", // (78), -- IP Switching Objects
+ "rsrb", // (79), -- Remote Source Route
Bridging
+ "atmLogical", // (80), -- ATM Logical Port
+ "ds0", // (81), -- Digital Signal Level 0
+ "ds0Bundle", // (82), -- group of ds0s on the
same ds1
+ "bsc", // (83), -- Bisynchronous Protocol
+ "async", // (84), -- Asynchronous Protocol
+ "cnr", // (85), -- Combat Net Radio
+ "iso88025Dtr", // (86), -- ISO 802.5r DTR
+ "eplrs", // (87), -- Ext Pos Loc Report Sys
+ "arap", // (88), -- Appletalk Remote Access
Protocol
+ "propCnls", // (89), -- Proprietary
Connectionless Protocol
+ "hostPad", // (90), -- CCITT-ITU X.29 PAD Protocol
+ "termPad", // (91), -- CCITT-ITU X.3 PAD Facility
+ "frameRelayMPI", // (92), -- Multiproto Interconnect
over FR
+ "x213", // (93), -- CCITT-ITU X213
+ "adsl", // (94), -- Asymmetric Digital
Subscriber Loop
+ "radsl", // (95), -- Rate-Adapt. Digital
Subscriber Loop
+ "sdsl", // (96), -- Symmetric Digital
Subscriber Loop
+ "vdsl", // (97), -- Very H-Speed Digital
Subscrib. Loop
+ "iso88025CRFPInt", // (98), -- ISO 802.5 CRFP
+ "myrinet", // (99), -- Myricom Myrinet
+ "voiceEM", // (100), -- voice recEive and transMit
+ "voiceFXO", // (101), -- voice Foreign
Exchange Office
+ "voiceFXS", // (102), -- voice Foreign
Exchange Station
+ "voiceEncap", // (103), -- voice encapsulation
+ "voiceOverIp", // (104), -- voice over IP
encapsulation
+ "atmDxi", // (105), -- ATM DXI
+ "atmFuni", // (106), -- ATM FUNI
+ "atmIma", // (107), -- ATM IMA
+ "pppMultilinkBundle", // (108), -- PPP Multilink
Bundle
+ "ipOverCdlc", // (109), -- IBM ipOverCdlc
+ "ipOverClaw", // (110), -- IBM Common Link
Access to Workstn
+ "stackToStack", // (111), -- IBM stackToStack
+ "virtualIpAddress", // (112), -- IBM VIPA
+ "mpc", // (113), -- IBM multi-protocol
channel support
+ "ipOverAtm", // (114), -- IBM ipOverAtm
+ "iso88025Fiber", // (115), -- ISO 802.5j Fiber Token
Ring
+ "tdlc", // (116), -- IBM twinaxial data
link control
+ "gigabitEthernet", // (117), -- Obsoleted via
RFC-draft-ietf-hubmib-etherif-mib-v3 ethernetCsmacd (6) should be used
instead
+ "hdlc", // (118), -- HDLC
+ "lapf", // (119), -- LAP F
+ "v37", // (120), -- V.37
+ "x25mlp", // (121), -- Multi-Link Protocol
+ "x25huntGroup", // (122), -- X25 Hunt Group
+ "trasnpHdlc", // (123), -- Transp HDLC
+ "interleave", // (124), -- Interleave channel
+ "fast", // (125), -- Fast channel
+ "ip", // (126), -- IP (for APPN HPR in
IP networks)
+ "docsCableMaclayer", // (127), -- CATV Mac Layer
+ "docsCableDownstream", // (128), -- CATV Downstream
interface
+ "docsCableUpstream", // (129), -- CATV Upstream
interface
+ "a12MppSwitch", // (130), -- Avalon Parallel
Processor
+ "tunnel", // (131), -- Encapsulation interface
+ "coffee", // (132), -- coffee pot
+ "ces", // (133), -- Circuit Emulation
Service
+ "atmSubInterface", // (134), -- ATM Sub Interface
+ "l2vlan", // (135), -- Layer 2 Virtual LAN using
802.1Q
+ "l3ipvlan", // (136), -- Layer 3 Virtual LAN
using IP
+ "l3ipxvlan", // (137), -- Layer 3 Virtual LAN
using IPX
+ "digitalPowerline", // (138), -- IP over Power
Lines
+ "mediaMailOverIp", // (139), -- Multimedia Mail over IP
+ "dtm", // (140), -- Dynamic syncronous
Transfer Mode
+ "dcn", // (141), -- Data Communications Network
+ "ipForward", // (142), -- IP Forwarding
Interface
+ "msdsl", // (143), -- Multi-rate Symmetric DSL
+ "ieee1394", // (144), -- IEEE1394 High
Performance Serial Bus
+ "if", // -gsn (145), -- HIPPI-6400
+ "dvbRccMacLayer", // (146), -- DVB-RCC MAC Layer
+ "dvbRccDownstream", // (147), -- DVB-RCC
Downstream Channel
+ "dvbRccUpstream", // (148), -- DVB-RCC Upstream
Channel
+ "atmVirtual", // (149), -- ATM Virtual Interface
+ "mplsTunnel", // (150), -- MPLS Tunnel Virtual
Interface
+ "srp", // (151), -- Spatial Reuse Protocol
+ "voiceOverAtm", // (152), -- Voice Over ATM
+ "voiceOverFrameRelay", // (153), -- Voice Over
Frame Relay
+ "idsl", // (154), -- Digital Subscriber
Loop over ISDN
+ "compositeLink", // (155), -- Avici Composite Link
Interface
+ "ss7SigLink", // (156), -- SS7 Signaling Link
+ "propWirelessP2P", // (157), -- Prop. P2P wireless
interface
+ "frForward", // (158), -- Frame Forward
Interface
+ "rfc1483", // (159), -- Multiprotocol over ATM AAL5
+ "usb", // (160), -- USB Interface
+ "ieee8023adLag", // (161), -- IEEE 802.3ad Link
Aggregate
+ "bgppolicyaccounting", // (162), -- BGP Policy
Accounting
+ "frf16MfrBundle", // (163), -- FRF .16 Multilink Frame
Relay
+ "h323Gatekeeper", // (164), -- H323 Gatekeeper
+ "h323Proxy", // (165), -- H323 Voice and Video
Proxy
+ "mpls", // (166), -- MPLS
+ "mfSigLink", // (167), -- Multi-frequency
signaling link
+ "hdsl2", // (168), -- High Bit-Rate DSL - 2nd
generation
+ "shdsl", // (169), -- Multirate HDSL2
+ "ds1FDL", // (170), -- Facility Data Link 4Kbps on a
DS1
+ "pos", // (171), -- Packet over SONET/SDH Interface
+ "dvbAsiIn", // (172), -- DVB-ASI Input
+ "dvbAsiOut", // (173), -- DVB-ASI Output
+ "plc", // (174), -- Power Line Communtications
+ "nfas", // (175), -- Non Facility Associated
Signaling
+ "tr008", // (176), -- TR008
+ "gr303RDT", // (177), -- Remote Digital Terminal
+ "gr303IDT", // (178), -- Integrated Digital
Terminal
+ "isup", // (179), -- ISUP
+ "propDocsWirelessMaclayer", // (180), --
prop/Maclayer
+ "propDocsWirelessDownstream", // (181), --
prop/Downstream
+ "propDocsWirelessUpstream", // (182), --
prop/Upstream
+ "hiperlan2", // (183), -- HIPERLAN Type 2 Radio
Interface
+ "propBWAp2Mp", // (184), --
PropBroadbandWirelessAccesspt2multipt
+ "sonetOverheadChannel", // (185), -- SONET Overhead
Channel
+ "digitalWrapperOverheadChannel", // (186), -- Digital
Wrapper
+ "aal2", // (187), -- ATM adaptation layer 2
+ "radioMAC", // (188), -- MAC layer over radio
links
+ "atmRadio", // (189), -- ATM over radio links
+ "imt", // (190), -- Inter Machine Trunks
+ "mvl", // (191), -- Multiple Virtual Lines DSL
+ "reachDSL", // (192), -- Long Reach DSL
+ "frDlciEndPt", // (193), -- Frame Relay DLCI End
Point
+ "atmVciEndPt", // (194), -- ATM VCI End Point
+ "opticalChannel", // (195), -- Optical Channel
+ "opticalTransport", // (196), -- Optical
Transport
+ "propAtm", // (197), -- Proprietary ATM
+ "voiceOverCable", // (198), -- Voice Over Cable
Interface
+ "infiniband", // (199), -- Infiniband
+ "teLink", // (200), -- TE Link
+ "q2931", // (201), -- Q.2931
+ "virtualTg", // (202), -- Virtual Trunk Group
+ "sipTg", // (203), -- SIP Trunk Group
+ "sipSig", // (204), -- SIP Signaling
+ "docsCableUpstreamChannel", // (205), -- CATV
Upstream Channel
+ "econet", // (206), -- Acorn Econet
+ "pon155", // (207), -- FSAN 155Mb Symetrical PON
interface
+ "pon622", // (208), -- FSAN622Mb Symetrical PON
interface
+ "bridge", // (209), -- Transparent bridge interface
+ "linegroup", // (210), -- Interface common to
multiple lines
+ "voiceEMFGD", // (211), -- voice E&M Feature Group
D
+ "voiceFGDEANA", // (212), -- voice FGD Exchange
Access North American
+ "voiceDID", // (213), -- voice Direct Inward
Dialing
+ "mpegTransport", // (214), -- MPEG transport interface
+ "sixToFour", // (215), -- 6to4 interface
+ "gtp", // (216), -- GTP (GPRS Tunneling Protocol)
+ "pdnEtherLoop1", // (217), -- Paradyne EtherLoop 1
+ "pdnEtherLoop2", // (218), -- Paradyne EtherLoop 2
+ "opticalChannelGroup", // (219), -- Optical Channel
Group
+ "homepna", // (220), -- HomePNA ITU-T G.989
+ "gfp", // (221), -- Generic Framing Procedure (GFP)
+ "ciscoISLvlan", // (222), -- Layer 2 Virtual LAN
using Cisco ISL
+ "actelisMetaLOOP", // (223), -- Acteleis proprietary
MetaLOOP High Speed Link
+ "fcipLink" // (224) -- FCIP Link
+ };
+
+ if ((ifType == 0) || (ifType > conv.length)) {
+
+ return conv[1]; // return "other", interface type not supported
+ }
+
+ return conv[ifType];
+ }
+
+ protected void
fillNetworkInterfaces(org.ggf.ns.nmwg.topology.l3.v3_0.Link link, int
network_oid, Hashtable<Integer, String> nodes_interfaces)
+
+ throws SystemException {
+
+ String select_network_interfaces= "SELECT speed, if_highspeed,
if_speed, " +
+ "if_type, if_index, if_description, " +
+ "default_ip_interface_address, default_ip_network_subnet_prefix,
object_id " +
+ "FROM network_interface " +
+ "WHERE object_id IN " +
+ "(SELECT network_interface_object_id " +
+ "FROM network_to_interface " +
+ "WHERE network_object_id = " + network_oid + " )";
+
+ Statement st;
+ ResultSet rs;
+ Long speed;
+ String interface_ref;
+ int i= 0;
+
+ try {
+
+ st= conn.createStatement();
+ rs= st.executeQuery(select_network_interfaces);
+
+ while(rs.next()) {
+
+
+ interface_ref = "private_index: " + i;
+
+ org.ggf.ns.nmwg.topology.l3.v3_0.Interface iface=
+ new org.ggf.ns.nmwg.topology.l3.v3_0.Interface();
+
+ org.ggf.ns.nmwg.topology.l3.v3_0.Type type= new
+ org.ggf.ns.nmwg.topology.l3.v3_0.Type();
+
+ type.setType(convertIfTypeToDescription(rs.getInt(4)));
+ iface.setTypeElement(type);
+
+
+ ///
+
+ if (rs.getString(5) != null) {
+
+ org.ggf.ns.nmwg.topology.l3.v3_0.IfIndex ifindex=
+ new org.ggf.ns.nmwg.topology.l3.v3_0.IfIndex();
+
+ ifindex.setIfIndex(rs.getString(5));
+ iface.setIfIndexElement(ifindex);
+
+ interface_ref+= "snmp_ifindex: " + rs.getString(5);
+
+ } else {
+
+ interface_ref+= ", snmp_ifindex: unknown";
+ }
+
+ iface.setInterfaceIdRef(interface_ref);
+
+ nodes_interfaces.put(rs.getInt(9), interface_ref);
+
+ ///
+
+ if (rs.getString(6) != null) {
+
+ org.ggf.ns.nmwg.topology.l3.v3_0.IfDescription
ifdescription=
+ new org.ggf.ns.nmwg.topology.l3.v3_0.IfDescription();
+
+ ifdescription.setIfDescription(rs.getString(6));
+ iface.setIfDescriptionElement(ifdescription);
+ }
+
+ speed= getSpeedOfInterface(rs.getLong(1), rs.getLong(2),
rs.getLong(3));
+
+ org.ggf.ns.nmwg.topology.l3.v3_0.Capacity capacity=
+ new org.ggf.ns.nmwg.topology.l3.v3_0.Capacity();
+
+ capacity.setCapacity(speed.toString());
+ iface.setCapacityElement(capacity);
+
+ if (rs.getString(7) != null) {
+
+ IpAddress ipaddress= new IpAddress();
+ ipaddress.setIpAddress(rs.getString(7));
+ iface.setIpAddressElement(ipaddress);
+ }
+
+ if (rs.getString(8) != null) {
+
+ Netmask netmask= new Netmask();
+ netmask.setNetmask(rs.getString(8));
+ iface.setNetmaskElement(netmask);
+ }
+
+ link.addChild(iface);
+
+ i++;
+
+ } // end of while()
+
+ } catch (SQLException e) {
+
+ throw new SystemException("TopServiceEngine:
fillNetworkInterfaces: error while fetching from the database:" +
e.getMessage());
+ }
+
+ return;
+ }
+
+ protected void fillNetwork(Data networksData, int network_oid,
Hashtable<Integer, String> nodes_interfaces) throws SystemException {
+
+ String select_network= "SELECT network_type, network_name " +
+ "FROM network " +
+ "WHERE object_id = " + network_oid;
+
+ Statement st;
+ ResultSet rs;
+
+ try {
+
+ st= conn.createStatement();
+ rs= st.executeQuery(select_network);
+
+ while (rs.next()) {
+
+ org.ggf.ns.nmwg.topology.l3.v3_0.Link link=
+ new org.ggf.ns.nmwg.topology.l3.v3_0.Link();
+
+ if (rs.getString(1) != null) {
+
+ org.ggf.ns.nmwg.topology.l3.v3_0.Type type=
+ new org.ggf.ns.nmwg.topology.l3.v3_0.Type();
+
+ type.setType(rs.getString(1));
+
+ link.setTypeElement(type);
+ }
+
+ if (rs.getString(2) != null) {
+
+ org.ggf.ns.nmwg.topology.l3.v3_0.Name name=
+ new org.ggf.ns.nmwg.topology.l3.v3_0.Name();
+
+ name.setName(rs.getString(2));
+
+ link.setNameElement(name);
+ }
+
+ fillNetworkInterfaces(link, network_oid, nodes_interfaces);
+
+ logger.debug("fillNetwork: adding link " +rs.getString(1) +",
" +rs.getString(2)+", " +network_oid);
+ networksData.setChild(link);
+ }
+
+ rs.close();
+ st.close();
+
+ } catch (SQLException e) {
+
+ throw new SystemException("TopServiceEngine: fillNetwork: error
while fetching from the database:" + e.getMessage());
+ }
+
+ return;
+ }
+
+ // adds to the response the description all networks of existing nodes
nodes
+ //
+
+ protected Hashtable<Integer, String> fillNodesNetworks(Data
networksData) throws SystemException {
+
+ try {
+
+ /*
+ Statement st =
conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
+ ResultSet.CONCUR_READ_ONLY);
+ */
+
+ Statement st = conn.createStatement();
+
+ ResultSet rs;
+ String select_network_base= "FROM network_to_interface " +
+ "WHERE network_interface_object_id IN " +
+ "( SELECT object_id FROM network_interface WHERE object_id IN
" +
+ "( SELECT object_id FROM network_interface_key WHERE
object_id_of_network_node IN " +
+ "( SELECT object_id from network_node )))";
+
+ String select_network_oid_count = "SELECT COUNT(*) "
+select_network_base;
+ String select_network_oid= "SELECT network_interface_object_id,
network_object_id " +select_network_base;
+
+ int network_oid, network_interface_oid;
+ int rowcount;
+ String m;
+
+ rs= st.executeQuery(select_network_oid_count);
+
+ /*
+ Ulisses: I did not worked rs.beforeFirst() for me, I switched
back to a non jdbc dependant way
+
+ rs.last();
+ rowcount = rs.getRow(); // Get the row position which is also
the number of rows in the ResultSet.
+ rs.beforeFirst(); // Reposition at the beginning of the
ResultSet to take up rs.next() call.
+
+ */
+
+ rs.next();
+ rowcount= rs.getInt(1);
+ Hashtable<Integer, String> nodes_interfaces= new
Hashtable<Integer, String>(rowcount);
+
+ rs= st.executeQuery(select_network_oid);
+
+ while (rs.next()) { // iterate results
+
+ network_interface_oid= rs.getInt(1);
+ network_oid= rs.getInt(2);
+
+ fillNetwork(networksData, network_oid, nodes_interfaces);
+
+ }
+
+ rs.close();
+ st.close();
+
+ m= "fillNodesNetworks: response is:\n" +
XMLUtils.serializeXML(networksData);
+ logger.debug(m);
+
+ return nodes_interfaces;
+
+ } catch (SQLException e) {
+
+ throw new SystemException("TopServiceEngine: fillNodesNetworks:
error while fetching from the database:" + e.getMessage());
+ }
+
+ }
+
+ protected void fillNodes(Data nodesData, Hashtable<Integer, String>
nodes_interfaces) throws SystemException {
+
+ String m;
+ Statement st_nodes, st_interfaces;
+ ResultSet rs_nodes, rs_interfaces;
+ Integer key; // key for the Hashtable
+ int i;
+ int node_id;
+ String interface_ref;
+
+ try {
+
+ String select_node= "SELECT ip_management_address, " +
+ "network_node_type_id, location_id, " +
+ "dns_name1, dns_name2, usage_type, name, " +
+ "object_id " +
+ "FROM network_node";
+
+ String select_node_interfaces_base= "SELECT object_id " +
+ "FROM network_interface_joined " +
+ "WHERE object_id_of_network_node=";
+
+ st_nodes= conn.createStatement();
+ rs_nodes= st_nodes.executeQuery(select_node);
+
+ while (rs_nodes.next()) { // iterate results
+
+ String select_node_interfaces;
+
+ Node node= new Node();
+
+ if (rs_nodes.getString(4) != null) { // HostName is optional
+
+ HostName hostname= new HostName();
+
+ hostname.setHostName(rs_nodes.getString(4));
+ node.setHostNameElement(hostname);
+ }
+
+ if (rs_nodes.getString(6) != null) { // Type is optional
+
+ org.ggf.ns.nmwg.topology.base.v3_0.Type type=
+ new org.ggf.ns.nmwg.topology.base.v3_0.Type();
+
+ type.setType(rs_nodes.getString(6));
+ node.setTypeElement(type);
+ }
+
+ if (rs_nodes.getString(7) != null) { // Name is optional
+
+ org.ggf.ns.nmwg.topology.base.v3_0.Name name=
+ new org.ggf.ns.nmwg.topology.base.v3_0.Name();
+
+ name.setName(rs_nodes.getString(7));
+ node.setNameElement(name);
+ }
+
+ node_id= rs_nodes.getInt(8);
+ // m= "fillNodes: want to fill node: " + node_id;
+ // logger.debug(m);
+
+
//////////////////////////////////////////////////////////////////////
+ // Get the interfaces of the node and then get the XML
reference to it
+
+ select_node_interfaces= select_node_interfaces_base +node_id;
+ st_interfaces= conn.createStatement();
+ rs_interfaces=
st_interfaces.executeQuery(select_node_interfaces);
+
+ m= "fillNodes: query is: " + select_node_interfaces;
+ logger.debug(m);
+
+ while(rs_interfaces.next()) {
+
+ key= rs_interfaces.getInt(1);
+ interface_ref= nodes_interfaces.get(key);
+
+ if (interface_ref == null) {
+ interface_ref= "lost reference";
+ }
+
+ m= "fillNodes: getting reference for node: " + node_id +
", interface: " + key + ", reference: " + interface_ref;
+ logger.debug(m);
+
+ // TODO: ask if this is the proper way of adding reference
+
+ /*
+ org.ggf.ns.nmwg.topology.l3.v3_0.Interface iface=
+ new org.ggf.ns.nmwg.topology.l3.v3_0.Interface();
+
+ iface.setInterfaceIdRef(interface_ref);
+
+ node.setInterface(iface);
+ */
+
+ }
+
+ rs_interfaces.close();
+ st_interfaces.close();
+
+
//////////////////////////////////////////////////////////////////////
+
+ nodesData.setChild(node);
+ }
+
+ rs_nodes.close();
+ st_nodes.close();
+
+ } catch (SQLException e) {
+
+ throw new SystemException("TopServiceEngine: fillNodes: error
while fetching from the database:" + e.getMessage());
+ }
+
+ return;
+ }
+}
Modified:
trunk/perfsonar/src/org/perfsonar/service/topologyService/TopsJDBCComponent.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/topologyService/TopsJDBCComponent.java
2006-07-26 13:12:04 UTC (rev 1488)
+++
trunk/perfsonar/src/org/perfsonar/service/topologyService/TopsJDBCComponent.java
2006-07-27 09:40:43 UTC (rev 1489)
@@ -1,4 +1,4 @@
-package org.perfsonar.service.topologyService.TopService;
+package org.perfsonar.service.topologyService;
import org.ggf.ns.nmwg.base.v2_0.Message;
import org.perfsonar.commons.auxiliary.AuxiliaryComponent;
Modified:
trunk/perfsonar/src/org/perfsonar/service/topologyService/TopsLSRegistrationComponent.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/topologyService/TopsLSRegistrationComponent.java
2006-07-26 13:12:04 UTC (rev 1488)
+++
trunk/perfsonar/src/org/perfsonar/service/topologyService/TopsLSRegistrationComponent.java
2006-07-27 09:40:43 UTC (rev 1489)
@@ -1,4 +1,4 @@
-package org.perfsonar.service.topologyService.TopService;
+package org.perfsonar.service.topologyService;
import org.ggf.ns.nmwg.base.v2_0.Message;
import org.perfsonar.commons.auxiliary.AuxiliaryComponent;
Modified: trunk/perfsonar/src/org/perfsonar/service/web/RequestHandler.java
===================================================================
--- trunk/perfsonar/src/org/perfsonar/service/web/RequestHandler.java
2006-07-26 13:12:04 UTC (rev 1488)
+++ trunk/perfsonar/src/org/perfsonar/service/web/RequestHandler.java
2006-07-27 09:40:43 UTC (rev 1489)
@@ -163,7 +163,24 @@
convertMessageToDOM( responseMessage );
//if everything went fine, return response document to Axis
+
+ // TODO: ulisses: remove this
+ logger.debug("RequestHandler: ulisses: ");
+
+ try {
+
+ String m= "RequestHandler: ulisses: printing message:" +
XMLUtils.serializeXML(responseMessage);
+ logger.debug(m);
+
+ m= "RequestHandler: ulisses: printing DOM:" +
XMLUtils.serializeDOM(responseDocument);
+ logger.debug(m);
+
+ } catch (Exception e) {
+
+ logger.fatal("finished");
+ }
+
return responseDocument;
@@ -210,9 +227,24 @@
"response message nor error code message!");
}
-
+
+ // TODO: ulisses: remove this
+ logger.debug("RequestHandler: ulisses: ");
+
+ try {
+
+ String m= "RequestHandler: ulisses: printing message:" +
XMLUtils.serializeXML(responseMessage);
+ logger.debug(m);
+
+ m= "RequestHandler: ulisses: printing DOM:" +
XMLUtils.serializeDOM(responseDocument);
+ logger.debug(m);
+
+ } catch (Exception e) {
+
+ logger.fatal("finished");
+ }
+
return responseDocument;
-
}
}
- r1489 - in trunk/perfsonar: ant ant/tops conf schema/example-instances/sonar schema/example-instances/sonar/TOPS schema/example-instances/sonar/TOPS/test src/org/perfsonar/service/topologyService src/org/perfsonar/service/web, svnlog, 07/27/2006
Archive powered by MHonArc 2.6.16.