001 /*
002 * Copyright (c) 2009 The openGion Project.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
013 * either express or implied. See the License for the specific language
014 * governing permissions and limitations under the License.
015 */
016 package org.opengion.fukurou.util;
017
018 /**
019 * ConnectIF.java は、サーバ?アクセス関連のクラスを?通的に使用するためのインターフェースです?
020 *
021 * connect()、action( String command, String localFile, String remoteFile )、disconnect() の
022 * ??処??メソ?と、setHostUserPass( String host , String user , String pass ) 、getErrMsg() の
023 * 簡易的な共通メソ?を用意して?す?
024 *
025 * @og.rev 5.1.6.0 (2010/05/01) 新規追?
026 *
027 * @version 5.0
028 * @author Kazuhiko Hasegawa
029 * @since JDK5.0,
030 */
031 public interface ConnectIF {
032
033 /**
034 * サーバ?への接続?ログインを行います?
035 *
036 * こ?メソ?は、?期化メソ?です?
037 * 接続?を変更する場合?、も??こ?メソ?をコールする?があります?
038 * (そ?ような場合???常、オブジェクトを構築しなおす方がよ?思います?)
039 */
040 public void connect() ;
041
042 /**
043 * command , localFile , remoteFile を?に、??行います?
044 *
045 * こ?メソ?は、connect()メソ?実行後に、呼び出す?があります?
046 *
047 * @param command GET/PUT/DEL など
048 * @param localFile ローカルのファイル?
049 * @param remoteFile 接続?のファイル?
050 */
051 public void action( final String command, final String localFile, final String remoteFile );
052
053 /**
054 * サーバ?との接続をクローズします?
055 *
056 * ログインされて?場合?、ログアウトも行います?
057 * コネクトされて?場合?、ディスコネクトします?
058 */
059 public void disconnect();
060
061 /**
062 * サーバ?の、?スト?ユーザー、パスワードを設定します?
063 *
064 * @param host サーバ?
065 * @param user ユーザー
066 * @param pass パスワー?
067 */
068 public void setHostUserPass( final String host , final String user , final String pass );
069
070 /**
071 * 接続に利用するポ?ト番号を設定します?
072 *
073 * @param port 接続に利用するポ?ト番号
074 */
075 public void setPort( final String port ) ;
076
077 /**
078 * それぞれの受け側ファイルに?レクトリを作?するかど?(初期値:true:作?する)?
079 *
080 * -mkdirs=[true/false] は、受け?のファイル(GET?LOCAL、PUT?サーバ?)に取り込?ァイルの?レクトリ?
081 * 存在しな??合に、作?するかど?を指定しま?初期値:true)?
082 * 通常、サーバ?に、フォル?層を作?してPUTする場合?動的にフォル?層を作?した?ースで便利です?
083 * ?、フォル??確定しており、指定フォル?外に PUT するのはバグって?と事が?って?場合には
084 * false に設定して、存在しな?ォル?PUT しよ?すると、エラーになるよ?します?
085 *
086 * @param isMkdirs 受け側ファイルに?レクトリを作?するかど?。true:作?する
087 */
088 public void setMkdirs( final boolean isMkdirs ) ;
089
090 /**
091 * Dataタイ?ウトを秒で?しま?初期値:600 [秒])?
092 *
093 * オリジナルの FTPClient#setDataTimeout( int ) は、ミリ秒でセ?
094 * しますが、ここ?メソ?では、秒でセ?します?
095 *
096 * @param timeout タイ?ウ?秒]
097 */
098 public void setTimeout( final int timeout ) ;
099
100 /**
101 * 実行状況?表示可否 を設定しま?初期値:false:表示しな??
102 *
103 * @param isDisplay 実行状況?表示可否
104 */
105 public void setDisplay( final boolean isDisplay ) ;
106
107 /**
108 * ????の表示可否 を設定しま?初期値:false:表示しな??
109 *
110 * @param isDebug ????の表示可否
111 */
112 public void setDebug( final boolean isDebug ) ;
113
114 /**
115 * 処?に発生したエラーメ?ージを取り?します?
116 *
117 * @return エラーメ?ージ
118 */
119 public String getErrMsg();
120 }