Project

General

Profile

« Previous | Next » 

Revision 4247

use "local" services when none are provided in the properties file

View differences:

ConfigurableEcogridEndPoint.java
53 53
	private String srbEcogridEndPoint = null;
54 54
	private String srbMachineName = null;
55 55
	
56
	protected String baseURL = null;
57
	
56 58
	public ConfigurableEcogridEndPoint() {
57
		
59
		if (!loadProperties()) {
60
			try {
61
				//use values from server where deployed
62
				baseURL = 
63
					"http://"
64
					+ PropertyService.getProperty("server.name")
65
					+ ":"
66
					+ PropertyService.getProperty("server.httpPort")
67
					+ "/"
68
					+ PropertyService.getProperty("application.context")
69
					+ "/services/";
70
				metacatEcogridEndPoint = baseURL + "QueryService";
71
				metacatEcogridAuthEndPoint = baseURL + "AuthenticationService";
72
				metacatEcogridPutEndPoint = baseURL + "PutService";
73
				metacatEcogridIdentifierEndPoint = baseURL + "IdentificationService";
74
			} catch (PropertyNotFoundException e) {
75
				//we are SOL now
76
				e.printStackTrace();
77
			}
78
		}	
79
	}
80
	
81
	private boolean loadProperties() {
58 82
		try {
59 83
			metacatEcogridEndPoint 				= PropertyService.getProperty("datamanager.endpoint.query");
60 84
			metacatEcogridAuthEndPoint 			= PropertyService.getProperty("datamanager.endpoint.authentication");
......
63 87
			srbEcogridEndPoint 					= PropertyService.getProperty("datamanager.srb.endpoint");
64 88
			srbMachineName 						= PropertyService.getProperty("datamanager.srb.machinename");
65 89
		} catch (PropertyNotFoundException e) {
66
			e.printStackTrace();
90
			//e.printStackTrace();
91
			return false;
67 92
		}
68
		
93
		if (metacatEcogridEndPoint == null || metacatEcogridEndPoint.length() == 0) {
94
			return false;
95
		}
96
		return true;
69 97
	}
70
	
71 98
	 /**
72 99
	    * Gets the end point which Metacat implements ecogrid interface.
73 100
	    * This end point will be used to handle ecogrid protocol

Also available in: Unified diff