org.opensync.engine.server
Class DefaultProtocol

java.lang.Object
  extended byorg.opensync.engine.server.DefaultProtocol
All Implemented Interfaces:
Protocol, java.io.Serializable
Direct Known Subclasses:
FTPProtocol, WinFileProtocol

public abstract class DefaultProtocol
extends java.lang.Object
implements Protocol, java.io.Serializable

The default implementation of the protocol interface

See Also:
Serialized Form

Field Summary
protected  Connector connector
          The connector used by the protocol to get information to connect to the source
protected  java.lang.String folder
          The folder use by the protocol to get and put files
protected  java.lang.String name
          The name of the protocol (eg: win_file, ftp, ...)
protected  boolean removeFile
          The file must be rename when cleaned
protected  boolean renameFile
          The file must be rename when cleaned
 
Fields inherited from interface org.opensync.engine.server.Protocol
FTP, WIN_FILE
 
Constructor Summary
DefaultProtocol()
          Construct a DefaultProtocol
 
Method Summary
 void clean(java.lang.String fileName)
          Clean files (rename or remove files when finished)
 Connector getConnector()
          Get the connector used by the protocol to get information to connect to the source
 java.lang.String getFolder()
          Get the folder use by the protocol to get and put files
 java.lang.String getName()
          Get the name of the protocol
 void init()
           
 boolean isRemoveFile()
          The file must be remove when clean
 boolean isRenameFile()
          The file must be rename when clean
 void setConnector(Connector connector)
          Set the connector used by the protocol to get information to connect to the source
 void setFolder(java.lang.String folder)
          Set the folder use by the protocol to get and put files
 void setName(java.lang.String name)
          Set the name of the protocol (eg: win_file, ftp, ...)
 void setRemoveFile(boolean removeFile)
          The file must be remove when clean
 void setRenameFile(boolean renameFile)
          The file must be rename when clean
 java.lang.String toString()
          Used only for debugging
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opensync.engine.server.Protocol
getViews, putView
 

Field Detail

name

protected java.lang.String name
The name of the protocol (eg: win_file, ftp, ...)


folder

protected java.lang.String folder
The folder use by the protocol to get and put files


connector

protected Connector connector
The connector used by the protocol to get information to connect to the source


renameFile

protected boolean renameFile
The file must be rename when cleaned


removeFile

protected boolean removeFile
The file must be rename when cleaned

Constructor Detail

DefaultProtocol

public DefaultProtocol()
Construct a DefaultProtocol

Method Detail

setName

public void setName(java.lang.String name)
Set the name of the protocol (eg: win_file, ftp, ...)

Parameters:
name - the name of the protocol

getName

public java.lang.String getName()
Get the name of the protocol

Specified by:
getName in interface Protocol

setFolder

public void setFolder(java.lang.String folder)
Set the folder use by the protocol to get and put files

Parameters:
folder - the folder of the protocol

getFolder

public java.lang.String getFolder()
Get the folder use by the protocol to get and put files

Specified by:
getFolder in interface Protocol

setConnector

public void setConnector(Connector connector)
Set the connector used by the protocol to get information to connect to the source

Parameters:
connector - the connector of the protocol
See Also:
Connector

getConnector

public Connector getConnector()
Get the connector used by the protocol to get information to connect to the source


init

public void init()
Specified by:
init in interface Protocol
Throws:
OpenSyncException
java.io.IOException

clean

public void clean(java.lang.String fileName)
           throws OpenSyncException,
                  java.io.IOException
Clean files (rename or remove files when finished)

Specified by:
clean in interface Protocol
Parameters:
fileName - the file name
Throws:
OpenSyncException
java.io.IOException

setRenameFile

public void setRenameFile(boolean renameFile)
The file must be rename when clean

Parameters:
renameFile -

isRenameFile

public boolean isRenameFile()
The file must be rename when clean


setRemoveFile

public void setRemoveFile(boolean removeFile)
The file must be remove when clean

Parameters:
removeFile -

isRemoveFile

public boolean isRemoveFile()
The file must be remove when clean


toString

public java.lang.String toString()
Used only for debugging



Copyright © 2004 sourceforge. All Rights Reserved.