Last change
on this file since 5549 was
5549,
checked in by olhsha@mpi.nl, 10 years ago
|
Added group service. Tested via the tomcat on loclahots (test URI and postman), old unit tests are adjusted and work well. Todo: retest on localhost tomcat, look at run-time exceptions, add new unit tests, adjust front-end
|
File size:
937 bytes
|
Line | |
---|
1 | package clarin.cmdi.componentregistry.rest; |
---|
2 | |
---|
3 | import java.security.Principal; |
---|
4 | |
---|
5 | import clarin.cmdi.componentregistry.ComponentRegistry; |
---|
6 | import clarin.cmdi.componentregistry.ItemNotFoundException; |
---|
7 | import clarin.cmdi.componentregistry.UserUnauthorizedException; |
---|
8 | import clarin.cmdi.componentregistry.components.CMDComponentSpec; |
---|
9 | import clarin.cmdi.componentregistry.model.BaseDescription; |
---|
10 | import clarin.cmdi.componentregistry.model.RegisterResponse; |
---|
11 | |
---|
12 | public class PublishAction implements RegisterAction { |
---|
13 | |
---|
14 | private final Principal principal; |
---|
15 | |
---|
16 | public PublishAction(Principal principal) { |
---|
17 | this.principal = principal; |
---|
18 | } |
---|
19 | |
---|
20 | @Override |
---|
21 | public int execute(BaseDescription desc, CMDComponentSpec spec, RegisterResponse response, ComponentRegistry registry) throws UserUnauthorizedException, ItemNotFoundException{ |
---|
22 | response.setIsInUserSpace(false); |
---|
23 | return registry.publish(desc, spec, principal); |
---|
24 | } |
---|
25 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.