/** * Parse given URL. * * @param spaceURL space url string * @return spaceURL object which represents the passed space url string. **/ public static SpaceURL parseURL(String spaceURL) throws MalformedURLException { return parseURL(spaceURL, null); }
private static SpaceURL parseURL(String url, Properties customProperties) throws MalformedURLException { if (url == null) throw new SpaceURLValidationException("Invalid space url - SpaceURL value must be supplied to this method."); return SpaceURLParser.parseURL(url, customProperties); }
private SpaceURL createSpaceURL(String url) throws MalformedURLException { return SpaceURLParser.parseURL(url, createProperties(SpaceUrlUtils.isRemoteProtocol(url))); }
@Override public SpaceCopyStatus spaceCopy(IRemoteSpace remoteProxy, String remoteSpaceUrl, String remoteSpaceName, ITemplatePacket template, boolean includeNotifyTemplates, int chunkSize, SpaceContext sc, SpaceContext remoteSpaceContext) throws RemoteException { checkPacketAccessPrivileges(sc, SpacePrivilege.WRITE, template); try { SpaceURL url = SpaceURLParser.parseURL(remoteSpaceUrl); ISpaceCopyReplicaState spaceCopyReplica = _engine.spaceCopyReplica(url, remoteSpaceName, remoteProxy, template, includeNotifyTemplates, chunkSize, sc, remoteSpaceContext); return spaceCopyReplica.getCopyResult().toOldResult(SpaceCopyStatusImpl.COPY_TYPE, remoteSpaceName); } catch (MalformedURLException e) { throw new RemoteException(e.getMessage(), e); } }
groupMemberURL.add(SpaceURLParser.parseURL(
SpaceURL remoteSpaceUrl = SpaceURLParser.parseURL(remoteUrl);
mirrorConfig.serviceURL = SpaceURLParser.parseURL(elemValue, memberCustomProperties); } catch (MalformedURLException e) { throw new RuntimeException(new ClusterConfigurationException("Failed to parse mirror-service finder URL: " + mirrorConfig.serviceURL, e));
private RemoteSpaceProxyLocator createProxyLocator(SpaceProxyImpl spaceProxy) { SpaceURL spaceUrl = spaceProxy.getFinderURL(); if (spaceUrl == null) spaceUrl = spaceProxy.getURL(); if (spaceUrl.isJiniProtocol()) { spaceUrl = spaceUrl.clone(); spaceUrl.remove(SpaceURL.USE_LOCAL_CACHE); } else { String url = SpaceUrlUtils.buildJiniUrl(spaceUrl.getContainerName(), spaceUrl.getSpaceName(), spaceUrl.getProperty(SpaceURL.GROUPS), null /*locators*/); try { spaceUrl = SpaceURLParser.parseURL(url); } catch (MalformedURLException e) { throw new ProxyInternalSpaceException(e); } } return new RemoteSpaceProxyLocator(spaceProxy.getName(), spaceUrl, quiesceTokenProvider); }
public SpaceCopyStatus spaceCopy(IJSpace remoteProxy, Object template, boolean includeNotifyTemplates, int chunkSize) throws RemoteException { // verify that user can write on the local. IDirectSpaceProxy directProxy = (IDirectSpaceProxy) _spaceProxy; SpaceContext localSpaceContext = ((IDirectSpaceProxy) _spaceProxy).getSecurityManager().acquireContext(((IDirectSpaceProxy) _spaceProxy).getRemoteJSpace()); SpaceContext remoteSpaceContext = ((IDirectSpaceProxy) remoteProxy).getSecurityManager().acquireContext(((IDirectSpaceProxy) remoteProxy).getRemoteJSpace()); final IRemoteSpace remoteSpace = ((ISpaceProxy) remoteProxy).getDirectProxy().getRemoteJSpace(); final ObjectType objectType = ObjectType.fromObject(template); final ITemplatePacket templPacket = directProxy.getTypeManager().getTemplatePacketFromObject(template, objectType); String remoteUrl = "jini://*/" + remoteProxy.getContainerName() + "/" + remoteProxy.getName(); SpaceURL parseURL; try { parseURL = SpaceURLParser.parseURL(remoteUrl); } catch (MalformedURLException e) { throw new RemoteException("", e); } String groups = ((ISpaceProxy) remoteProxy).getDirectProxy().getProxySettings().getFinderURL().getProperty(SpaceURL.GROUPS); if (groups != null) parseURL.setProperty(SpaceURL.GROUPS, groups); String locators = ((ISpaceProxy) remoteProxy).getDirectProxy().getProxySettings().getFinderURL().getProperty(SpaceURL.LOCATORS); if (locators != null) parseURL.setProperty(SpaceURL.LOCATORS, locators); String remoteName = ((ISpaceProxy) remoteProxy).getDirectProxy().getRemoteMemberName(); return ((IInternalRemoteJSpaceAdmin) adminImpl).spaceCopy(remoteSpace, parseURL.getURL(), remoteName, templPacket, includeNotifyTemplates, chunkSize, localSpaceContext, remoteSpaceContext); }