001: /*
002: * The contents of this file are subject to the
003: * Mozilla Public License Version 1.1 (the "License");
004: * you may not use this file except in compliance with the License.
005: * You may obtain a copy of the License at http://www.mozilla.org/MPL/
006: *
007: * Software distributed under the License is distributed on an "AS IS"
008: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
009: * See the License for the specific language governing rights and
010: * limitations under the License.
011: *
012: * The Initial Developer of the Original Code is Simulacra Media Ltd.
013: * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
014: *
015: * All Rights Reserved.
016: *
017: * Contributor(s):
018: */
019: package org.openharmonise.vfs.event;
020:
021: import org.openharmonise.vfs.*;
022:
023: /**
024: * Wrapper for events from virtual files.
025: *
026: * @author Matthew Large
027: * @version $Revision: 1.1 $
028: */
029: public class VirtualFileEvent {
030:
031: /**
032: * Full path to the {@link org.openharmonise.vfs.VirtualFile} that fired this event.
033: */
034: private String m_sPath = null;
035:
036: /**
037: * Virtual file system that the virtual file belongs to.
038: */
039: private AbstractVirtualFileSystem m_vfs = null;
040:
041: private int m_nEventSubType = 0;
042:
043: private String m_sChildPath = null;
044:
045: /**
046: * Identifier for the type of event.
047: */
048: private String m_sEventType = null;
049:
050: /**
051: * Identifier for a virtual file locked event.
052: */
053: public static String FILE_LOCKED = "FILE_LOCKED";
054:
055: /**
056: * Identifier for a virtual file unlocked event.
057: */
058: public static String FILE_UNLOCKED = "FILE_UNLOCKED";
059:
060: /**
061: * Identifier for a virtual file deleted event.
062: */
063: public static String FILE_DELETED = "FILE_DELETED";
064:
065: /**
066: * Identifier for a virtual file moved event.
067: */
068: public static String FILE_MOVED = "FILE_MOVED";
069:
070: /**
071: * Identifier for a virtual file copied event.
072: */
073: public static String FILE_COPIED = "FILE_COPIED";
074:
075: /**
076: * Identifier for a virtual file children changed event.
077: */
078: public static String FILE_MEMBERS_CHANGED = "FILE_MEMBERS_CHANGED";
079:
080: /**
081: * Identifier for a virtual file metadata changed event.
082: */
083: public static String FILE_METADATA_CHANGED = "FILE_METADATA_CHANGED";
084:
085: /**
086: * Identifier for a virtual file renamed event.
087: */
088: public static String FILE_RENAMED = "FILE_RENAMED";
089:
090: /**
091: * Identifier for a virtual file content changed event.
092: */
093: public static String FILE_CONTENT_CHANGED = "FILE_CONTENT_CHANGED";
094:
095: /**
096: * Identifier for a virtual file changes discarded event.
097: */
098: public static String FILE_CHANGES_DISCARDED = "FILE_CHANGES_DISCARDED";
099:
100: /**
101: * Identifier for a virtual file submitted event.
102: */
103: public static String FILE_SYNCHED = "FILE_SYNCHED";
104:
105: /**
106: * Identifier for a virtual file checked in event.
107: */
108: public static String FILE_CHECKED_IN = "FILE_CHECKED_IN";
109:
110: /**
111: * Constructs a new virtual file event object.
112: *
113: * @param sPath Full path the virtual file that fired this event
114: * @param vfs Virtual file system that the virtual file belongs to
115: * @param sEventType Identifier for the event type
116: */
117: public VirtualFileEvent(String sPath,
118: AbstractVirtualFileSystem vfs, String sEventType) {
119: super ();
120:
121: this .m_sPath = sPath;
122: this .m_vfs = vfs;
123: this .m_sEventType = sEventType;
124: }
125:
126: /**
127: * Returns an identifier for the event type.
128: *
129: * @return Event type
130: */
131: public String getEventType() {
132: return this .m_sEventType;
133: }
134:
135: /**
136: * Returns the full path to the virtual file that fired this event.
137: *
138: * @return Full path
139: */
140: public String getPath() {
141: return this .m_sPath;
142: }
143:
144: /**
145: * Returns the virtual file system that the virtual file belongs to.
146: *
147: * @return Virtual file system
148: */
149: public AbstractVirtualFileSystem getVFS() {
150: return this .m_vfs;
151: }
152:
153: public void setSubType(int nSubType) {
154: this .m_nEventSubType = nSubType;
155: }
156:
157: public int getSubType() {
158: return this .m_nEventSubType;
159: }
160:
161: public void setChildPath(String sChildPath) {
162: this .m_sChildPath = sChildPath;
163: }
164:
165: public String getChildPath() {
166: return this.m_sChildPath;
167: }
168:
169: }
|