summaryrefslogtreecommitdiffstats
path: root/dcaedt_validator/checker/src/main/java/org/onap/sdc/dcae/checker/Repository.java
blob: 9cb853be36e5177be903f192d5bb1a29ca64d4ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package org.onap.sdc.dcae.checker;


import org.onap.sdc.common.onaplog.OnapLoggerDebug;
import org.onap.sdc.common.onaplog.OnapLoggerError;

import java.net.URI;
import java.net.URL;
import java.net.MalformedURLException;

import java.util.Map;

/**
 * Represents a 'container' of (yaml) TOSCA documents
 */
public abstract class Repository {

	protected OnapLoggerError errLogger = OnapLoggerError.getInstance();
	protected OnapLoggerDebug debugLogger = OnapLoggerDebug.getInstance();

	private String 				name,
												description;
	protected URI					 	rootURI;
	protected Map 					credential;	//TOSCA type tosca.datatype.Credential

	public Repository(String theName, URI theRoot) {
		this.name = theName;
		this.rootURI = theRoot;
	}

	public String getName() {
		return this.name;
	}

	public URI getRoot() {
		return this.rootURI;
	}

	/** optional */
	public abstract Iterable<Target> targets();

	/** */
	public abstract Target resolve(URI theURI);

	@Override
	public String toString() {
		return "Repository " + this.name + " at " + this.rootURI;
	}
}