1 5 package org.exoplatform.container.monitor; 6 7 import java.util.Map ; 8 import java.util.Iterator ; 9 14 public class ActionData { 15 private String portal ; 16 private String page ; 17 private String requestType ; 18 private long handleTime ; 19 private String parameters ; 20 private String error ; 21 22 public ActionData(String portal, String page, String type, long time, Map params ) { 23 this.portal = portal ; 24 this.page = page ; 25 this.requestType = type ; 26 this.handleTime = time ; 27 Iterator i = params.entrySet().iterator() ; 28 StringBuffer b = new StringBuffer () ; 29 while(i.hasNext()) { 30 b.append("{") ; 31 Map.Entry entry = (Map.Entry ) i.next() ; 32 Object obj = entry.getValue() ; 33 b.append(entry.getKey()).append("=") ; 34 if(obj instanceof String []) { 35 String [] values = (String []) obj ; 36 for(int j = 0; j < values.length; j++) { 37 if(j > 0) b.append(", ") ; 38 b.append(values[j]) ; 39 } 40 } else { 41 b.append(obj) ; 42 } 43 b.append("} ") ; 44 } 45 this.parameters = b.toString() ; 46 } 47 48 public String getPortal() { return portal ; } 49 50 public String getPage() { return page ; } 51 52 public String getRequestType() { return requestType ; } 53 54 public long getHandleTime() { return handleTime ; } 55 56 public String getParameters() { return parameters ; } 57 58 public String getError() { return error ; } 59 public void setError(String error) { this.error = error ; } 60 } | Popular Tags |