DCAE-D be initial commit
[sdc/dcae-d/dt-be-main.git] / dcaedt_validator / checker / src / main / java / org / onap / sdc / dcae / checker / Repository.java
1 package org.onap.sdc.dcae.checker;
2
3
4 import org.onap.sdc.common.onaplog.OnapLoggerDebug;
5 import org.onap.sdc.common.onaplog.OnapLoggerError;
6
7 import java.net.URI;
8 import java.net.URL;
9 import java.net.MalformedURLException;
10
11 import java.util.Map;
12
13 /**
14  * Represents a 'container' of (yaml) TOSCA documents
15  */
16 public abstract class Repository {
17
18         protected OnapLoggerError errLogger = OnapLoggerError.getInstance();
19         protected OnapLoggerDebug debugLogger = OnapLoggerDebug.getInstance();
20
21         private String                          name,
22                                                                                                 description;
23         protected URI                                           rootURI;
24         protected Map                                   credential;     //TOSCA type tosca.datatype.Credential
25
26         public Repository(String theName, URI theRoot) {
27                 this.name = theName;
28                 this.rootURI = theRoot;
29         }
30
31         public String getName() {
32                 return this.name;
33         }
34
35         public URI getRoot() {
36                 return this.rootURI;
37         }
38
39         /** optional */
40         public abstract Iterable<Target> targets();
41
42         /** */
43         public abstract Target resolve(URI theURI);
44
45         @Override
46         public String toString() {
47                 return "Repository " + this.name + " at " + this.rootURI;
48         }
49 }
50