001: // The contents of this file are subject to the Mozilla Public License Version
002: // 1.1
003: //(the "License"); you may not use this file except in compliance with the
004: //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
005: //
006: //Software distributed under the License is distributed on an "AS IS" basis,
007: //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
008: //for the specific language governing rights and
009: //limitations under the License.
010: //
011: //The Original Code is "The Columba Project"
012: //
013: //The Initial Developers of the Original Code are Frederik Dietz and Timo
014: // Stich.
015: //Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
016: //
017: //All Rights Reserved.
018: package org.columba.core.folder;
019:
020: import org.columba.core.folder.api.IFolder;
021: import org.columba.core.folder.api.IFolderCommandReference;
022:
023: /**
024: * @author fdietz
025: *
026: */
027: public class DefaultFolderCommandReference implements
028: IFolderCommandReference {
029:
030: private IFolder sourceFolder;
031: private IFolder destinationFolder;
032: private Object[] uids;
033:
034: /**
035: *
036: */
037: public DefaultFolderCommandReference() {
038: super ();
039: }
040:
041: /**
042: *
043: */
044: public DefaultFolderCommandReference(IFolder sourceFolder) {
045: super ();
046:
047: this .sourceFolder = sourceFolder;
048: }
049:
050: /**
051: *
052: */
053: public DefaultFolderCommandReference(IFolder sourceFolder,
054: IFolder destinationFolder) {
055: this (sourceFolder);
056:
057: this .destinationFolder = destinationFolder;
058: }
059:
060: /**
061: *
062: */
063: public DefaultFolderCommandReference(IFolder sourceFolder,
064: Object[] uids) {
065: this (sourceFolder);
066:
067: this .sourceFolder = sourceFolder;
068: this .uids = uids;
069: }
070:
071: /**
072: *
073: */
074: public DefaultFolderCommandReference(IFolder sourceFolder,
075: IFolder destinationFolder, Object[] uids) {
076: this (sourceFolder, destinationFolder);
077:
078: this .uids = uids;
079: }
080:
081: /**
082: * @see org.columba.core.sourceFolder.IFolderCommandReference#getSourceFolder()
083: */
084: public IFolder getSourceFolder() {
085: return sourceFolder;
086: }
087:
088: /**
089: * @see org.columba.core.sourceFolder.IFolderCommandReference#setSourceFolder(org.columba.core.sourceFolder.IFolder)
090: */
091: public void setSourceFolder(IFolder folder) {
092: this .sourceFolder = folder;
093: }
094:
095: /**
096: * @see org.columba.core.sourceFolder.IFolderCommandReference#getDestinationFolder()
097: */
098: public IFolder getDestinationFolder() {
099: return destinationFolder;
100: }
101:
102: /**
103: * @see org.columba.core.sourceFolder.IFolderCommandReference#setDestinationFolder(org.columba.core.sourceFolder.IFolder)
104: */
105: public void setDestinationFolder(IFolder destinationFolder) {
106: this .destinationFolder = destinationFolder;
107: }
108:
109: /**
110: * @see org.columba.api.command.ICommandReference#tryToGetLock(java.lang.Object)
111: */
112: public boolean tryToGetLock(Object locker) {
113: return sourceFolder.tryToGetLock(locker);
114: }
115:
116: /**
117: * @see org.columba.api.command.ICommandReference#releaseLock(java.lang.Object)
118: */
119: public void releaseLock(Object locker) {
120: sourceFolder.releaseLock(locker);
121: }
122:
123: /**
124: * @see org.columba.core.folder.api.IFolderCommandReference#getUids()
125: */
126: public Object[] getUids() {
127: return uids;
128: }
129:
130: /**
131: * @see org.columba.core.folder.api.IFolderCommandReference#setUids(java.lang.Object[])
132: */
133: public void setUids(Object[] uids) {
134: this.uids = uids;
135: }
136:
137: }
|