perfsonar-dev - perfsonar: r4004 - in branches/WebAdmin/perfSONARWebAdmin: admin/stitching auxiliary/service auxiliary/stitching
Subject: perfsonar development work
List archive
perfsonar: r4004 - in branches/WebAdmin/perfSONARWebAdmin: admin/stitching auxiliary/service auxiliary/stitching
Chronological Thread
- From:
- To:
- Subject: perfsonar: r4004 - in branches/WebAdmin/perfSONARWebAdmin: admin/stitching auxiliary/service auxiliary/stitching
- Date: Fri, 13 Jun 2008 08:02:25 -0400
Author: michalis
Date: 2008-06-13 08:02:23 -0400 (Fri, 13 Jun 2008)
New Revision: 4004
Added:
branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/HTMLOutput.java
Modified:
branches/WebAdmin/perfSONARWebAdmin/admin/stitching/StitchingServlet.java
branches/WebAdmin/perfSONARWebAdmin/auxiliary/service/HTMLOutput.java
branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/ElementParser.java
branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/MetadataManager.java
branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/MetadataManagerImpl.java
Log:
Modified:
branches/WebAdmin/perfSONARWebAdmin/admin/stitching/StitchingServlet.java
===================================================================
--- branches/WebAdmin/perfSONARWebAdmin/admin/stitching/StitchingServlet.java
2008-06-13 10:33:14 UTC (rev 4003)
+++ branches/WebAdmin/perfSONARWebAdmin/admin/stitching/StitchingServlet.java
2008-06-13 12:02:23 UTC (rev 4004)
@@ -1,39 +1,478 @@
package perfSONARWebAdmin.admin.stitching;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
import java.io.IOException;
+import java.io.InputStream;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
-import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-public class StitchingServlet implements Servlet {
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
- public void destroy() {
- // TODO Auto-generated method stub
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
+import org.apache.commons.fileupload.servlet.ServletFileUpload;
+import perfSONARWebAdmin.auxiliary.Authenticator;
+import perfSONARWebAdmin.auxiliary.AuthenticatorImpl;
+import perfSONARWebAdmin.auxiliary.PerfsonarProperties;
+import perfSONARWebAdmin.auxiliary.PerfsonarPropertiesImpl;
+import perfSONARWebAdmin.auxiliary.PerfsonarProperty;
+import perfSONARWebAdmin.auxiliary.ServiceProperties;
+import perfSONARWebAdmin.auxiliary.ServicePropertiesImpl;
+
+import perfSONARWebAdmin.auxiliary.ServletProperties;
+import perfSONARWebAdmin.auxiliary.ServletPropertiesImpl;
+import perfSONARWebAdmin.auxiliary.stitching.ElementParser;
+import perfSONARWebAdmin.auxiliary.stitching.HTMLOutput;
+import perfSONARWebAdmin.auxiliary.stitching.MetadataManager;
+import perfSONARWebAdmin.auxiliary.stitching.MetadataManagerImpl;
+
+public class StitchingServlet extends HttpServlet {
+
+ //
-----------------------------------------------------------------------
+ // class fields
+
+ private static final long serialVersionUID = 1L;
+
+ // Path to service properties
+ private static final String serviceProperties =
"/WEB-INF/classes/perfsonar/conf/service.properties";
+
+ // Path to logging properties
+ @SuppressWarnings("unused")
+ private static final String log4jProperties =
"/WEB-INF/classes/perfsonar/conf/log4j.properties";
+
+ // Path to servlet properties
+ private static final String ServletPropertiesPath =
"/WEB-INF/classes/perfsonar/conf/servlet.properties";
+
+ // Path to service installation directory
+ private static String servicePath = null;
+
+ private String URI;
+
+ private String dbpass;
+
+ private String username;
+
+ private String confFile;
+
+ private HTMLOutput output = new HTMLOutput();;
+
+ private MetadataManager manager;
+
+ private ElementParser parser = new ElementParser();
+
+ private HashMap metrics;
+
+ public void doGet(HttpServletRequest request, HttpServletResponse
response)
+ throws IOException {
+
+ doPost(request, response);
}
- public ServletConfig getServletConfig() {
- // TODO Auto-generated method stub
- return null;
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.servlet.GenericServlet#init(javax.servlet.ServletConfig)
+ */
+ public void init(ServletConfig config) throws ServletException {
+ super.init(config);
+ metrics = new HashMap<String, String>();
+
metrics.put("http://ggf.org/ns/nmwg/characteristic/utilization/2.0",
+ "netutil");
+
metrics.put("http://ggf.org/ns/nmwg/characteristic/errors/2.0",
+ "errors");
+
metrics.put("http://ggf.org/ns/nmwg/characteristic/discards/2.0",
+ "discards");
}
- public String getServletInfo() {
- // TODO Auto-generated method stub
- return null;
+ public void doPost(HttpServletRequest request, HttpServletResponse
response)
+ throws IOException {
+
+ HttpSession session = request.getSession(true);
+ if (session.isNew())
+ session.setMaxInactiveInterval(1800);
+ ServletOutputStream out = response.getOutputStream();
+ ServletContext sc = getServletContext();
+ servicePath = sc.getRealPath("/");
+ ServletProperties servletProperties = new
ServletPropertiesImpl(
+ servicePath + ServletPropertiesPath);
+
+ Authenticator authenticator = new
AuthenticatorImpl(servletProperties);
+ response.setContentType("text/html");
+ ServiceProperties properties = new
ServicePropertiesImpl(servicePath
+ + serviceProperties);
+ URI = properties.getProperty("component.ma.xmldb.db_uri");
+ dbpass =
properties.getProperty("component.ma.xmldb.db_password");
+ username =
properties.getProperty("component.ma.xmldb.db_username");
+ confFile =
properties.getProperty("service.ma.conf_file").trim();
+ output.setOuputStream(out);
+ try {
+ manager = new MetadataManagerImpl(URI, username,
dbpass);
+ } catch (Exception e) {
+ throw new IOException(e.getMessage());
+ }
+
+ if (session.getAttribute("authenticated") != null) {
+ if (((Boolean) session.getAttribute("authenticated"))
+ .booleanValue()) {
+
+ try {
+ System.out.println("Getting to
action");
+ servletActions(request);
+ } catch (Exception e) {
+ throw new IOException(getFault(e));
+ }
+
+ } else {
+ // If "authenticated" is false we invalidate
the session so that
+ // the user can try again
+ session.invalidate();
+ }
+ } else {
+ // If the "authentcated" parameter has not been set
then we ask for
+ // a username and password
+ String authorization =
request.getHeader("Authorization");
+ // if there is non in the headers we ask for it
+ if (authorization == null) {
+ askForPassword(response);
+ } else {
+
+ // The validation process
+ // Getting the user name and password
+ String userInfo =
authorization.substring(6).trim();
+ Base64 coder = new Base64();
+ // BASE64Decoder decoder = new
BASE64Decoder();
+ String nameAndPassword = new
String(coder.decode(userInfo
+ .getBytes()));
+ int index = nameAndPassword.indexOf(":");
+ String user = nameAndPassword.substring(0,
index);
+ String password =
nameAndPassword.substring(index + 1);
+
+ // Using the authenticator to authenticate
the user
+ if (authenticator.authenticate(user,
password)) {
+ // Authetnication was successful we
show the user all
+ // properties to be configured
+ session.setAttribute("authenticated",
true);
+
+ try {
+ System.out.println("Getting
to action");
+ servletActions(request);
+ } catch (Exception e) {
+ throw new
IOException(getFault(e));
+ }
+
+ } else {
+ askForPassword(response);
+ session.invalidate();
+ }
+ }
+ }
}
- public void init(ServletConfig arg0) throws ServletException {
- // TODO Auto-generated method stub
+ /**
+ * @param request
+ * @throws Exception
+ */
+ private void servletActions(HttpServletRequest request) throws
Exception {
+ if (ServletFileUpload.isMultipartContent(request)) {
+
+ ServletFileUpload servletFileUpload = new
ServletFileUpload(
+ new DiskFileItemFactory());
+ List fileItemsList =
servletFileUpload.parseRequest(request);
+ Iterator it = fileItemsList.iterator();
+
+ while (it.hasNext()) {
+ FileItem item = (FileItem) it.next();
+ if (!item.isFormField()) {
+ if (!item.getName().equals("")) {
+
+ item.write(new
File(servicePath
+ +
"/WEB-INF/classes/perfsonar/conf/"
+ +
item.getName().trim()));
+ if (confFile != null) {
+ File file = new
File(confFile);
+ if (file.exists() &&
file.isFile()) {
+
manager.removeConfigFile(file.getName().trim());
+ }
+
+ }
+ File newFile = new
File(servicePath
+ +
"/WEB-INF/classes/perfsonar/conf/"
+ +
item.getName().trim());
+ PerfsonarProperties
properties= new PerfsonarPropertiesImpl();
+ properties.loadProperties(new
FileInputStream(new File(servicePath + serviceProperties)));
+ PerfsonarProperty pr=
properties.getProperty("service.ma.conf_file");
+ pr.setValue(servicePath
+ +
"/WEB-INF/classes/perfsonar/conf/"
+ +
newFile.getName().trim());
+
properties.setProperty("service.ma.conf_file",pr);
+
properties.storeProperties(new FileOutputStream(servicePath +
serviceProperties));
+
manager.addConfigFile(newFile);
+
+ }
+
+ }
+ }
+ setDefault();
+ } else if (request.getParameterNames().hasMoreElements()) {
+
+ if (request.getParameter("sort") != null) {
+ String host = request.getParameter("Host");
+ String metric =
request.getParameter("metric");
+ if (host != null && metric != null) {
+ List ifaces;
+ if (!host.equals("Any"))
+ ifaces = manager
+
.getIfacesbyHostnameMetric(host, metric);
+ else
+ ifaces =
manager.getIfacesbyMetric(metric);
+ setInfo(ifaces, host, metric);
+ } else
+ setDefault();
+ } else if (request.getParameter("Add") != null) {
+ output.interface_page(null, null);
+ } else if (request.getParameter("Edit") != null) {
+ String id = request.getParameter("id");
+ if (id != null) {
+ String meta =
manager.getIfacebyId(id);
+ if (meta != null) {
+ if (!meta.equals("")) {
+
output.interface_page(parser.parseMetaData(meta),
+
parser.parseData(manager.getData(id)));
+ } else
+ setDefault();
+ } else
+ setDefault();
+ } else
+ setDefault();
+ } else if (request.getParameter("Remove") != null) {
+ String id = request.getParameter("id");
+ if (id != null) {
+ output.remove_page(id);
+ } else
+ setDefault();
+ } else if (request.getParameter("Create") != null) {
+
+ String action =
request.getParameter("Create");
+ if (action.equals("Edit") ||
action.equals("Add")) {
+
+ String[] metadata = new String[9];
+ String[] data = new String[9];
+ Enumeration en =
request.getParameterNames();
+ while (en.hasMoreElements()) {
+ String key = (String)
en.nextElement();
+ if (key.equals("Hostname")) {
+ metadata[0] =
request.getParameter(key);
+ } else if
(key.equals("Address")) {
+ metadata[1] =
request.getParameter(key);
+ } else if
(key.equals("Name")) {
+ metadata[2] =
request.getParameter(key);
+ } else if
(key.equals("Description")) {
+ metadata[3] =
request.getParameter(key);
+ } else if
(key.equals("Direction")) {
+ metadata[4] =
request.getParameter(key);
+ } else if
(key.equals("authRealm")) {
+ metadata[5] =
request.getParameter(key);
+ } else if
(key.equals("Capacity")) {
+ metadata[6] =
request.getParameter(key);
+ } else if (key.equals("id")) {
+ metadata[7] =
request.getParameter(key);
+ } else if
(key.equals("file")) {
+ data[0] =
request.getParameter(key);
+ } else if
(key.equals("dataSource")) {
+ data[1] =
request.getParameter(key);
+ } else if
(key.equals("valueUnits")) {
+ data[2] =
request.getParameter(key);
+ } else if
(key.equals("eventType")) {
+ data[3] =
request.getParameter(key);
+ } else if
(key.equals("dataSourceStep")) {
+ data[4] =
request.getParameter(key);
+ } else if
(key.equals("dataSourceType")) {
+ data[5] =
request.getParameter(key);
+ } else if
(key.equals("dataSourceHeartbeat")) {
+ data[6] =
request.getParameter(key);
+ } else if
(key.equals("dataSourceMinValue")) {
+ data[7] =
request.getParameter(key);
+ } else if
(key.equals("dataSourceMaxValue")) {
+ data[8] =
request.getParameter(key);
+ }
+ }
+ metadata[8] = data[3];
+
+ if (action.equals("Add")) {
+ manager.addIface(metadata,
data, metadata[7],
+ (String)
metrics.get(data[3]));
+ setDefault();
+ } else {
+ manager.updateIface(metadata,
data, metadata[7],
+ (String)
metrics.get(data[3]));
+ setDefault();
+ }
+
+ } else
+ setDefault();
+
+ } else if (request.getParameter("Delete") != null) {
+
+ String delete =
request.getParameter("Delete");
+ if (delete.equals("Yes")) {
+ String id =
request.getParameter("id");
+ if (id != null) {
+ manager.removeIfacebyId(id);
+ setDefault();
+ } else
+ setDefault();
+ } else
+ setDefault();
+ } else if (request.getParameter("Manage") != null) {
+ output.manage_config_file_page();
+ }
+ else if (request.getParameter("CreateFile") != null) {
+ String fileName =
request.getParameter("fileName");
+ if (fileName != null) {
+ File newFile = new File(servicePath
+ +
"/WEB-INF/classes/perfsonar/conf/" + fileName
+ + ".xml");
+ if (newFile != null) {
+ if (newFile.createNewFile()) {
+ if
(newFile.canWrite()) {
+ FileWriter fw
= new FileWriter(newFile);
+
BufferedWriter bw = new BufferedWriter(fw);
+
fw.write(getNewStoreFile());
+ bw.close();
+ fw.close();
+ if (confFile
!= null) {
+ File
file = new File(confFile);
+ if
(file.exists() && file.isFile()) {
+
manager.removeConfigFile(confFile);
+ }
+
+ }
+ newFile = new
File(
+
servicePath
+
+ "/WEB-INF/classes/perfsonar/conf/"
+
+ fileName + ".xml");
+
PerfsonarProperties properties= new PerfsonarPropertiesImpl();
+
properties.loadProperties(new FileInputStream(new File(servicePath +
serviceProperties)));
+
PerfsonarProperty pr= properties.getProperty("service.ma.conf_file");
+
pr.setValue(servicePath
+
+ "/WEB-INF/classes/perfsonar/conf/"
+
+ newFile.getName().trim());
+
properties.setProperty("service.ma.conf_file",pr);
+
properties.storeProperties(new FileOutputStream(servicePath +
serviceProperties));
+
manager.addConfigFile(newFile);
+ setDefault();
+
+ } else
+ throw new
Exception("Cannot write to new file");
+ } else
+ throw new
Exception("cannot create new File");
+ } else
+ throw new Exception("New File
null");
+ } else
+ throw new Exception("No file name");
+
+ } else
+ setDefault();
+
+ } else {
+
+ if (manager != null) {
+
+ setDefault();
+ }
+
+ }
+
}
- public void service(ServletRequest arg0, ServletResponse arg1)
- throws ServletException, IOException {
- // TODO Auto-generated method stub
+ private String getNewStoreFile() {
+
+ return " <nmwg:store
xmlns:nmwgt=\"http://ggf.org/ns/nmwg/topology/2.0/\" " +
+ "xmlns:nmtm=\"http://ggf.org/ns/nmwg/time/2.0/\" "+
+ "xmlns:nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\" "+
+ "xmlns:perfsonar=\"http://ggf.org/ns/nmwg/tools/org/perfsonar/1.0/\"
"+
+
"xmlns:netutil=\"http://ggf.org/ns/nmwg/characteristic/utilization/2.0/\" "+
+ "xmlns:errors=\"http://ggf.org/ns/nmwg/characteristic/errors/2.0/\" "+
+
"xmlns:discards=\"http://ggf.org/ns/nmwg/characteristic/discards/2.0/\" "+
+ "xmlns=\"http://ggf.org/ns/nmwg/base/2.0/\"> </nmwg:store>";
+ }
+ /**
+ * @param ifaces
+ * @param metric
+ * @param host
+ * @throws Exception
+ */
+ private void setInfo(List ifaces, String metric, String host)
+ throws Exception {
+ Iterator it = ifaces.iterator();
+ List<String[]> info = new LinkedList<String[]>();
+ while (it.hasNext()) {
+ String[] res = parser.parseMetaData((String)
it.next());
+ if (res != null)
+ info.add(res);
+ }
+ List hosts = manager.getHostnames();
+ output.main_page(info, hosts, host, metric);
}
+ /**
+ * @throws Exception
+ */
+ private void setDefault() throws Exception {
+ List ifaces = manager.getIfacesbyMetric("netutil");
+ setInfo(ifaces, "netutil", null);
+ }
+
+ /**
+ * Method for sending back a http request requesting authentication
+ *
+ * @param response
+ * The httpServlet response
+ */
+
+ @SuppressWarnings("static-access")
+ private void askForPassword(HttpServletResponse response) {
+
+ response.setStatus(response.SC_UNAUTHORIZED); // I.e., 401
+ response.setHeader("WWW-Authenticate",
+ "BASIC realm=\"perfSONAR-Admin\"");
+
+ }
+
+ /**
+ * Method to get the stack trace of an exception
+ *
+ * @param e
+ * The exception
+ * @return A string with stack the trace
+ */
+ private String getFault(Exception e) {
+ StackTraceElement[] trace = e.getStackTrace();
+ String fault = e.getMessage();
+ for (int j = 0; j < trace.length; j++) {
+ fault += trace[j].toString() + "\n";
+ }
+ return fault;
+ }
+
}
Modified:
branches/WebAdmin/perfSONARWebAdmin/auxiliary/service/HTMLOutput.java
===================================================================
--- branches/WebAdmin/perfSONARWebAdmin/auxiliary/service/HTMLOutput.java
2008-06-13 10:33:14 UTC (rev 4003)
+++ branches/WebAdmin/perfSONARWebAdmin/auxiliary/service/HTMLOutput.java
2008-06-13 12:02:23 UTC (rev 4004)
@@ -74,6 +74,7 @@
out.println("</div>");
out.println("</body>");
out.println("</html>");
+ out.close();
}
/**
@@ -101,6 +102,7 @@
out.println("</div>");
out.println("</body>");
out.println("</html>");
+ out.close();
}
public void main_page(Hashtable<String, PerfsonarProperties>
groupedProperties,String type, String extraFunctionalities)
@@ -283,6 +285,7 @@
out.println("</div>");
out.println("</body>");
out.println("</html>");
+ out.close();
}
Modified:
branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/ElementParser.java
===================================================================
---
branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/ElementParser.java
2008-06-13 10:33:14 UTC (rev 4003)
+++
branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/ElementParser.java
2008-06-13 12:02:23 UTC (rev 4004)
@@ -3,37 +3,47 @@
import java.io.ByteArrayInputStream;
import java.util.Iterator;
-
import org.jdom.Document;
import org.jdom.Element;
-
import org.jdom.input.SAXBuilder;
import org.jdom.Namespace;
+/**
+ * @author Michalis Michael,CyNet
+ *
+ */
public class ElementParser {
- private Namespace
nmwg=Namespace.getNamespace("http://ggf.org/ns/nmwg/base/2.0/");
-
- private Namespace
nmtm=Namespace.getNamespace("http://ggf.org/ns/nmwg/time/2.0/");
-
- private Namespace
nmwgt=Namespace.getNamespace("http://ggf.org/ns/nmwg/topology/2.0/");
-
- private Namespace netutil=Namespace.getNamespace("netutil",
- "http://ggf.org/ns/nmwg/characteristic/utilization/2.0/");
-
- private Namespace errors=Namespace.getNamespace("errors",
- "http://ggf.org/ns/nmwg/characteristic/errors/2.0/");
-
- private Namespace discards=Namespace.getNamespace("discards",
- "http://ggf.org/ns/nmwg/characteristic/discards/2.0/");
-
+ private Namespace nmwg = Namespace
+ .getNamespace("http://ggf.org/ns/nmwg/base/2.0/");
+
+ private Namespace nmtm = Namespace
+ .getNamespace("http://ggf.org/ns/nmwg/time/2.0/");
+
+ private Namespace nmwgt = Namespace
+ .getNamespace("http://ggf.org/ns/nmwg/topology/2.0/");
+
+ private Namespace netutil = Namespace.getNamespace("netutil",
+
"http://ggf.org/ns/nmwg/characteristic/utilization/2.0/");
+
+ private Namespace errors = Namespace.getNamespace("errors",
+ "http://ggf.org/ns/nmwg/characteristic/errors/2.0/");
+
+ private Namespace discards = Namespace.getNamespace("discards",
+
"http://ggf.org/ns/nmwg/characteristic/discards/2.0/");
+
public ElementParser() {
}
+ /**
+ * @param metadata
+ * @return
+ * @throws Exception
+ */
public String[] parseMetaData(String metadata) throws Exception {
- String[] ifaceInfo = new String[7];
+ String[] ifaceInfo = new String[9];
Document xmlDoc = null;
SAXBuilder builder = new SAXBuilder();
if (builder == null) {
@@ -46,20 +56,19 @@
Element meta = xmlDoc.getRootElement();
if (meta != null) {
- Element eventType = meta.getChild("eventType",nmwg);
+
+ ifaceInfo[7] = meta.getAttributeValue("id");
+ Element eventType = meta.getChild("eventType", nmwg);
if (eventType != null) {
String namespace = eventType.getTextTrim();
+ ifaceInfo[8]=namespace;
Element subject = meta.getChild("subject",
Namespace
.getNamespace(namespace +
"/"));
if (subject != null) {
- if (subject
- .getChild(
-
"interface",nmwgt) != null) {
- Element iface = subject
- .getChild(
-
"interface",nmwgt);
+ if (subject.getChild("interface",
nmwgt) != null) {
+ Element iface =
subject.getChild("interface", nmwgt);
Iterator it =
iface.getChildren().iterator();
while (it.hasNext()) {
@@ -82,18 +91,23 @@
}
return ifaceInfo;
} else
- throw new Exception("Error
parsing interface element.");
+ return null;
} else
- throw new Exception("Error parsing
subject element.");
+ return null;
} else
- throw new Exception("Error parsing eventType
element.");
+ return null;
} else
- throw new Exception("Error parsing metadata
element.");
+ return null;
}
+ /**
+ * @param data
+ * @return
+ * @throws Exception
+ */
public String[] parseData(String data) throws Exception {
String[] ifaceInfo = new String[9];
@@ -108,9 +122,9 @@
Element dat = xmlDoc.getRootElement();
if (dat != null) {
- Element key = dat.getChild("key",nmwg);
+ Element key = dat.getChild("key", nmwg);
if (key != null) {
- Element parameters =
dat.getChild("parameters",nmwg);
+ Element parameters =
key.getChild("parameters", nmwg);
if (parameters != null) {
Iterator it =
parameters.getChildren().iterator();
@@ -147,12 +161,12 @@
return ifaceInfo;
} else
- throw new Exception("Error parsing
parameters element.");
+ return null;
} else
- throw new Exception("Error parsing key
element.");
+ return null;
} else
- throw new Exception("Error parsing data element.");
+ return null;
}
@@ -160,7 +174,7 @@
ElementParser parser = new ElementParser();
try {
- String[] info=parser
+ String[] info = parser
.parseMetaData(" <nmwg:metadata
xmlns:nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\"
id=\"metaUtilsIn0.316771742262976\">"
+ "<netutil:subject
xmlns:netutil=\"http://ggf.org/ns/nmwg/characteristic/utilization/2.0/\"
id=\"subj1\">"
+ "<nmwgt:interface
xmlns:nmwgt=\"http://ggf.org/ns/nmwg/topology/2.0/\">"
@@ -175,8 +189,8 @@
+ "</netutil:subject>"
+ "<nmwg:eventType>
http://ggf.org/ns/nmwg/characteristic/utilization/2.0</nmwg:eventType>"
+ "</nmwg:metadata>");
-
- for(int i=0;i<info.length;i++){
+
+ for (int i = 0; i < info.length; i++) {
System.out.println(info[i]);
}
} catch (Exception e) {
Added: branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/HTMLOutput.java
Property changes on:
branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/HTMLOutput.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified:
branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/MetadataManager.java
===================================================================
---
branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/MetadataManager.java
2008-06-13 10:33:14 UTC (rev 4003)
+++
branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/MetadataManager.java
2008-06-13 12:02:23 UTC (rev 4004)
@@ -1,10 +1,11 @@
package perfSONARWebAdmin.auxiliary.stitching;
+import java.io.File;
import java.util.List;
/**
- * @author Michalis Michael
- *
+ * @author Michalis Michael,CyNet
+ *
*/
public interface MetadataManager {
@@ -14,69 +15,134 @@
*/
public List getHostnames() throws Exception;
+
/**
+ * @return
+ * @throws Exception
+ */
+ public List getIfaces()throws Exception;
+
+ /**
* @param hostname
* @return
* @throws Exception
*/
public List getIfacesbyHostname(String hostname) throws Exception;
-
+
/**
* @param metric
* @return
* @throws Exception
*/
public List getIfacesbyMetric(String metric) throws Exception;
-
+
/**
* @param hostname
* @param metric
* @return
* @throws Exception
*/
- public List getIfacesbyHostnameMetric(String hostname,String metric)
throws Exception;
-
+ public List getIfacesbyHostnameMetric(String hostname, String metric)
+ throws Exception;
+
/**
* @param hostname
* @throws Exception
*/
public void removeIfacesbyHostname(String hostname) throws Exception;
-
+
/**
* @param metric
* @throws Exception
*/
public void removeIfacesbyMetric(String metric) throws Exception;
+
/**
+ * @param id
+ * @throws exception
+ */
+ public void removeIfacebyId(String id) throws Exception;
+
+ /**
* @param hostname
* @param metric
* @throws Exception
*/
- public void removeIfacesbyHostnameMetric(String hostname,String
metric) throws Exception;
-
-
+ public void removeIfacesbyHostnameMetric(String hostname, String
metric)
+ throws Exception;
+
/**
* @param metadata
* @param data
* @throws Exception
*/
- public void addIface(String[] metadata,String[] data,String id,String
metric) throws Exception;
-
-
+ public void addIface(String[] metadata, String[] data, String id,
+ String metric) throws Exception;
+
/**
* @param metadata
* @param data
* @throws Exception
*/
- public void updateIface(String[] metadata, String[] data, String
id,String metric) throws Exception;
-
-
+ public void updateIface(String[] metadata, String[] data, String id,
+ String metric) throws Exception;
+
/**
* @param id
* @return
* @throws Exception
*/
public String getData(String id) throws Exception;
+
+ /**
+ * @param id
+ * @return
+ * @throws Exception
+ */
+ public String getIfacebyId(String id) throws Exception;
+
+ /**
+ * @param address
+ * @return
+ * @throws Exception
+ */
+ public List getIfacebyAddres(String address) throws Exception;
+
+ /**
+ * @param name
+ * @return
+ * @throws Exception
+ */
+ public List getIfaceByName(String name) throws Exception;
+
+ /**
+ * @param address
+ * @return
+ * @throws Exception
+ */
+ public String[] getIfacebyAddresMetric(String address,String metric)
throws Exception;
+
+ /**
+ * @param name
+ * @return
+ * @throws Exception
+ */
+ public String[] getIfaceByNameMetric(String name,String metric)
throws Exception;
+
+
+ /**
+ * @param file
+ * @throws Exception
+ */
+ public void removeConfigFile(String file) throws Exception;
+
+
+ /**
+ * @param file
+ * @throws Exception
+ */
+ public void addConfigFile(File file) throws Exception;
+
}
Modified:
branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/MetadataManagerImpl.java
===================================================================
---
branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/MetadataManagerImpl.java
2008-06-13 10:33:14 UTC (rev 4003)
+++
branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/MetadataManagerImpl.java
2008-06-13 12:02:23 UTC (rev 4004)
@@ -1,11 +1,11 @@
package perfSONARWebAdmin.auxiliary.stitching;
-import java.util.Hashtable;
+import java.io.File;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-
import org.xmldb.api.DatabaseManager;
import org.xmldb.api.base.Collection;
import org.xmldb.api.base.CompiledExpression;
@@ -14,8 +14,13 @@
import org.xmldb.api.base.ResourceIterator;
import org.xmldb.api.base.ResourceSet;
import org.xmldb.api.base.XMLDBException;
+import org.xmldb.api.modules.XMLResource;
import org.xmldb.api.modules.XQueryService;
+/**
+ * @author Michalis Michael,Cynet
+ *
+ */
public class MetadataManagerImpl implements MetadataManager {
private static String URI;
@@ -30,7 +35,7 @@
private XQueryService service;
- private Hashtable metrics;
+ private HashMap<String, String> metrics;
/**
* @param URI
@@ -40,10 +45,10 @@
*/
public MetadataManagerImpl(String uri, String username, String
password)
throws Exception {
- URI=uri;
+ URI = uri;
user = username;
pass = password;
- metrics = new Hashtable();
+ metrics = new HashMap<String, String>();
metrics.put("netutil",
"http://ggf.org/ns/nmwg/characteristic/utilization/2.0");
metrics.put("errors",
@@ -85,11 +90,13 @@
"Error!!! Not able to connect to
eXist database. ");
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#getHostnames()
*/
public List getHostnames() throws Exception {
- List hostList = new LinkedList();
+ List<String> hostList = new LinkedList<String>();
CompiledExpression expr = service
.compile("for $meta in
/nmwg:store//nmwg:metadata return data($meta//nmwgt:hostName)");
ResourceSet set = service.execute(expr);
@@ -104,12 +111,35 @@
return hostList;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#getIfaces()
+ */
+ public List getIfaces() throws Exception {
+ List<String> ifaceList = new LinkedList<String>();
+ CompiledExpression expr = service
+ .compile("for $meta in
/nmwg:store//nmwg:metadata return $meta");
+ ResourceSet set = service.execute(expr);
+ ResourceIterator it = set.getIterator();
+ while (it.hasMoreResources()) {
+ Resource r = it.nextResource();
+ if (!ifaceList.contains(((String)
r.getContent()).trim())) {
+ ifaceList.add(((String) r.getContent()));
+ }
+ }
+
+ return ifaceList;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
* @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#getIfacesbyHostname(java.lang.String)
*/
public List getIfacesbyHostname(String hostname) throws Exception {
- List ifaceList = new LinkedList();
+ List<String> ifaceList = new LinkedList<String>();
CompiledExpression expr = service
.compile("for $meta in
/nmwg:store//nmwg:metadata where data($meta//nmwgt:hostName)='"
+ hostname + "' return
$meta");
@@ -125,12 +155,15 @@
return ifaceList;
}
- /* (non-Javadoc)
- * @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#getIfacesbyHostnameMetric(java.lang.String,
java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#getIfacesbyHostnameMetric(java.lang.String,
+ * java.lang.String)
*/
public List getIfacesbyHostnameMetric(String hostname, String metric)
throws Exception {
- List ifaceList = new LinkedList();
+ List<String> ifaceList = new LinkedList<String>();
CompiledExpression expr = service
.compile("for $meta in
/nmwg:store//nmwg:metadata where data($meta/"
+ metric.trim()
@@ -148,12 +181,14 @@
return ifaceList;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#getIfacesbyMetric(java.lang.String)
*/
public List getIfacesbyMetric(String metric) throws Exception {
- List ifaceList = new LinkedList();
+ List<String> ifaceList = new LinkedList<String>();
CompiledExpression expr = service
.compile("for $meta in
/nmwg:store//nmwg:metadata where $meta/"
+ metric.trim() + ":subject
return $meta");
@@ -169,7 +204,9 @@
return ifaceList;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#removeIfacesbyHostname(java.lang.String)
*/
public void removeIfacesbyHostname(String hostname) throws Exception {
@@ -177,16 +214,19 @@
CompiledExpression expr = service
.compile("for $meta in
/nmwg:store//nmwg:metadata let $data
:=/nmwg:store//nmwg:data[@metadataIdRef=$meta/@id]
where data($meta//nmwgt:hostName)='"
+ hostname + "' return update
delete $data ");
- ResourceSet set = service.execute(expr);
+ service.execute(expr);
expr = service
.compile("for $meta in
/nmwg:store//nmwg:metadata where data($meta//nmwgt:hostName)='"
+ hostname + "' return update
delete $meta ");
- set = service.execute(expr);
+ service.execute(expr);
}
- /* (non-Javadoc)
- * @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#removeIfacesbyHostnameMetric(java.lang.String,
java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#removeIfacesbyHostnameMetric(java.lang.String,
+ * java.lang.String)
*/
public void removeIfacesbyHostnameMetric(String hostname, String
metric)
throws Exception {
@@ -195,17 +235,19 @@
+ metric.trim()
+
":subject//nmwgt:hostName)='"
+ hostname + "' return update
delete $data ");
- ResourceSet set = service.execute(expr);
+ service.execute(expr);
expr = service
.compile("for $meta in
/nmwg:store//nmwg:metadata where data($meta/"
+ metric.trim()
+
":subject//nmwgt:hostName)='"
+ hostname + "' return update
delete $meta ");
- set = service.execute(expr);
+ service.execute(expr);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#removeIfacesbyMetric(java.lang.String)
*/
public void removeIfacesbyMetric(String metric) throws Exception {
@@ -213,63 +255,224 @@
CompiledExpression expr = service
.compile("for $meta in
/nmwg:store//nmwg:metadata let $data
:=/nmwg:store//nmwg:data[@metadataIdRef=$meta/@id]
where $meta/"
+ metric.trim() + ":subject
return update delete $data");
- ResourceSet set = service.execute(expr);
+ service.execute(expr);
expr = service
.compile("for $meta in
/nmwg:store//nmwg:metadata where $meta/"
+ metric.trim() + ":subject
return update delete $meta");
- set = service.execute(expr);
+ service.execute(expr);
}
/* (non-Javadoc)
- * @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#addIface(java.lang.String[],
java.lang.String[], java.lang.String, java.lang.String)
+ * @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#removeIfacebyId(java.lang.String)
*/
+ public void removeIfacebyId(String id) throws Exception {
+
+
+ CompiledExpression expr = service
+ .compile("for $meta in
/nmwg:store//nmwg:metadata let $data
:=/nmwg:store//nmwg:data[@metadataIdRef=$meta/@id]
where
$meta[@id='"+id+"']
return update delete $data");
+ service.execute(expr);
+ expr = service
+ .compile("for $meta in
/nmwg:store//nmwg:metadata where
$meta[@id='"+id+"']
return update delete $meta");
+ service.execute(expr);
+
+ }
+ /*
+ * (non-Javadoc)
+ *
+ * @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#addIface(java.lang.String[],
+ * java.lang.String[], java.lang.String, java.lang.String)
+ */
public void addIface(String[] metadata, String[] data, String id,
String metric) throws Exception {
String meta = createMetadata(metadata, id, metric);
String dat = createData(data, id, metric);
-
+ System.out.println(dat);
CompiledExpression expr = service.compile("update insert " +
meta
+ " into /nmwg:store ");
- ResourceSet set = service.execute(expr);
- expr = service.compile("update insert " + data + " into
/nmwg:store");
- set = service.execute(expr);
+ service.execute(expr);
+ expr = service.compile("update insert " + dat + " into
/nmwg:store ");
+ service.execute(expr);
}
- /* (non-Javadoc)
- * @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#updateIface(java.lang.String[],
java.lang.String[], java.lang.String, java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#updateIface(java.lang.String[],
+ * java.lang.String[], java.lang.String, java.lang.String)
*/
public void updateIface(String[] metadata, String[] data, String id,
String metric) throws Exception {
-
+
String meta = createMetadata(metadata, id, metric);
String dat = createData(data, id, metric);
+ System.out.println(dat);
- CompiledExpression expr = service.compile("update replace
/nmwg:store/nmwg:metadata[id='"+id+"'] with " + meta
- + " ");
- ResourceSet set = service.execute(expr);
- expr = service.compile("update replace
/nmwg:store/nmwg:data[@metadaIdRef='"+id+"']
with " + data + " ");
- set = service.execute(expr);
+ CompiledExpression expr = service
+ .compile("update replace
/nmwg:store/nmwg:metadata[@id='"
+ id
+ + "'] with " + meta + " ");
+ service.execute(expr);
+ expr = service
+ .compile("update replace
/nmwg:store/nmwg:data[@metadataIdRef='"
+ + id + "'] with " + dat + "
");
+ service.execute(expr);
}
-
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#getData(java.lang.String)
*/
- public String getData(String id) throws XMLDBException{
-
- CompiledExpression expr = service.compile("return
/nmwg:store/nmwg:data[metadataIdRef='"+id+"']");
+ public String getData(String id) throws XMLDBException {
+
+ CompiledExpression expr = service
+ .compile("for $data in /nmwg:store/nmwg:data
where
$data[@metadataIdRef='"
+ + id + "'] return $data");
ResourceSet set = service.execute(expr);
ResourceIterator it = set.getIterator();
if (it.hasMoreResources()) {
Resource r = it.nextResource();
-
- return (String)r.getContent();
+
+ return (String) r.getContent();
+ } else
+ return null;
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#getMetadata(java.lang.String)
+ */
+ public String getIfacebyId(String id) throws Exception {
+
+ CompiledExpression expr = service
+ .compile("for $meta in
/nmwg:store/nmwg:metadata where
$meta[@id='"
+ + id.trim() + "'] return
$meta ");
+ ResourceSet set = service.execute(expr);
+ ResourceIterator it = set.getIterator();
+ if (it.hasMoreResources()) {
+ Resource r = it.nextResource();
+
+ return (String) r.getContent();
+ } else
+ return null;
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#getIfaceByNameMetric(java.lang.String,
+ * java.lang.String)
+ */
+ public String[] getIfaceByNameMetric(String name, String metric)
+ throws Exception {
+ CompiledExpression expr = service
+ .compile(" for $meta in
/nmwg:store/nmwg:metadata where $meta/"
+ + metric.trim()
+ +
":subject/nmwgt:interface[nmwgt:ifName='"
+ + name.trim() + "'] return
$meta");
+ ResourceSet set = service.execute(expr);
+ ResourceIterator it = set.getIterator();
+ String[] iface = new String[2];
+ int i = 0;
+ while (it.hasMoreResources()) {
+ Resource r = it.nextResource();
+ iface[i] = (String) r.getContent();
+ i++;
}
- else return null;
+ return iface;
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#getIfacebyAddresMetric(java.lang.String,
+ * java.lang.String)
+ */
+ public String[] getIfacebyAddresMetric(String address, String metric)
+ throws Exception {
+
+ CompiledExpression expr = service
+ .compile(" for $meta in
/nmwg:store/nmwg:metadata where $meta/"
+ + metric.trim()
+ +
":subject/nmwgt:interface[nmwgt:ifAddress='"
+ + address.trim() + "'] return
$meta ");
+ ResourceSet set = service.execute(expr);
+ ResourceIterator it = set.getIterator();
+ String[] iface = new String[2];
+ int i = 0;
+ while (it.hasMoreResources()) {
+ Resource r = it.nextResource();
+ iface[i] = (String) r.getContent();
+ i++;
+
+ }
+ return iface;
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#getIfaceByName(java.lang.String)
+ */
+ public List getIfaceByName(String name) throws Exception {
+ CompiledExpression expr = service
+ .compile("for $meta in
/nmwg:store/nmwg:metadata where $meta//nmwgt:interface[nmwgt:ifName='"
+ + name.trim() + "'] return
$meta ");
+ ResourceSet set = service.execute(expr);
+ ResourceIterator it = set.getIterator();
+ LinkedList<String> iface = new LinkedList<String>();
+ while (it.hasMoreResources()) {
+ Resource r = it.nextResource();
+ iface.add((String) r.getContent());
+ }
+ return iface;
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#getIfacebyAddres(java.lang.String)
+ */
+ public List getIfacebyAddres(String address) throws Exception {
+ CompiledExpression expr = service
+ .compile("for $meta in
/nmwg:store/nmwg:metadata where $meta//nmwgt:interface[nmwgt:ifAddress='"
+ + address.trim() + "'] return
$meta ");
+ ResourceSet set = service.execute(expr);
+ ResourceIterator it = set.getIterator();
+ LinkedList<String> iface = new LinkedList<String>();
+ while (it.hasMoreResources()) {
+ Resource r = it.nextResource();
+ iface.add((String) r.getContent());
+ }
+ return iface;
+
+ }
+
+ /* (non-Javadoc)
+ * @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#addConfigFile(java.io.File)
+ */
+ public void addConfigFile(File file) throws Exception {
+ XMLResource document = (XMLResource)
collection.createResource(file
+ .getName(), "XMLResource");
+ document.setContent(file);
+ collection.storeResource(document);
}
+
+ /* (non-Javadoc)
+ * @see
perfSONARWebAdmin.auxiliary.stitching.MetadataManager#removeConfigFile(java.lang.String)
+ */
+ public void removeConfigFile(String file) throws Exception {
+
+ collection.removeResource(collection.getResource(file));
+ }
/**
* @param data
* @param id
@@ -277,29 +480,28 @@
* @return
*/
private String createData(String[] data, String id, String metric) {
- return "" + " <nmwg:data id=\"data" + Math.random() * 10000
+ return " <nmwg:data id=\"data" + Math.random() * 10000
+ "\" metadataIdRef=\"" + id + "\">\n" + "
<nmwg:key>\n"
- + " <nmwg:parameters>\n"
+ + " <nmwg:parameters>\n"
+ " <nmwg:parameter name=\"file\">" +
data[0]
+ "</nmwg:parameter>\n"
+ " <nmwg:parameter
name=\"dataSource\">" + data[1]
+ "</nmwg:parameter>\n"
+ " <nmwg:parameter
name=\"valueUnits\">" + data[2]
- + "</nmwg:parameter>\n" + "
<nmwg:parameter\n"
- + " name=\"eventType\">" +
metrics.get(metric)
+ + "</nmwg:parameter>\n" + "
<nmwg:parameter "
+ + "name=\"eventType\">" + metrics.get(metric)
+ "</nmwg:parameter>\n"
- + " <nmwg:parameter
name=\"dataSourceStep\">" + data[3]
+ + " <nmwg:parameter
name=\"dataSourceStep\">" + data[4]
+ "</nmwg:parameter>\n"
- + " <nmwg:parameter
name=\"dataSourceType\">" + data[4]
+ + " <nmwg:parameter
name=\"dataSourceType\">" + data[5]
+ "</nmwg:parameter>\n"
+ " <nmwg:parameter
name=\"dataSourceHeartbeat\">"
- + data[5] + "</nmwg:parameter>\n"
+ + data[6] + "</nmwg:parameter>\n"
+ " <nmwg:parameter
name=\"dataSourceMinValue\">"
- + data[6] + "</nmwg:parameter>\n"
+ + data[7] + "</nmwg:parameter>\n"
+ " <nmwg:parameter
name=\"dataSourceMaxValue\">"
- + data[7] + "</nmwg:parameter>\n"
- + " </nmwg:parameters>\n" + "
</nmwg:key>\n"
- + " </nmwg:data>\n\n";
+ + data[8] + "</nmwg:parameter>\n" + "
</nmwg:parameters>\n"
+ + " </nmwg:key>\n" + " </nmwg:data>\n\n";
}
/**
@@ -333,17 +535,29 @@
MetadataManager manager = new MetadataManagerImpl(
"xmldb:exist://perfsonar.srv.cynet.ac.cy:8080/exist/xmlrpc/db/rrdmaconfig",
"rrdmaservice", "perfsonar");
- Iterator it = manager.getHostnames().iterator();
- while (it.hasNext()) {
- System.out.println(it.next());
- }
+ Iterator it
=manager.getIfacesbyMetric("netutil").iterator();
+ while (it.hasNext()) {
+ System.out.println(it.next());
+ }
+ //String iface =
manager.getIfacebyId("metaUtilsIn0.316771742262976");
+ // String
dat=manager.getData("metaUtilsIn0.316771742262976");
+ // System.out.println(iface);
+ // System.out.println(dat);
+ /*ElementParser parser = new ElementParser();
+ String[] info = parser.parseMetaData(iface);
+ info[7] = info[7] + "hello";
+ String[] data = new String[9];
+ data[0] =
"/var/www/html/cacti/cynets_border_router_traffic_in_8.rrd";
+ data[1] = "errors_in";
+ data[2] = "Eps";
+ data[3] =
"http://ggf.org/ns/nmwg/characteristic/utilization/2.0";
+ data[4] = "300";
+ data[5] = "ABSOLUTE";
+ data[6] = "400";
+ data[7] = "0";
+ data[8] = "10000000";
-
- it = manager.getIfacesbyHostname("CyNets LEM
switch").iterator();
- while (it.hasNext()) {
- System.out.println(it.next());
- }
-
+ manager.addIface(info, data, info[7], "errors");*/
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -363,4 +577,8 @@
}
+
+
+
+
}
- perfsonar: r4004 - in branches/WebAdmin/perfSONARWebAdmin: admin/stitching auxiliary/service auxiliary/stitching, svnlog, 06/13/2008
Archive powered by MHonArc 2.6.16.