Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
Java Client API
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Genesys PGR
Java Client API
Commits
c8824f82
Commit
c8824f82
authored
Apr 15, 2015
by
Matija Obreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecated updateAccessions(String, String)
parent
df9d1936
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
src/main/java/org/genesys2/client/oauth/GenesysClient.java
src/main/java/org/genesys2/client/oauth/GenesysClient.java
+17
-5
src/main/java/org/genesys2/client/oauth/api/GenesysApi.java
src/main/java/org/genesys2/client/oauth/api/GenesysApi.java
+0
-1
No files found.
src/main/java/org/genesys2/client/oauth/GenesysClient.java
View file @
c8824f82
...
...
@@ -49,7 +49,6 @@ import com.fasterxml.jackson.databind.SerializationFeature;
import
com.fasterxml.jackson.databind.node.ArrayNode
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
// TODO: Auto-generated Javadoc
/**
* Genesys API client using Scribe.
*/
...
...
@@ -67,7 +66,7 @@ public class GenesysClient {
/** The service. */
private
OAuthService
service
;
/**
GenesysTokens: access- and refreshToken. */
/** GenesysTokens: access- and refreshToken. */
private
GenesysTokens
tokens
=
new
GenesysTokens
();
/** The genesys api. */
...
...
@@ -79,10 +78,10 @@ public class GenesysClient {
/** The api secret. */
private
String
apiSecret
;
/**
Socket connect timeout. */
/** Socket connect timeout. */
private
int
connectTimeout
=
20
;
/**
Socket read timeout. */
/** Socket read timeout. */
private
int
readTimeout
=
120
;
static
{
...
...
@@ -438,7 +437,9 @@ public class GenesysClient {
* @throws InterruptedException when thread was interrupted during sleep
* between retries
*
* @deprecated Will be removed by 1.0.0 release
*/
@Deprecated
public
String
updateAccessions
(
String
instCode
,
String
jsonAccessionList
)
throws
GenesysApiException
,
InterruptedException
{
for
(
int
retry
=
0
;
retry
<
5
;
retry
++)
{
...
...
@@ -470,7 +471,18 @@ public class GenesysClient {
return
null
;
}
return
updateAccessions
(
instCode
,
objectMapper
.
writeValueAsString
(
accns
));
String
data
=
objectMapper
.
writeValueAsString
(
accns
);
for
(
int
retry
=
0
;
retry
<
5
;
retry
++)
{
try
{
return
query
(
Verb
.
PUT
,
"/acn/"
+
instCode
+
"/upsert"
,
null
,
data
);
}
catch
(
PleaseRetryException
e
)
{
long
sleepTime
=
(
long
)
(
Math
.
pow
(
2
,
retry
)
*
100
+
Math
.
pow
(
2
,
retry
)
*
2500
*
Math
.
random
());
_log
.
warn
(
"Retrying PUT after "
+
sleepTime
+
" ms."
);
Thread
.
sleep
(
sleepTime
);
}
}
throw
new
RuntimeException
(
"All retries failed"
);
}
/**
...
...
src/main/java/org/genesys2/client/oauth/api/GenesysApi.java
View file @
c8824f82
...
...
@@ -33,7 +33,6 @@ import org.scribe.model.Response;
import
org.scribe.model.Token
;
import
org.scribe.utils.OAuthEncoder
;
// TODO: Auto-generated Javadoc
/**
* Genesys API v1.
*/
...
...
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