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 */
016package org.opengion.fukurou.transfer;
017
018
019/**
020 * 伝送の定義情報を管理するためのデータクラスです。
021 *
022 * @og.group 伝送システム
023 *
024 * @version  5.0
025 * @author   Hiroki.Nakamura
026 * @since    JDK1.6
027 */
028public class TransferConfig {
029
030        private final String    kbRead;         // 読取方法
031        private final String    readObj;        // 読取対象
032        private final String    readPrm;        // 読取パラーメーター
033        private final String    kbExec;         // 実行方法
034        private final String    execDbid;       // 実行DB接続先ID
035        private final String    execObj;        // 実行対象
036        private final String    execPrm;        // 実行パラメーター
037        private final String    errorSendto;// エラー送信先
038        private final String    hfrom;          // 送り元ホストコード
039        private final String    proxyHost;      // HTTP接続時のプロキシホスト
040        private final int               proxyPort;      // HTTP接続時のプロキシポート
041
042        static final String HTTP_AUTH_USER_PASS = "RMCN_USR:RMCN_PASS"; // HTTT接続時のBASIC認証のユーザーID:パスワード
043
044        /**
045         * コンストラクタです。
046         *
047         * @param kbRead 読取方法
048         * @param readObj 読取対象
049         * @param readPrm 読取パラーメーター
050         * @param kbExec 実行方法
051         * @param execDbid 実行DB接続先ID
052         * @param execObj 実行対象
053         * @param execPrm 実行パラメーター
054         * @param errorSendto エラー送信先
055         * @param hfrom 送り元ホストコード
056         * @param proxyHost プロキシホスト
057         * @param proxyPort プロキシポート
058         */
059        public TransferConfig(
060                        final String kbRead, final String readObj, final String readPrm
061                        ,final String kbExec, final String execDbid, final String execObj, final String execPrm
062                        ,final String errorSendto, final String hfrom, final String proxyHost, final int proxyPort ) {
063                                this.kbRead             = kbRead;
064                                this.readObj    = readObj;
065                                this.readPrm    = readPrm;
066                                this.kbExec             = kbExec;
067                                this.execDbid   = execDbid;
068                                this.execObj    = execObj;
069                                this.execPrm    = execPrm;
070                                this.errorSendto= errorSendto;
071                                this.hfrom              = hfrom;
072                                this.proxyHost  = proxyHost;
073                                this.proxyPort  = proxyPort;
074        }
075
076        /**
077         * 読取方法を返します。
078         *
079         * @return 読取対象
080         */
081        public String getKbRead() {
082                return kbRead;
083        }
084
085        /**
086         * 読取対象を返します。
087         *
088         * @return 読取対象
089         */
090        public String getReadObj() {
091                return readObj;
092        }
093
094        /**
095         * 読取パラーメーターを返します。
096         *
097         * @return 読取パラーメーター
098         */
099        public String getReadPrm() {
100                return readPrm;
101        }
102
103        /**
104         * 実行方法を返します。
105         *
106         * @return 実行方法
107         */
108        public String getKbExec() {
109                return kbExec;
110        }
111
112        /**
113         * 実行DB接続先IDを返します。
114         *
115         * @return 実行DB接続先ID
116         */
117        public String getExecDbid() {
118                return execDbid;
119        }
120
121        /**
122         * 実行対象を返します。
123         *
124         * @return 実行対象
125         */
126        public String getExecObj() {
127                return execObj;
128        }
129
130        /**
131         * 実行パラメーターを返します。
132         *
133         * @return 実行パラメーター
134         */
135        public String getExecPrm() {
136                return execPrm;
137        }
138
139        /**
140         * エラー送信先を返します。
141         *
142         * @return エラー送信先
143         */
144        public String getErrorSendto() {
145                return errorSendto;
146        }
147
148        /**
149         * 送り元ホストコードを返します。
150         *
151         * @return 送り元ホストコード
152         */
153        public String getHfrom() {
154                return hfrom;
155        }
156
157        /**
158         * プロキシホスト名を返します。
159         *
160         * @return プロキシホスト名
161         */
162        public String getProxyHost() {
163                return proxyHost;
164        }
165
166        /**
167         * プロキシポート番号を返します。
168         *
169         * @return プロキシポート番号
170         */
171        public int getProxyPort() {
172                return proxyPort;
173        }
174
175        /**
176         * このオブジェクトの文字列表現を返します
177         *
178         * @return 文字列表現
179         */
180        @Override
181        public String toString() {
182                StringBuilder buf = new StringBuilder();
183                buf.append( "kbRead=" ).append( kbRead )
184                        .append( "readObj=" ).append( readObj )
185                        .append( ",readPrm=" ).append( readPrm )
186                        .append( ",kbExec=" ).append( kbExec )
187                        .append( ",execDbid=" ).append( execDbid )
188                        .append( ",execObj=" ).append( execObj )
189                        .append( ",execPrm=" ).append( execPrm )
190                        .append( ",errorSendto=" ).append( errorSendto )
191                        .append( ",hfrom=" ).append( hfrom )
192                        .append( ",proxyHost=" ).append( proxyHost )
193                        .append( ",proxyPort=" ).append( proxyPort );
194                return buf.toString();
195        }
196}