Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abook_check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_android
abook_check
Commits
c46a24b5
Commit
c46a24b5
authored
Sep 20, 2023
by
Kim Jinsung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #55446【@Form】パスワード変更ができない
parent
43ab850c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
19 deletions
+37
-19
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
+14
-14
ABVJE_BL/src/jp/agentec/abook/abv/bl/download/ContentRefresher.java
+16
-1
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/MasterDataLogic.java
+5
-2
ABVJE_BL/src/jp/agentec/adf/net/http/HttpRequestSender.java
+2
-2
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
View file @
c46a24b5
...
...
@@ -112,6 +112,7 @@ public class AcmsClient implements AcmsClientResponseListener {
private
Date
lastPresentTime
=
DateTimeUtil
.
getCurrentDate
();
// 最後の通信時に取得したサーバの時間
private
int
mRetryCount
;
/**
* {@link AcmsClient} のインスタンスを初期化します。
* @since 1.0.0
...
...
@@ -832,14 +833,15 @@ public class AcmsClient implements AcmsClientResponseListener {
Logger
.
d
(
TAG
,
"[url : %s], [param : %s]"
,
apiUrl
,
param
==
null
?
""
:
param
.
toHttpParameterString
());
HttpTaskWorker
<
HttpParameterObject
>
httpTaskThread
=
null
;
HttpTaskWorker
<
HttpParameterObject
>
httpTaskThread
=
new
HttpTaskWorker
<
HttpParameterObject
>(
methodName
,
apiUrl
,
param
);
try
{
long
t
=
HttpRequestSender
.
DefaultConnectionTimeout
*
2
;
for
(
int
i
=
0
;
i
<
3
;
i
++,
t
*=
2
)
{
httpTaskThread
=
new
HttpTaskWorker
<
HttpParameterObject
>(
methodName
,
apiUrl
,
param
);
httpTaskThread
.
start
();
httpTaskThread
.
join
(
t
);
if
(
methodName
.
equals
(
AcmsApis
.
ApiGetMasterData
))
{
//マスタデータ取得失敗時、タイムアウト設定する
long
connectionTimeout
=
HttpRequestSender
.
DefaultConnectionTimeout
*
(
mRetryCount
+
1
);
Logger
.
i
(
TAG
,
"ApiGetMasterData mRetryCount = "
+
mRetryCount
+
", time out = "
+
connectionTimeout
);
httpTaskThread
.
join
(
connectionTimeout
);
}
else
{
httpTaskThread
.
join
(
HttpRequestSender
.
DefaultConnectionTimeout
);
}
}
catch
(
Exception
e
)
{
Logger
.
e
(
TAG
,
e
);
...
...
@@ -884,14 +886,10 @@ public class AcmsClient implements AcmsClientResponseListener {
}
String
apiUrl
=
url
;
HttpMultipartTaskWorker
<
HttpMultipart
>
httpTaskThread
=
null
;
try
{
long
t
=
HttpRequestSender
.
DefaultConnectionTimeout
*
2
;
for
(
int
i
=
0
;
i
<
3
;
i
++,
t
*=
2
)
{
httpTaskThread
=
new
HttpMultipartTaskWorker
<
HttpMultipart
>(
apiUrl
,
param
);
HttpMultipartTaskWorker
<
HttpMultipart
>
httpTaskThread
=
new
HttpMultipartTaskWorker
<
HttpMultipart
>(
apiUrl
,
param
);
try
{
httpTaskThread
.
start
();
httpTaskThread
.
join
(
t
);
}
httpTaskThread
.
join
(
HttpRequestSender
.
DefaultConnectionTimeout
);
}
catch
(
Exception
e
)
{
Logger
.
d
(
TAG
,
ExceptionDetailMessage
.
SERVER_IS_DISCONNECTED
);
// サーバとの通信中、予期せぬ問題が発生しました。(1)
...
...
@@ -1041,11 +1039,13 @@ public class AcmsClient implements AcmsClientResponseListener {
/**
* ACMSから、マスタデータ情報を取得します。
* @param param {@link AcmsParameters} オブジェクトです。
* @param retryCount 失敗カウント
* @return コンテンツバージョン情報を格納した {@link ContentDto} のリストを返します。
* 情報の変更がない(HttpStatus 304)場合はnullを返す。
* @since 1.0.0
*/
public
MasterDataJSON
masterData
(
AcmsParameters
param
)
throws
NetworkDisconnectedException
,
AcmsException
{
public
MasterDataJSON
masterData
(
AcmsParameters
param
,
int
retryCount
)
throws
NetworkDisconnectedException
,
AcmsException
{
this
.
mRetryCount
=
retryCount
;
HttpResponse
response
=
send
(
AcmsApis
.
ApiGetMasterData
,
param
);
MasterDataJSON
json
=
new
MasterDataJSON
(
response
.
httpResponseBody
);
return
json
;
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/download/ContentRefresher.java
View file @
c46a24b5
...
...
@@ -166,7 +166,22 @@ import jp.agentec.adf.util.DateTimeUtil;
Logger
.
d
(
TAG
,
"before fetchDate : "
+
ABVDataCache
.
getInstance
().
tempMasterDataFetchDate
);
// CMSでメンテナンスされるHACCPマスタデータをアプリから取得できるようにJSONファイルを生成する。
String
fetchDate
=
masterDataLogic
.
initializeMasterData
(
ABVDataCache
.
getInstance
().
tempMasterDataFetchDate
);
String
fetchDate
=
null
;
//失敗時、3回リトライ処理
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
try
{
fetchDate
=
masterDataLogic
.
initializeMasterData
(
ABVDataCache
.
getInstance
().
tempMasterDataFetchDate
,
i
);
break
;
}
catch
(
Exception
e
)
{
Logger
.
e
(
TAG
,
"initializeMasterData Exception"
,
e
);
if
(
i
==
2
)
{
//3回目に例外処理投げる。
throw
e
;
}
else
{
Thread
.
sleep
(
500
);
//0.5秒間隔でリトライ処理を実行
}
}
}
Logger
.
d
(
TAG
,
"after fetchDate : "
+
fetchDate
);
if
(
fetchDate
!=
null
)
{
// マスタデータの最新更新された時のFetchDateを一時に保存する。
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/MasterDataLogic.java
View file @
c46a24b5
...
...
@@ -8,6 +8,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.MasterDataJSON;
import
jp.agentec.abook.abv.bl.acms.client.parameters.FetchDateParameters
;
import
jp.agentec.abook.abv.bl.common.ABVEnvironment
;
import
jp.agentec.abook.abv.bl.common.exception.ABVException
;
import
jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode
;
import
jp.agentec.abook.abv.bl.common.exception.AcmsException
;
import
jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
...
...
@@ -21,16 +22,18 @@ public class MasterDataLogic extends AbstractLogic {
* マスタデータ情報をサーバから受信し、ローカルにJSONで保存する。で、
* データ単位で項目はあるが要素が0件のデータは削除、
* データ単位で項目が存在しないデータは変更無し
* @param lastFetchDate 最終実行日付
* @param retryCount 失敗カウント
* @throws ABVException キャッシュにユーザ情報がありません。再度ログインする必要があります。
* @throws AcmsException
* @throws Exception その他、例外です。
* @since 1.0.0
*/
public
String
initializeMasterData
(
String
lastFetchDate
)
throws
AcmsException
,
NetworkDisconnectedException
,
IOException
{
public
String
initializeMasterData
(
String
lastFetchDate
,
int
retryCount
)
throws
AcmsException
,
NetworkDisconnectedException
,
IOException
{
String
fetchDate
=
null
;
try
{
FetchDateParameters
param
=
new
FetchDateParameters
(
cache
.
getMemberInfo
().
sid
,
lastFetchDate
);
MasterDataJSON
masterDataJson
=
AcmsClient
.
getInstance
(
cache
.
getUrlPath
(),
networkAdapter
).
masterData
(
param
);
MasterDataJSON
masterDataJson
=
AcmsClient
.
getInstance
(
cache
.
getUrlPath
(),
networkAdapter
).
masterData
(
param
,
retryCount
);
// get MAP
Map
<
String
,
String
>
masterDataMap
=
masterDataJson
.
masterDataMap
;
...
...
ABVJE_BL/src/jp/agentec/adf/net/http/HttpRequestSender.java
View file @
c46a24b5
...
...
@@ -42,10 +42,10 @@ public class HttpRequestSender {
/**
* ホストに接続するまでのタイムアウト時間をミリ秒で設定します。<br>
* デフォルトは
5,000ミリ秒(5
秒)です。
* デフォルトは
20,000ミリ秒(20
秒)です。
* @since 1.0.0
*/
public
static
final
int
DefaultConnectionTimeout
=
5
*
1000
;
public
static
final
int
DefaultConnectionTimeout
=
20
*
1000
;
/**
* 通信に利用する既定の文字セットです。UTF-8となります。
* @since 1.0.0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment