Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vospacebackend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sara Bertocco
vospacebackend
Commits
33b4bae1
Commit
33b4bae1
authored
8 years ago
by
Sara Bertocco
Browse files
Options
Downloads
Patches
Plain Diff
New working version after Victoria trip - new file
parent
602e4604
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/it/inaf/oats/vospacebackend/implementation/NodeUtils.java
+68
-0
68 additions, 0 deletions
...it/inaf/oats/vospacebackend/implementation/NodeUtils.java
with
68 additions
and
0 deletions
src/main/java/it/inaf/oats/vospacebackend/implementation/NodeUtils.java
0 → 100644
+
68
−
0
View file @
33b4bae1
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package
it.inaf.oats.vospacebackend.implementation
;
import
ca.nrc.cadc.net.TransientException
;
import
ca.nrc.cadc.vos.Node
;
import
ca.nrc.cadc.vos.NodeNotFoundException
;
import
ca.nrc.cadc.vos.VOSURI
;
import
ca.nrc.cadc.vos.server.NodeID
;
import
java.net.URISyntaxException
;
import
org.apache.log4j.Logger
;
/**
*
* @author bertocco
*/
public
class
NodeUtils
{
public
DatabaseNodePersistenceImpl
dbNodePers
;
private
static
final
Logger
log
=
Logger
.
getLogger
(
NodeUtils
.
class
);
public
NodeUtils
()
{
dbNodePers
=
new
DatabaseNodePersistenceImpl
();
}
public
Long
getNodeIdLongfromVosuriStr
(
String
vosuri
)
{
Node
myNode
=
null
;
NodeID
nodeID
;
myNode
=
getNodeFromVosuriStr
(
vosuri
);
if
(
myNode
!=
null
)
{
nodeID
=
(
NodeID
)
myNode
.
appData
;
return
nodeID
.
getID
();
}
else
{
return
null
;
}
}
/* Returns the node or null if something went wrong */
public
Node
getNodeFromVosuriStr
(
String
vosuri
)
{
Node
myNode
=
null
;
try
{
myNode
=
dbNodePers
.
get
(
new
VOSURI
(
vosuri
));
}
catch
(
NodeNotFoundException
e
)
{
log
.
debug
(
"NodeNotFoundException getting node from persistence."
);
log
.
debug
(
e
.
getMessage
());
}
catch
(
TransientException
e
)
{
log
.
debug
(
"TransientException getting node from persistence."
);
log
.
debug
(
e
.
getMessage
());
}
catch
(
URISyntaxException
e
)
{
log
.
debug
(
"URISyntaxException getting node from persistence."
);
log
.
debug
(
e
.
getMessage
());
}
return
myNode
;
}
}
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