KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > container > monitor > ActionData


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.container.monitor;
6
7 import java.util.Map JavaDoc ;
8 import java.util.Iterator JavaDoc;
9 /**
10  * @author Tuan Nguyen (tuan08@users.sourceforge.net)
11  * @since Dec 1, 2004
12  * @version $Id$
13  */

14 public class ActionData {
15   private String JavaDoc portal ;
16   private String JavaDoc page ;
17   private String JavaDoc requestType ;
18   private long handleTime ;
19   private String JavaDoc parameters ;
20   private String JavaDoc error ;
21   
22   public ActionData(String JavaDoc portal, String JavaDoc page, String JavaDoc type, long time, Map JavaDoc params ) {
23     this.portal = portal ;
24     this.page = page ;
25     this.requestType = type ;
26     this.handleTime = time ;
27     Iterator JavaDoc i = params.entrySet().iterator() ;
28     StringBuffer JavaDoc b = new StringBuffer JavaDoc() ;
29     while(i.hasNext()) {
30       b.append("{") ;
31       Map.Entry JavaDoc entry = (Map.Entry JavaDoc) i.next() ;
32       Object JavaDoc obj = entry.getValue() ;
33       b.append(entry.getKey()).append("=") ;
34       if(obj instanceof String JavaDoc[]) {
35         String JavaDoc[] values = (String JavaDoc[]) 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 JavaDoc getPortal() { return portal ; }
49   
50   public String JavaDoc getPage() { return page ; }
51   
52   public String JavaDoc getRequestType() { return requestType ; }
53   
54   public long getHandleTime() { return handleTime ; }
55   
56   public String JavaDoc getParameters() { return parameters ; }
57   
58   public String JavaDoc getError() { return error ; }
59   public void setError(String JavaDoc error) { this.error = error ; }
60 }
Popular Tags