Project

General

Profile

« Previous | Next » 

Revision 42659

added light-ui

View differences:

ObjectStoreProfileCreator.java
17 17
 */
18 18
public class ObjectStoreProfileCreator {
19 19

  
20
	private static final String ENDPOINT_TEMPLATE = "http://%s:%s/%s/services/objectStore";
20 21
	/**
21 22
	 * service locator.
22 23
	 */
23 24
	@Autowired
24 25
	private UniqueServiceLocator serviceLocator;
25

  
26 26
	/**
27 27
	 * objectstore ds template.
28 28
	 */
29 29
	private StringTemplate objectstoreDsTemplate;
30

  
30
	private String hostname;
31
	private String port;
32
	private String context;
31 33
	/**
32 34
	 * service endpoint.
33 35
	 */
......
48 50
	public String registerProfile(final String interpretation)
49 51
			throws ISRegistryException {
50 52
		// XXX: mini hack
51
		StringTemplate template = new StringTemplate(
52
				objectstoreDsTemplate.getTemplate());
53
		template.setAttribute("serviceUri", eprBuilder.getAddress(endpoint));
53
		StringTemplate template = new StringTemplate(objectstoreDsTemplate.getTemplate());
54

  
55
		//template.setAttribute("serviceUri", eprBuilder.getAddress(endpoint));
56
		template.setAttribute("serviceUri", String.format(ENDPOINT_TEMPLATE, hostname, port, context));
54 57
		template.setAttribute("interpretation", interpretation);
55 58

  
56 59
		return serviceLocator.getService(ISRegistryService.class, true).registerProfile(template.toString());
......
70 73
	 *
71 74
	 * @param endpoint the new endpoint
72 75
	 */
73
	@Required
76

  
74 77
	public void setEndpoint(final Endpoint endpoint) {
75 78
		this.endpoint = endpoint;
76 79
	}
......
121 124
		this.serviceLocator = serviceLocator;
122 125
	}
123 126

  
127
	public String getHostname() {
128
		return hostname;
129
	}
130

  
131
	@Required
132
	public void setHostname(final String hostname) {
133
		this.hostname = hostname;
134
	}
135

  
136
	public String getPort() {
137
		return port;
138
	}
139

  
140
	@Required
141
	public void setPort(final String port) {
142
		this.port = port;
143
	}
144

  
145
	public String getContext() {
146
		return context;
147
	}
148

  
149
	@Required
150
	public void setContext(final String context) {
151
		this.context = context;
152
	}
153

  
124 154
}

Also available in: Unified diff