/** * Obtain a flyweight {@link RemoteRepository} for the default namespace * associated with the remote service. */ public RemoteRepository getRepositoryForDefaultNamespace() { return getRepositoryForURL(baseServiceURL + "/sparql"); }
/** * Obtain a flyweight {@link RemoteRepository} for the data set having the * specified SPARQL end point. The load balancer will be used or not as per * the parameters to the {@link RemoteRepositoryManager} constructor. * * @param sparqlEndpointURL * The URL of the SPARQL end point. * * @return An interface which may be used to talk to that data set. */ public RemoteRepository getRepositoryForURL(final String sparqlEndpointURL) { return getRepositoryForURL(sparqlEndpointURL, null/* timestamp */); }
/** * Obtain a flyweight {@link RemoteRepository} for a data set managed by the * remote service. * * @param namespace * The name of the data set (its bigdata namespace). * * @return An interface which may be used to talk to that data set. */ public RemoteRepository getRepositoryForNamespace(final String namespace) { return getRepositoryForURL(getRepositoryBaseURLForNamespace(namespace) + "/sparql"); }
/** * Constructor that simply specifies an endpoint. This class will internally * allocate a {@link RemoteRepositoryManager} that is scoped to the life * cycle of this class. The allocated {@link RemoteRepositoryManager} will be * closed when this {@link BigdataSailRemoteRepository} is closed. * <p> * Note: This constructor pattern is NOT flyweight. * * @param sparqlEndpointURL * The SPARQL end point URL */ @Deprecated // This is broken because the sparqlEndpointURL is not the serviceURL and that is what the RRM expects/needs. public BigdataSailRemoteRepository(final String sparqlEndpointURL) { if (sparqlEndpointURL == null) throw new IllegalArgumentException(); /* * Allocate a RemoteRepositoryManager. This is NOT a flyweight operation. * */ this.our_mgr = new RemoteRepositoryManager(sparqlEndpointURL, false/*useLBS*/); this.remoteRepository = our_mgr.getRepositoryForURL(sparqlEndpointURL); }
/** * Connect to a remote bigdata instance. * * @param sparqlEndpointURL * The URL of the SPARQL end point. * * FIXME This does not support the HA load balancer pattern. See #1148. * * FIXME This does not parameterize the value of the ContextPath. See * {@link com.bigdata.BigdataStatics#getContextPath()}. * * FIXME This MIGHT leak HttpClient or Executor resources. */ public static BigdataSailRemoteRepository connect( final String sparqlEndpointURL) { return new RemoteRepositoryManager().getRepositoryForURL( sparqlEndpointURL).getBigdataSailRemoteRepository(); }
/** * Return a {@link RemoteRepository} for this connection. * * @see RemoteRepositoryManager#new */ protected RemoteRepository getRepositoryForConnection() { final IRemoteTx tx = remoteTx.get(); if (tx != null) { /* * Return a RemoteRepository that will use a view that is consistent * with an isolated view of the transaction. */ final RemoteRepository rtmp = repo.getRemoteRepository(); final String sparqlEndpointURL = rtmp.getSparqlEndPoint(); final RemoteRepositoryManager rmgr = rtmp.getRemoteRepositoryManager(); return rmgr.getRepositoryForURL(sparqlEndpointURL, tx); } /* * The returned repository does not add the ×tamp= URL query * parameter. */ return repo.getRemoteRepository(); }
final BigdataSailRemoteRepository repo = mgr.getRepositoryForURL( sparqlEndpointURL).getBigdataSailRemoteRepository();
final BigdataSailRemoteRepository repo = mgr.getRepositoryForURL( sparqlEndpointURL).getBigdataSailRemoteRepository();