Revision 36571
Added by Michele Artini over 9 years ago
modules/dnet-components/trunk/src/main/java/eu/dnetlib/rmi/soap/exceptions/DocumentNotFoundException.java | ||
---|---|---|
1 |
package eu.dnetlib.rmi.soap.exceptions; |
|
2 |
|
|
3 |
import javax.xml.ws.WebFault; |
|
4 |
|
|
5 |
@WebFault(name = "DocumentNotFoundException", targetNamespace = "http://services.dnetlib.eu/") |
|
6 |
public class DocumentNotFoundException extends MDStoreServiceException { |
|
7 |
|
|
8 |
/** |
|
9 |
* |
|
10 |
*/ |
|
11 |
private static final long serialVersionUID = -4178194133581178114L; |
|
12 |
|
|
13 |
public DocumentNotFoundException(final String string) { |
|
14 |
super(string); |
|
15 |
} |
|
16 |
|
|
17 |
public DocumentNotFoundException(final String string, final Throwable exception) { |
|
18 |
super(string, exception); |
|
19 |
} |
|
20 |
|
|
21 |
public DocumentNotFoundException(final Throwable exception) { |
|
22 |
super(exception); |
|
23 |
} |
|
24 |
} |
modules/dnet-components/trunk/src/main/java/eu/dnetlib/rmi/soap/exceptions/MDStoreServiceException.java | ||
---|---|---|
1 |
package eu.dnetlib.rmi.soap.exceptions; |
|
2 |
|
|
3 |
import javax.xml.ws.WebFault; |
|
4 |
|
|
5 |
@WebFault(name = "MDStoreServiceException", targetNamespace = "http://services.dnetlib.eu/") |
|
6 |
public class MDStoreServiceException extends DnetSoapException { |
|
7 |
|
|
8 |
/** |
|
9 |
* |
|
10 |
*/ |
|
11 |
private static final long serialVersionUID = -3838320972987483940L; |
|
12 |
|
|
13 |
public MDStoreServiceException(final String string) { |
|
14 |
super(string); |
|
15 |
} |
|
16 |
|
|
17 |
public MDStoreServiceException(final String string, final Throwable exception) { |
|
18 |
super(string, exception); |
|
19 |
} |
|
20 |
|
|
21 |
public MDStoreServiceException(final Throwable exception) { |
|
22 |
super(exception); |
|
23 |
} |
|
24 |
|
|
25 |
} |
modules/dnet-components/trunk/src/main/java/eu/dnetlib/rmi/soap/MDStoreService.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.rmi.soap; |
2 | 2 |
|
3 |
import java.util.List; |
|
4 |
|
|
5 |
import javax.jws.WebMethod; |
|
6 |
import javax.jws.WebParam; |
|
3 | 7 |
import javax.jws.WebService; |
4 | 8 |
|
9 |
import eu.dnetlib.rmi.objects.resultSet.ResultSet; |
|
10 |
import eu.dnetlib.rmi.soap.exceptions.DocumentNotFoundException; |
|
11 |
import eu.dnetlib.rmi.soap.exceptions.MDStoreServiceException; |
|
12 |
|
|
5 | 13 |
@WebService(targetNamespace = "http://services.dnetlib.eu/") |
6 | 14 |
public interface MDStoreService extends BaseService { |
7 | 15 |
|
16 |
/** |
|
17 |
* Returns ResultSet EPR for delivered mdstore records. |
|
18 |
* |
|
19 |
* @param mdId |
|
20 |
* @param from |
|
21 |
* @param until |
|
22 |
* @param recordFilter |
|
23 |
* REGEX on the metadata record |
|
24 |
* @return ResultSet EPR |
|
25 |
* @throws MDStoreServiceException |
|
26 |
*/ |
|
27 |
public ResultSet<String> deliverMDRecords(@WebParam(name = "mdId") final String mdId, |
|
28 |
@WebParam(name = "from") final String from, |
|
29 |
@WebParam(name = "until") final String until, |
|
30 |
@WebParam(name = "recordsFilter") final String recordFilter) throws MDStoreServiceException; |
|
31 |
|
|
32 |
/** |
|
33 |
* Deliver single record from selected mdstore. |
|
34 |
* |
|
35 |
* @param mdId |
|
36 |
* @param recordId |
|
37 |
* @return record |
|
38 |
* @throws MDStoreServiceException |
|
39 |
*/ |
|
40 |
public String deliverRecord(@WebParam(name = "mdId") final String mdId, @WebParam(name = "recordId") final String recordId) throws MDStoreServiceException, |
|
41 |
DocumentNotFoundException; |
|
42 |
|
|
43 |
/** |
|
44 |
* Returns list of all stored indices. |
|
45 |
* |
|
46 |
* @return list of all stored indices |
|
47 |
*/ |
|
48 |
public List<String> getListOfMDStores() throws MDStoreServiceException; |
|
49 |
|
|
50 |
public List<String> listMDStores(@WebParam(name = "format") final String format, |
|
51 |
@WebParam(name = "layout") final String layout, |
|
52 |
@WebParam(name = "interpretation") final String interpretation) throws MDStoreServiceException; |
|
53 |
|
|
54 |
public ResultSet<String> bulkDeliverMDRecords(@WebParam(name = "format") final String format, |
|
55 |
@WebParam(name = "layout") final String layout, |
|
56 |
@WebParam(name = "interpretation") final String interpretation) throws MDStoreServiceException; |
|
57 |
|
|
58 |
/** |
|
59 |
* Gets the size of the mdstore with the given identifier. |
|
60 |
* |
|
61 |
* @param mdId |
|
62 |
* identifier of an mdstore |
|
63 |
* @return the number of records in the store |
|
64 |
*/ |
|
65 |
@WebMethod(operationName = "size") |
|
66 |
public int size(@WebParam(name = "mdId") final String mdId) throws MDStoreServiceException; |
|
67 |
|
|
68 |
/** |
|
69 |
* Gets the sum of records stored in all mdstore with the given format, layout , interpretation |
|
70 |
* |
|
71 |
* @param format |
|
72 |
* format |
|
73 |
* @param layout |
|
74 |
* layout |
|
75 |
* @param interpretation |
|
76 |
* interpretation |
|
77 |
* @return the total number of records in the mdstores of the given type |
|
78 |
*/ |
|
79 |
@WebMethod(operationName = "sizeByFormat") |
|
80 |
public int size(@WebParam(name = "format") final String format, |
|
81 |
@WebParam(name = "layout") final String layout, |
|
82 |
@WebParam(name = "interpretation") final String interpretation) throws MDStoreServiceException; |
|
8 | 83 |
} |
modules/dnet-components/trunk/src/main/java/eu/dnetlib/rmi/blackboard/FeedMDStoreMessage.java | ||
---|---|---|
1 |
package eu.dnetlib.rmi.blackboard; |
|
2 |
|
|
3 |
import eu.dnetlib.common.ifaces.ProgressProvider; |
|
4 |
import eu.dnetlib.rmi.objects.resultSet.ResultSet; |
|
5 |
|
|
6 |
public class FeedMDStoreMessage implements ProgressProvider { |
|
7 |
|
|
8 |
private String mdId; |
|
9 |
private String storingType; |
|
10 |
private ResultSet<String> resultset; |
|
11 |
private int size = 0; |
|
12 |
private int progressTotal = 0; |
|
13 |
private int progressPosition = 0; |
|
14 |
private boolean progressInaccurate = false; |
|
15 |
|
|
16 |
public FeedMDStoreMessage() {}; |
|
17 |
|
|
18 |
public FeedMDStoreMessage(final String mdId, final String storingType, final ResultSet<String> resultset) { |
|
19 |
this.mdId = mdId; |
|
20 |
this.storingType = storingType; |
|
21 |
this.resultset = resultset; |
|
22 |
} |
|
23 |
|
|
24 |
public String getMdId() { |
|
25 |
return mdId; |
|
26 |
} |
|
27 |
|
|
28 |
public void setMdId(final String mdId) { |
|
29 |
this.mdId = mdId; |
|
30 |
} |
|
31 |
|
|
32 |
public String getStoringType() { |
|
33 |
return storingType; |
|
34 |
} |
|
35 |
|
|
36 |
public void setStoringType(final String storingType) { |
|
37 |
this.storingType = storingType; |
|
38 |
} |
|
39 |
|
|
40 |
public ResultSet<String> getResultset() { |
|
41 |
return resultset; |
|
42 |
} |
|
43 |
|
|
44 |
public void setResultset(final ResultSet<String> resultset) { |
|
45 |
this.resultset = resultset; |
|
46 |
} |
|
47 |
|
|
48 |
public int getSize() { |
|
49 |
return size; |
|
50 |
} |
|
51 |
|
|
52 |
public void setSize(final int size) { |
|
53 |
this.size = size; |
|
54 |
} |
|
55 |
|
|
56 |
@Override |
|
57 |
public int getProgressTotal() { |
|
58 |
return progressTotal; |
|
59 |
} |
|
60 |
|
|
61 |
@Override |
|
62 |
public int getProgressPosition() { |
|
63 |
return progressPosition; |
|
64 |
} |
|
65 |
|
|
66 |
@Override |
|
67 |
public boolean isProgressInaccurate() { |
|
68 |
return progressInaccurate; |
|
69 |
} |
|
70 |
|
|
71 |
public void setProgressInaccurate(final boolean progressInaccurate) { |
|
72 |
this.progressInaccurate = progressInaccurate; |
|
73 |
} |
|
74 |
|
|
75 |
public void setProgressTotal(final int progressTotal) { |
|
76 |
this.progressTotal = progressTotal; |
|
77 |
} |
|
78 |
|
|
79 |
public void setProgressPosition(final int progressPosition) { |
|
80 |
this.progressPosition = progressPosition; |
|
81 |
} |
|
82 |
|
|
83 |
} |
modules/dnet-components/trunk/src/main/java/eu/dnetlib/common/ifaces/ProgressProvider.java | ||
---|---|---|
1 |
package eu.dnetlib.common.ifaces; |
|
2 |
|
|
3 |
public interface ProgressProvider { |
|
4 |
|
|
5 |
public int getProgressTotal(); |
|
6 |
|
|
7 |
public int getProgressPosition(); |
|
8 |
|
|
9 |
public boolean isProgressInaccurate(); |
|
10 |
} |
modules/dnet-components/trunk/src/main/java/eu/dnetlib/common/ifaces/Progress.java | ||
---|---|---|
1 |
package eu.dnetlib.common.ifaces; |
|
2 |
|
|
3 |
import javax.xml.bind.annotation.XmlRootElement; |
|
4 |
|
|
5 |
@XmlRootElement |
|
6 |
public class Progress { |
|
7 |
|
|
8 |
private boolean inaccurate = false; |
|
9 |
private int total = 0; |
|
10 |
private int current = 0; |
|
11 |
|
|
12 |
public Progress() {} |
|
13 |
|
|
14 |
public Progress(final boolean inaccurate, final int total, final int current) { |
|
15 |
this.inaccurate = inaccurate; |
|
16 |
this.total = total; |
|
17 |
this.current = current; |
|
18 |
} |
|
19 |
|
|
20 |
public boolean isInaccurate() { |
|
21 |
return inaccurate; |
|
22 |
} |
|
23 |
|
|
24 |
public void setInaccurate(final boolean inaccurate) { |
|
25 |
this.inaccurate = inaccurate; |
|
26 |
} |
|
27 |
|
|
28 |
public int getTotal() { |
|
29 |
return total; |
|
30 |
} |
|
31 |
|
|
32 |
public void setTotal(final int total) { |
|
33 |
this.total = total; |
|
34 |
} |
|
35 |
|
|
36 |
public int getCurrent() { |
|
37 |
return current; |
|
38 |
} |
|
39 |
|
|
40 |
public void setCurrent(final int current) { |
|
41 |
this.current = current; |
|
42 |
} |
|
43 |
|
|
44 |
} |
Also available in: Unified diff
ProgressProvider as a bb message