1 | package clarin.cmdi.componentregistry; |
---|
2 | |
---|
3 | import java.io.IOException; |
---|
4 | import java.security.Principal; |
---|
5 | import java.util.List; |
---|
6 | |
---|
7 | import clarin.cmdi.componentregistry.components.CMDComponentSpec; |
---|
8 | import clarin.cmdi.componentregistry.model.ComponentDescription; |
---|
9 | import clarin.cmdi.componentregistry.model.ProfileDescription; |
---|
10 | |
---|
11 | public interface ComponentRegistry { |
---|
12 | |
---|
13 | public static final String REGISTRY_ID = "clarin.eu:cr1:"; |
---|
14 | |
---|
15 | List<ComponentDescription> getComponentDescriptions(); |
---|
16 | |
---|
17 | List<ProfileDescription> getProfileDescriptions(); |
---|
18 | |
---|
19 | CMDComponentSpec getMDProfile(String id); |
---|
20 | |
---|
21 | CMDComponentSpec getMDComponent(String id); |
---|
22 | |
---|
23 | List<MDProfile> searchMDProfiles(String searchPattern); |
---|
24 | |
---|
25 | /** |
---|
26 | * |
---|
27 | * @return -1 if profile could not be registered |
---|
28 | */ |
---|
29 | int registerMDProfile(ProfileDescription description, CMDComponentSpec spec); |
---|
30 | |
---|
31 | int registerMDComponent(ComponentDescription description, CMDComponentSpec spec); |
---|
32 | |
---|
33 | String getMDProfileAsXml(String profileId); |
---|
34 | |
---|
35 | String getMDProfileAsXsd(String profileId); |
---|
36 | |
---|
37 | String getMDComponentAsXml(String componentId); |
---|
38 | |
---|
39 | String getMDComponentAsXsd(String componentId); |
---|
40 | |
---|
41 | /** |
---|
42 | * |
---|
43 | * @param profileId |
---|
44 | * @param principal |
---|
45 | * @throws IOException |
---|
46 | * @throws UserUnauthorizedException thrown when principal does not match creator of profile |
---|
47 | */ |
---|
48 | void deleteMDProfile(String profileId, Principal principal) throws IOException, UserUnauthorizedException; |
---|
49 | |
---|
50 | /** |
---|
51 | * |
---|
52 | * @param componentId |
---|
53 | * @param principal |
---|
54 | * @throws IOException |
---|
55 | * @throws UserUnauthorizedException thrown when principal does not match creator of component |
---|
56 | */ |
---|
57 | void deleteMDComponent(String componentId, Principal principal) throws IOException, UserUnauthorizedException; |
---|
58 | |
---|
59 | //getElements? |
---|
60 | //List<ConceptLinks> getConceptLinks(String componentId, String xpath); We only need xpath I think it contains the componentId's |
---|
61 | } |
---|