Revision 59609
Added by Claudio Atzori about 4 years ago
modules/dnet-datasource-manager-common/trunk/dnet-datasource-manager-common.iml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> |
|
3 |
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8"> |
|
4 |
<output url="file://$MODULE_DIR$/target/classes" /> |
|
5 |
<output-test url="file://$MODULE_DIR$/target/test-classes" /> |
|
6 |
<content url="file://$MODULE_DIR$"> |
|
7 |
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> |
|
8 |
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> |
|
9 |
<excludeFolder url="file://$MODULE_DIR$/target" /> |
|
10 |
</content> |
|
11 |
<orderEntry type="inheritedJdk" /> |
|
12 |
<orderEntry type="sourceFolder" forTests="false" /> |
|
13 |
<orderEntry type="library" name="Maven: com.google.guava:guava:23.3-jre" level="project" /> |
|
14 |
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" /> |
|
15 |
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.0.18" level="project" /> |
|
16 |
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.1" level="project" /> |
|
17 |
<orderEntry type="library" name="Maven: org.codehaus.mojo:animal-sniffer-annotations:1.14" level="project" /> |
|
18 |
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.0" level="project" /> |
|
19 |
<orderEntry type="library" name="Maven: javax.persistence:persistence-api:1.0" level="project" /> |
|
20 |
<orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" /> |
|
21 |
</component> |
|
22 |
</module> |
modules/dnet-datasource-manager-common/trunk/src/main/java/eu/dnetlib/enabling/datasources/common/DsmNotFoundException.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.enabling.datasources.common; |
2 | 2 |
|
3 |
public class DsmNotFoundException extends Exception { |
|
3 |
public class DsmNotFoundException extends DsmException {
|
|
4 | 4 |
|
5 |
private int code; |
|
6 |
|
|
7 | 5 |
public DsmNotFoundException(int code, String msg) { |
8 |
super(msg); |
|
9 |
this.code = code; |
|
6 |
super(code, msg); |
|
10 | 7 |
} |
11 | 8 |
|
12 | 9 |
public DsmNotFoundException(int code, Throwable e) { |
13 |
super(e); |
|
14 |
this.code = code; |
|
10 |
super(code, e); |
|
15 | 11 |
} |
16 | 12 |
|
17 | 13 |
public DsmNotFoundException(int code, String msg, Throwable e) { |
18 |
super(msg, e); |
|
19 |
this.code = code; |
|
14 |
super(code, msg, e); |
|
20 | 15 |
} |
21 | 16 |
|
22 | 17 |
public DsmNotFoundException(String msg) { |
23 | 18 |
this(404, msg); |
24 | 19 |
} |
25 | 20 |
|
26 |
public int getCode() { |
|
27 |
return code; |
|
28 |
} |
|
29 |
|
|
30 |
public void setCode(final int code) { |
|
31 |
this.code = code; |
|
32 |
} |
|
33 | 21 |
} |
modules/dnet-datasource-manager-common/trunk/src/main/java/eu/dnetlib/enabling/datasources/common/DsmForbiddenException.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.enabling.datasources.common; |
2 | 2 |
|
3 |
public class DsmForbiddenException extends Exception { |
|
3 |
public class DsmForbiddenException extends DsmException {
|
|
4 | 4 |
|
5 |
private int code; |
|
6 |
|
|
7 | 5 |
public DsmForbiddenException(int code, String msg) { |
8 |
super(msg); |
|
9 |
this.code = code; |
|
6 |
super(code, msg); |
|
10 | 7 |
} |
11 | 8 |
|
12 | 9 |
public DsmForbiddenException(int code, Throwable e) { |
13 |
super(e); |
|
14 |
this.code = code; |
|
10 |
super(code, e); |
|
15 | 11 |
} |
16 | 12 |
|
17 | 13 |
public DsmForbiddenException(int code, String msg, Throwable e) { |
18 |
super(msg, e); |
|
19 |
this.code = code; |
|
14 |
super(code, msg, e); |
|
20 | 15 |
} |
21 | 16 |
|
22 | 17 |
public DsmForbiddenException(String msg) { |
23 | 18 |
this(403, msg); |
24 | 19 |
} |
25 | 20 |
|
26 |
public int getCode() { |
|
27 |
return code; |
|
28 |
} |
|
29 |
|
|
30 |
public void setCode(final int code) { |
|
31 |
this.code = code; |
|
32 |
} |
|
33 |
|
|
34 | 21 |
} |
modules/dnet-datasource-manager-common/trunk/src/main/java/eu/dnetlib/enabling/datasources/common/DatasourceManagerCommon.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
void deleteDs(String dsId) throws DsmException; |
12 | 12 |
|
13 |
void deleteApi(String dsId, String apiId) throws DsmException; |
|
13 |
void deleteApi(String dsId, String apiId) throws DsmForbiddenException, DsmNotFoundException;
|
|
14 | 14 |
|
15 | 15 |
void addApi(API api) throws DsmException; |
16 | 16 |
|
Also available in: Unified diff
improved error returned for method deleteApi(String dsId, String apiId)