Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vospace-datamodel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VOSpace INAF
vospace-datamodel
Commits
1506ac2f
Commit
1506ac2f
authored
3 years ago
by
Nicola Fulvio Calabria
Browse files
Options
Downloads
Patches
Plain Diff
Refactoring for error detail endpoint development
parent
98561689
No related branches found
No related tags found
No related merge requests found
Pipeline
#1501
passed
3 years ago
Stage: build
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/net/ivoa/xml/uws/v1/ErrorSummary.java
+13
-0
13 additions, 0 deletions
src/main/java/net/ivoa/xml/uws/v1/ErrorSummary.java
src/main/java/net/ivoa/xml/uws/v1/ErrorSummaryFactory.java
+0
-58
0 additions, 58 deletions
src/main/java/net/ivoa/xml/uws/v1/ErrorSummaryFactory.java
with
13 additions
and
58 deletions
src/main/java/net/ivoa/xml/uws/v1/ErrorSummary.java
+
13
−
0
View file @
1506ac2f
...
...
@@ -13,6 +13,7 @@ import javax.xml.bind.annotation.XmlAccessorType;
import
javax.xml.bind.annotation.XmlAttribute
;
import
javax.xml.bind.annotation.XmlElement
;
import
javax.xml.bind.annotation.XmlType
;
import
javax.xml.bind.annotation.XmlTransient
;
/**
...
...
@@ -53,6 +54,10 @@ public class ErrorSummary {
protected
ErrorType
type
;
@XmlAttribute
(
name
=
"hasDetail"
,
required
=
true
)
protected
boolean
hasDetail
;
// Required by {job-id}/error endpoint
@XmlTransient
protected
String
detailMessage
;
/**
* Gets the value of the message property.
...
...
@@ -117,5 +122,13 @@ public class ErrorSummary {
public
void
setHasDetail
(
boolean
value
)
{
this
.
hasDetail
=
value
;
}
// Added by NFC by hand to implement {job-id}/error endpoint
public
String
getDetailMessage
()
{
return
detailMessage
;
}
public
void
setDetailMessage
(
String
detailMessage
)
{
this
.
detailMessage
=
detailMessage
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/net/ivoa/xml/uws/v1/ErrorSummaryFactory.java
deleted
100644 → 0
+
0
−
58
View file @
98561689
package
net.ivoa.xml.uws.v1
;
public
class
ErrorSummaryFactory
{
public
static
ErrorSummary
newErrorSummary
(
VOSpaceFault
error
)
{
ErrorSummary
result
=
new
ErrorSummary
();
result
.
setMessage
(
error
.
getFaultRepresentation
());
result
.
setType
(
error
.
getType
());
// Set to false since /error endpoint is not supported yet
result
.
setHasDetail
(
false
);
return
result
;
}
// NFC: ErrorType usage is not covered in documentation, as far as I can see
// these are tentative default values.
public
enum
VOSpaceFault
{
// pushto
OPERATION_NOT_SUPPORTED
(
"OperationNotSupported"
,
ErrorType
.
FATAL
),
INTERNAL_FAULT
(
"InternalFault"
,
ErrorType
.
TRANSIENT
),
PERMISSION_DENIED
(
"PermissionDenied"
,
ErrorType
.
FATAL
),
VIEW_NOT_SUPPORTED
(
"ViewNotSupported"
,
ErrorType
.
FATAL
),
PROTOCOL_NOT_SUPPORTED
(
"ProtocolNotSupported"
,
ErrorType
.
FATAL
),
INVALID_ARGUMENT
(
"InvalidArgument"
,
ErrorType
.
FATAL
),
NODE_BUSY
(
"NodeBusy"
,
ErrorType
.
TRANSIENT
),
// additional for pullto
INVALID_URI
(
"InvalidURI"
,
ErrorType
.
FATAL
),
INVALID_DATA
(
"InvalidData"
,
ErrorType
.
FATAL
),
// additional for pullfrom
NODE_NOT_FOUND
(
"NodeNotFound"
,
ErrorType
.
FATAL
),
// additional for pushfrom
TRANSFER_FAILED
(
"TransferFailed"
,
ErrorType
.
FATAL
),
// additional for movenode/copynode
DUPLICATE_NODE
(
"DuplicateNode"
,
ErrorType
.
FATAL
);
private
final
String
faultRepresentation
;
private
final
ErrorType
type
;
private
VOSpaceFault
(
String
faultRepresentation
,
ErrorType
type
)
{
this
.
faultRepresentation
=
faultRepresentation
;
this
.
type
=
type
;
}
public
String
getFaultRepresentation
()
{
return
this
.
faultRepresentation
;
}
public
ErrorType
getType
()
{
return
this
.
type
;
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment