01: package com.sun.portal.search.community;
02:
03: import com.sun.portal.search.util.SearchLogger;
04: import com.sun.portal.search.rdm.RDMException;
05:
06: import java.util.logging.Level;
07: import com.sun.portal.admin.common.util.AdminUtil;
08: import com.sun.portal.admin.common.util.AdminClientUtil;
09: import com.sun.portal.admin.common.context.PortalDomainContext;
10:
11: import java.util.*;
12:
13: public class CommunityWebServiceURLHolder {
14:
15: static private CommunityWebServiceURLHolder instance = new CommunityWebServiceURLHolder();
16:
17: static public CommunityWebServiceURLHolder getInstance() {
18: return instance;
19: }
20:
21: public String getCommunityWebServiceURL(String portalId)
22: throws RDMException {
23:
24: String url = null;
25: try {
26:
27: PortalDomainContext portalDomainContext = AdminUtil
28: .getPortalDomainContext();
29:
30: LinkedList path = new LinkedList();
31: path.addFirst(AdminClientUtil.DEFAULT_DOMAIN);
32: path.addFirst(portalId);
33: path.addFirst("CommunityManager");
34:
35: url = portalDomainContext.getAttributeValue(
36: AdminClientUtil.COMMUNITYMANAGER_MBEAN_TYPE, path,
37: "CommunityManagerWSURL");
38:
39: } catch (Exception ex) {
40: throw new RDMException(
41: "Exception calculating the community URL:", ex);
42: }
43: return url;
44: }
45: }
|