1 |
4226
|
leinfelder
|
/**
|
2 |
|
|
* '$RCSfile: ConfigurableEcogridEndPoint.java,v $'
|
3 |
|
|
*
|
4 |
|
|
* '$Author: leinfelder $'
|
5 |
|
|
* '$Date: 2008/06/20 17:47:12 $'
|
6 |
|
|
* '$Revision: 1.1 $'
|
7 |
|
|
*
|
8 |
|
|
* For Details: http://ecoinformatics.org
|
9 |
|
|
*
|
10 |
|
|
* Copyright (c) 2007 The Regents of the University of California.
|
11 |
|
|
* All rights reserved.
|
12 |
|
|
*
|
13 |
|
|
* Permission is hereby granted, without written agreement and without
|
14 |
|
|
* license or royalty fees, to use, copy, modify, and distribute this
|
15 |
|
|
* software and its documentation for any purpose, provided that the
|
16 |
|
|
* above copyright notice and the following two paragraphs appear in
|
17 |
|
|
* all copies of this software.
|
18 |
|
|
*
|
19 |
|
|
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
|
20 |
|
|
* FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
21 |
|
|
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
|
22 |
|
|
* IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY
|
23 |
|
|
* OF SUCH DAMAGE.
|
24 |
|
|
*
|
25 |
|
|
* THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
|
26 |
|
|
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
27 |
|
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
|
28 |
|
|
* PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY
|
29 |
|
|
* OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
|
30 |
|
|
* UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
31 |
|
|
*/
|
32 |
|
|
package edu.ucsb.nceas.metacat.dataquery;
|
33 |
|
|
|
34 |
|
|
import org.ecoinformatics.datamanager.download.AuthenticatedEcogridEndPointInterface;
|
35 |
|
|
|
36 |
5030
|
daigle
|
import edu.ucsb.nceas.metacat.properties.PropertyService;
|
37 |
4226
|
leinfelder
|
import edu.ucsb.nceas.utilities.PropertyNotFoundException;
|
38 |
|
|
|
39 |
|
|
/**
|
40 |
|
|
* This class implements AuthenticatedEcogridEndPointInterface
|
41 |
|
|
* and is configurable using the properties file.
|
42 |
|
|
* Useful for switching to remote endpoints etc.
|
43 |
|
|
*
|
44 |
|
|
* @author leinfelder
|
45 |
|
|
*
|
46 |
|
|
*/
|
47 |
6000
|
leinfelder
|
public class MetacatAuthenticatedEcogridEndPoint
|
48 |
|
|
extends MetacatEcogridEndPoint implements AuthenticatedEcogridEndPointInterface {
|
49 |
4226
|
leinfelder
|
|
50 |
|
|
private String metacatAuthenticatedEcogridEndPoint = null;
|
51 |
|
|
private String sessionId = null;
|
52 |
|
|
|
53 |
6000
|
leinfelder
|
public MetacatAuthenticatedEcogridEndPoint() {
|
54 |
4247
|
leinfelder
|
super();
|
55 |
|
|
if (!loadProperties()) {
|
56 |
|
|
metacatAuthenticatedEcogridEndPoint = baseURL + "AuthenticatedQueryService";
|
57 |
4226
|
leinfelder
|
}
|
58 |
|
|
}
|
59 |
|
|
|
60 |
6000
|
leinfelder
|
public MetacatAuthenticatedEcogridEndPoint(String sessionId) {
|
61 |
4226
|
leinfelder
|
this();
|
62 |
|
|
this.sessionId = sessionId;
|
63 |
|
|
}
|
64 |
|
|
|
65 |
4247
|
leinfelder
|
private boolean loadProperties() {
|
66 |
|
|
try {
|
67 |
|
|
metacatAuthenticatedEcogridEndPoint = PropertyService.getProperty("datamanager.endpoint.authenticatedquery");
|
68 |
|
|
} catch (PropertyNotFoundException e) {
|
69 |
|
|
//e.printStackTrace();
|
70 |
|
|
return false;
|
71 |
|
|
}
|
72 |
|
|
if (metacatAuthenticatedEcogridEndPoint == null || metacatAuthenticatedEcogridEndPoint.length() == 0) {
|
73 |
|
|
return false;
|
74 |
|
|
}
|
75 |
|
|
return true;
|
76 |
|
|
}
|
77 |
|
|
|
78 |
4226
|
leinfelder
|
/**
|
79 |
|
|
* Gets the end point which Metacat implements authenticated ecogrid interface.
|
80 |
|
|
* This end point will be used to handle ecogrid protocol
|
81 |
|
|
*
|
82 |
|
|
* @return end point url string
|
83 |
|
|
*/
|
84 |
|
|
public String getMetacatAuthenticatedEcogridEndPoint()
|
85 |
|
|
{
|
86 |
|
|
return metacatAuthenticatedEcogridEndPoint;
|
87 |
|
|
}
|
88 |
|
|
|
89 |
|
|
public String getSessionId()
|
90 |
|
|
{
|
91 |
|
|
return sessionId;
|
92 |
|
|
}
|
93 |
|
|
|
94 |
|
|
public void setSessionId(String id) {
|
95 |
|
|
sessionId = id;
|
96 |
|
|
}
|
97 |
|
|
|
98 |
|
|
}
|