KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > storagemanager > logging > SmFetchEvent


1
2 /*
3  * Copyright (c) 1998 - 2005 Versant Corporation
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  * Versant Corporation - initial API and implementation
11  */

12 package com.versant.core.storagemanager.logging;
13
14 /**
15  * Event logged when data is fetched for an instance.
16  */

17 public class SmFetchEvent extends SmFetchEventBase {
18
19     private String JavaDoc className;
20     private String JavaDoc primaryKey;
21
22     public SmFetchEvent(int storageManagerId, int type, String JavaDoc className,
23             String JavaDoc primaryKey, String JavaDoc fetchGroup, String JavaDoc fieldName) {
24         super(storageManagerId, type, fieldName, fetchGroup);
25         this.className = className;
26         this.primaryKey = primaryKey;
27     }
28
29     public String JavaDoc getPrimaryKey() {
30         return primaryKey;
31     }
32
33     public String JavaDoc getClassName() {
34         return className;
35     }
36
37     public void setClassName(String JavaDoc className) {
38         this.className = className;
39     }
40
41     public void setPrimaryKey(String JavaDoc primaryKey) {
42         this.primaryKey = primaryKey;
43     }
44
45     /**
46      * Get a long description for this event (e.g. the query text).
47      */

48     public String JavaDoc getDescription() {
49         return className + " " + primaryKey + " " + getFetchGroup() + " " +
50                 (fieldName == null ? "" : fieldName + " ") +
51                 returnedSize + " state(s)";
52     }
53
54 }
55
Popular Tags