Revision 2819
Added by Matt Jones over 18 years ago
LSIDAuthorityData.java | ||
---|---|---|
34 | 34 |
import com.ibm.lsid.server.LSIDServerException; |
35 | 35 |
import com.ibm.lsid.server.LSIDServiceConfig; |
36 | 36 |
|
37 |
public class LSIDAuthorityData implements LSIDDataService { |
|
37 |
public class LSIDAuthorityData implements LSIDDataService |
|
38 |
{ |
|
39 |
private LSIDDataLookup lookup = null; |
|
40 |
private static Log logger = LogFactory |
|
41 |
.getLog("edu.ucsb.nceas.metacat.lsid"); |
|
38 | 42 |
|
39 |
private LSIDDataLookup lookup = null; |
|
40 |
private static Log logger = LogFactory.getLog( "edu.ucsb.nceas.metacat.lsid" ); |
|
41 |
|
|
42 |
public InputStream getData(LSIDRequestContext lsid) throws LSIDServerException { |
|
43 |
public InputStream getData(LSIDRequestContext lsid) |
|
44 |
throws LSIDServerException |
|
45 |
{ |
|
43 | 46 |
logger.debug("Getting data (Metacat): " + lsid.getLsid().toString()); |
44 |
if (lookup == null)
|
|
45 |
throw new LSIDServerException(500, "Cannot query database");
|
|
46 |
return lookup.lsidData(lsid.getLsid());
|
|
47 |
}
|
|
47 |
if (lookup == null)
|
|
48 |
throw new LSIDServerException(500, "Cannot query database");
|
|
49 |
return lookup.lsidData(lsid.getLsid());
|
|
50 |
}
|
|
48 | 51 |
|
49 |
public InputStream getDataByRange(LSIDRequestContext lsid, int start, int end) throws LSIDServerException { |
|
50 |
if (lookup == null) |
|
51 |
throw new LSIDServerException(500, "Cannot query database"); |
|
52 |
return lookup.lsidData(lsid.getLsid()); |
|
53 |
} |
|
52 |
public InputStream getDataByRange(LSIDRequestContext lsid, int start, |
|
53 |
int end) throws LSIDServerException |
|
54 |
{ |
|
55 |
if (lookup == null) |
|
56 |
throw new LSIDServerException(500, "Cannot query database"); |
|
57 |
return lookup.lsidData(lsid.getLsid()); |
|
58 |
} |
|
54 | 59 |
|
55 |
public void initService(LSIDServiceConfig cf) throws LSIDServerException { |
|
60 |
public void initService(LSIDServiceConfig cf) throws LSIDServerException |
|
61 |
{ |
|
56 | 62 |
logger.info("Starting LSIDAuthorityData (Metacat)."); |
57 |
lookup = new LSIDDataLookup();
|
|
58 |
}
|
|
63 |
lookup = new LSIDDataLookup();
|
|
64 |
}
|
|
59 | 65 |
} |
Also available in: Unified diff
Reformatted LSID code for consistency.