FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
java-sdk/src/main/java/co/stateful/RtLocks.java at master · sttc/java-sdk · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
sttc
/
java-sdk
Public
Notifications
You must be signed in to change notification settings
Fork
3
Star
9
Code
Issues
3
Pull requests
4
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
java-sdk
/
src
/
main
/
java
/
co
/
stateful
/
RtLocks.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
59 lines (53 loc) · 1.4 KB
Breadcrumbs
java-sdk
/
src
/
main
/
java
/
co
/
stateful
/
RtLocks.java
Copy path
File metadata and controls
59 lines (53 loc) · 1.4 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* SPDX-FileCopyrightText: Copyright (c) 2014-2026, stateful.co
* SPDX-License-Identifier: MIT
*/
package
co
.
stateful
;
import
com
.
jcabi
.
aspects
.
Immutable
;
import
com
.
jcabi
.
aspects
.
Loggable
;
import
com
.
jcabi
.
http
.
Request
;
import
com
.
jcabi
.
http
.
response
.
RestResponse
;
import
com
.
jcabi
.
http
.
response
.
XmlResponse
;
import
jakarta
.
ws
.
rs
.
core
.
HttpHeaders
;
import
jakarta
.
ws
.
rs
.
core
.
MediaType
;
import
java
.
io
.
IOException
;
import
java
.
net
.
HttpURLConnection
;
import
lombok
.
EqualsAndHashCode
;
import
lombok
.
ToString
;
/**
* Locks.
* @since 0.2
*/
@
Immutable
@
Loggable
(
Loggable
.
DEBUG
)
@
ToString
(
of
= { })
@
EqualsAndHashCode
(
of
=
"request"
)
final
class
RtLocks
implements
Locks
{
/**
* Entry response.
*/
private
final
transient
Request
request
;
/**
* Ctor.
* @param req Request
*/
RtLocks
(
final
Request
req
) {
this
.
request
=
req
;
}
@
Override
public
boolean
exists
(
final
String
name
)
throws
IOException
{
return
!
this
.
request
.
header
(
HttpHeaders
.
ACCEPT
,
MediaType
.
TEXT_XML
)
.
fetch
()
.
as
(
RestResponse
.
class
)
.
assertStatus
(
HttpURLConnection
.
HTTP_OK
)
.
as
(
XmlResponse
.
class
)
.
xml
()
.
nodes
(
String
.
format
(
"/page/locks/lock[name='%s']"
,
name
))
.
isEmpty
();
}
@
Override
public
Lock
get
(
final
String
name
) {
return
new
RtLock
(
name
,
this
.
request
);
}
}
Back
|
FazBrowse Home
|
New Git URL