Create a DeploymentFetcher to execute fetch.

@param pathServiceSid The service_sid
@param pathEnvironmentSid The environment_sid
@param pathSid The sid
@return DeploymentFetcher capable of executing the fetch
964289
public static DeploymentFetcher fetcher(final String pathServiceSid, 
                                            final String pathEnvironmentSid, 
                                            final String pathSid) {
        return new DeploymentFetcher(pathServiceSid, pathEnvironmentSid, pathSid);
    }
241237
public CdnResult.PrefetchResult prefetchUrls(String[] urls) throws QiniuException {
        if (urls != null && urls.length > MAX_API_PREFETCH_URL_COUNT) {
            throw new QiniuException(new Exception("url count exceeds the max prefetch limit per request"));
        }
        HashMap<String, String[]> req = new HashMap<>();
        req.put("urls", urls);
        byte[] body = Json.encode(req).getBytes(Constants.UTF_8);
        String url = server + "/v2/tune/prefetch";
        StringMap headers = auth.authorizationV2(url, "POST", body, Client.JsonMime);
        Response response = client.post(url, body, headers, Client.JsonMime);
        return response.jsonToObject(CdnResult.PrefetchResult.class);
    }
1153897
public B serviceUnder(String pathPrefix, Service<HttpRequest, HttpResponse> service) {
        service(PathMapping.ofPrefix(pathPrefix), service);
        return self();
    }
410291
public static SyncMapItemUpdater updater(final String pathServiceSid, 
                                             final String pathMapSid, 
                                             final String pathKey) {
        return new SyncMapItemUpdater(pathServiceSid, pathMapSid, pathKey);
    }
509186
private void findDeploymentAddress(final String deploymentID, Handler<AsyncResult<String>> resultHandler) {
    context.execute(new Action<String>() {
      @Override
      public String perform() {
        synchronized (deployments) {
          JsonObject locatedInfo = null;
          Collection<String> sdeploymentsInfo = deployments.get(cluster);
          for (String sdeploymentInfo : sdeploymentsInfo) {
            JsonObject deploymentInfo = new JsonObject(sdeploymentInfo);
            if (deploymentInfo.getString("id").equals(deploymentID)) {
              locatedInfo = deploymentInfo;
              break;
            }
          }
          if (locatedInfo != null) {
            return locatedInfo.getString("address");
          }
          return null;
        }
      }
    }, resultHandler);
  }
122397
public ServerBuilder annotatedService(String pathPrefix, Object service) {
        return annotatedService(pathPrefix, service, Function.identity(), ImmutableList.of());
    }
1167420
public List<EndpointOverride> getPaths(int profileId, String clientUUID, String[] filters) throws Exception {
        ArrayList<EndpointOverride> properties = new ArrayList<EndpointOverride>();
        PreparedStatement statement = null;
        ResultSet results = null;

        try (Connection sqlConnection = sqlService.getConnection()) {
            String queryString = this.getPathSelectString();
            queryString += " AND " + Constants.DB_TABLE_PATH + "." + Constants.GENERIC_PROFILE_ID + "=? " +
                " ORDER BY " + Constants.PATH_PROFILE_PATH_ORDER + " ASC";

            statement = sqlConnection.prepareStatement(queryString);
            statement.setString(1, clientUUID);
            statement.setInt(2, profileId);

            results = statement.executeQuery();
            while (results.next()) {
                EndpointOverride endpoint = this.getEndpointOverrideFromResultSet(results);
                endpoint.setFilters(filters);
                properties.add(endpoint);
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (results != null) {
                    results.close();
                }
            } catch (Exception e) {
            }
            try {
                if (statement != null) {
                    statement.close();
                }
            } catch (Exception e) {
            }
        }

        return properties;
    }
733937
public static StepContextFetcher fetcher(final String pathFlowSid, 
                                             final String pathEngagementSid, 
                                             final String pathStepSid) {
        return new StepContextFetcher(pathFlowSid, pathEngagementSid, pathStepSid);
    }
456607
public Collection<ProcessDefinition> getProcessesByDeploymentId(String deploymentId, QueryContext queryContext) {
	    deploymentId = getLatestDeploymentId(requireNonNull(deploymentId, DEPLOYMENT_ID_MUST_NOT_BE_NULL));

        List<ProcessDefinition> outputCollection = new ArrayList<ProcessDefinition>();
        CollectionUtils.select(availableProcesses, new ByDeploymentIdPredicate(deploymentId, identityProvider.getRoles()), outputCollection);

        applySorting(outputCollection, queryContext);
        return applyPaginition(outputCollection, queryContext);
    }
1251394
@Override
    public void enlistAsyncResource(String xaResFactoryFilter, Serializable xaResInfo, Xid xid) throws SystemException // @LIDB1922-5C
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "enlistAsyncResource (SPI): args: ", new Object[] { xaResFactoryFilter, xaResInfo, xid });
        try {
            final WSATAsyncResource res = new WSATAsyncResource(xaResFactoryFilter, xaResInfo, xid);
            final WSATParticipantWrapper wrapper = new WSATParticipantWrapper(res);
            getResources().addAsyncResource(wrapper);
        } finally {
            if (tc.isEntryEnabled())
                Tr.exit(tc, "enlistAsyncResource (SPI)");
        }
    }
908556
public int getPathId(String pathName, int profileId) {
        PreparedStatement queryStatement = null;
        ResultSet results = null;
        // first get the pathId for the pathName/profileId
        int pathId = -1;
        try (Connection sqlConnection = sqlService.getConnection()) {
            queryStatement = sqlConnection.prepareStatement(
                "SELECT " + Constants.GENERIC_ID + " FROM " + Constants.DB_TABLE_PATH
                    + " WHERE " + Constants.PATH_PROFILE_PATHNAME + "= ? "
                    + " AND " + Constants.GENERIC_PROFILE_ID + "= ?"
            );
            queryStatement.setString(1, pathName);
            queryStatement.setInt(2, profileId);
            results = queryStatement.executeQuery();
            if (results.next()) {
                pathId = results.getInt(Constants.GENERIC_ID);
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (results != null) {
                    results.close();
                }
            } catch (Exception e) {
            }
            try {
                if (queryStatement != null) {
                    queryStatement.close();
                }
            } catch (Exception e) {
            }
        }

        return pathId;
    }
945750
public static FactorFetcher fetcher(final String pathServiceSid, 
                                        final String pathIdentity, 
                                        final String pathSid) {
        return new FactorFetcher(pathServiceSid, pathIdentity, pathSid);
    }
844515
public static SyncListItemDeleter deleter(final String pathServiceSid, 
                                              final String pathListSid, 
                                              final Integer pathIndex) {
        return new SyncListItemDeleter(pathServiceSid, pathListSid, pathIndex);
    }
1086314
public static MessageFetcher fetcher(final String pathServiceSid, 
                                         final String pathChannelSid, 
                                         final String pathSid) {
        return new MessageFetcher(pathServiceSid, pathChannelSid, pathSid);
    }
99962
public static String getInServiceURL(HttpServletRequest request, String path) {
        String contextPath = ((Request) request).getContext().getContextPath();
        int port = request.getServerPort();

        return getInServiceURL(port, contextPath, path);
    }
473092
public SecurityTokenServiceClient buildClientForSecurityTokenRequests(final WSFederationRegisteredService service) {
        val cxfBus = BusFactory.getDefaultBus();
        val sts = new SecurityTokenServiceClient(cxfBus);
        sts.setAddressingNamespace(StringUtils.defaultIfBlank(service.getAddressingNamespace(), WSFederationConstants.HTTP_WWW_W3_ORG_2005_08_ADDRESSING));
        sts.setTokenType(StringUtils.defaultIfBlank(service.getTokenType(), WSConstants.WSS_SAML2_TOKEN_TYPE));
        sts.setKeyType(WSFederationConstants.HTTP_DOCS_OASIS_OPEN_ORG_WS_SX_WS_TRUST_200512_BEARER);
        sts.setWsdlLocation(prepareWsdlLocation(service));
        if (StringUtils.isNotBlank(service.getPolicyNamespace())) {
            sts.setWspNamespace(service.getPolicyNamespace());
        }
        val namespace = StringUtils.defaultIfBlank(service.getNamespace(), WSFederationConstants.HTTP_DOCS_OASIS_OPEN_ORG_WS_SX_WS_TRUST_200512);
        sts.setServiceQName(new QName(namespace, StringUtils.defaultIfBlank(service.getWsdlService(), WSFederationConstants.SECURITY_TOKEN_SERVICE)));
        sts.setEndpointQName(new QName(namespace, service.getWsdlEndpoint()));
        sts.getProperties().putAll(new HashMap<>());
        return sts;
    }
719767
@Override
	public ClusterClient<ApplicationId> retrieve(ApplicationId applicationId) throws ClusterRetrieveException {

		try {
			// check if required Hadoop environment variables are set. If not, warn user
			if (System.getenv("HADOOP_CONF_DIR") == null &&
				System.getenv("YARN_CONF_DIR") == null) {
				LOG.warn("Neither the HADOOP_CONF_DIR nor the YARN_CONF_DIR environment variable is set." +
					"The Flink YARN Client needs one of these to be set to properly load the Hadoop " +
					"configuration for accessing YARN.");
			}

			final ApplicationReport appReport = yarnClient.getApplicationReport(applicationId);

			if (appReport.getFinalApplicationStatus() != FinalApplicationStatus.UNDEFINED) {
				// Flink cluster is not running anymore
				LOG.error("The application {} doesn't run anymore. It has previously completed with final status: {}",
					applicationId, appReport.getFinalApplicationStatus());
				throw new RuntimeException("The Yarn application " + applicationId + " doesn't run anymore.");
			}

			final String host = appReport.getHost();
			final int rpcPort = appReport.getRpcPort();

			LOG.info("Found application JobManager host name '{}' and port '{}' from supplied application id '{}'",
				host, rpcPort, applicationId);

			flinkConfiguration.setString(JobManagerOptions.ADDRESS, host);
			flinkConfiguration.setInteger(JobManagerOptions.PORT, rpcPort);

			flinkConfiguration.setString(RestOptions.ADDRESS, host);
			flinkConfiguration.setInteger(RestOptions.PORT, rpcPort);

			return createYarnClusterClient(
				this,
				-1, // we don't know the number of task managers of a started Flink cluster
				-1, // we don't know how many slots each task manager has for a started Flink cluster
				appReport,
				flinkConfiguration,
				false);
		} catch (Exception e) {
			throw new ClusterRetrieveException("Couldn't retrieve Yarn cluster", e);
		}
	}