source: ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/rest/PublishAction.java @ 5603

Last change on this file since 5603 was 5603, checked in by olhsha@mpi.nl, 10 years ago

little fixes

File size: 933 bytes
Line 
1package clarin.cmdi.componentregistry.rest;
2
3import java.security.Principal;
4
5import clarin.cmdi.componentregistry.ComponentRegistry;
6import clarin.cmdi.componentregistry.ItemNotFoundException;
7import clarin.cmdi.componentregistry.UserUnauthorizedException;
8import clarin.cmdi.componentregistry.components.CMDComponentSpec;
9import clarin.cmdi.componentregistry.model.BaseDescription;
10import clarin.cmdi.componentregistry.model.RegisterResponse;
11
12public 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.setIsPrivate(false);
23        return registry.publish(desc, spec, principal);
24    }
25}
Note: See TracBrowser for help on using the repository browser.