Line | |
---|
1 | package clarin.cmdi.componentregistry.rest; |
---|
2 | |
---|
3 | import clarin.cmdi.componentregistry.model.Comment; |
---|
4 | import java.security.Principal; |
---|
5 | |
---|
6 | import clarin.cmdi.componentregistry.ComponentRegistry; |
---|
7 | import clarin.cmdi.componentregistry.components.CMDComponentSpec; |
---|
8 | import clarin.cmdi.componentregistry.model.AbstractDescription; |
---|
9 | import clarin.cmdi.componentregistry.model.RegisterResponse; |
---|
10 | |
---|
11 | public class PublishAction implements RegisterAction { |
---|
12 | |
---|
13 | private final Principal principal; |
---|
14 | |
---|
15 | public PublishAction(Principal principal) { |
---|
16 | this.principal = principal; |
---|
17 | } |
---|
18 | |
---|
19 | @Override |
---|
20 | public int execute(AbstractDescription desc, CMDComponentSpec spec, RegisterResponse response, ComponentRegistry registry) { |
---|
21 | response.setIsInUserSpace(false); |
---|
22 | return registry.publish(desc, spec, principal); |
---|
23 | } |
---|
24 | |
---|
25 | @Override |
---|
26 | public int executeComment(Comment com, RegisterResponse response, ComponentRegistry registry, String userId) { |
---|
27 | throw new UnsupportedOperationException("Not supported yet."); |
---|
28 | } |
---|
29 | |
---|
30 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.