congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ServiceId.getVersion
Code IndexAdd Tabnine to your IDE (free)

How to use
getVersion
method
in
co.cask.cdap.proto.id.ServiceId

Best Java code snippets using co.cask.cdap.proto.id.ServiceId.getVersion (Showing top 2 results out of 315)

origin: caskdata/cdap

/**
 * Gets a {@link URL} to call methods for a specific version of a {@link Service}.
 *
 * @param service {@link ServiceId} of the service
 * @return a URL to call methods of the service
 * @throws NotFoundException @throws NotFoundException if the app or service could not be found
 * @throws IOException if a network error occurred
 * @throws UnauthenticatedException if the request is not authorized successfully in the gateway server
 */
public URL getVersionedServiceURL(ServiceId service)
 throws NotFoundException, IOException, UnauthenticatedException, UnauthorizedException {
  // Make sure the service actually exists
  get(service);
  return config.resolveNamespacedURLV3(service.getNamespaceId(),
                     String.format("apps/%s/versions/%s/services/%s/methods/",
                            service.getApplication(), service.getVersion(),
                            service.getEntityName()));
}
origin: caskdata/cdap

/**
 * Checks whether the {@link Service} is active.
 *
 * @param service ID of the service
 * @throws IOException if a network error occurred
 * @throws UnauthenticatedException if the request is not authorized successfully in the gateway server
 * @throws NotFoundException if the app or service could not be found
 * @throws ServiceUnavailableException if the service is not available
 */
public void checkAvailability(ServiceId service) throws IOException, UnauthenticatedException, NotFoundException,
 ServiceUnavailableException, UnauthorizedException {
 URL url = config.resolveNamespacedURLV3(service.getNamespaceId(),
                     String.format("apps/%s/versions/%s/services/%s/available",
                            service.getApplication(), service.getVersion(),
                            service.getProgram()));
 HttpResponse response = restClient.execute(HttpMethod.GET, url, config.getAccessToken(),
                       HttpURLConnection.HTTP_NOT_FOUND, HttpURLConnection.HTTP_BAD_REQUEST,
                       HttpURLConnection.HTTP_UNAVAILABLE);
 if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
  throw new NotFoundException(service);
 }
 if (response.getResponseCode() == HttpURLConnection.HTTP_UNAVAILABLE) {
  throw new ServiceUnavailableException(service.getProgram());
 }
}
co.cask.cdap.proto.idServiceIdgetVersion

Popular methods of ServiceId

  • <init>
  • getApplication
  • getProgram
  • getEntityName
  • getNamespace
  • getNamespaceId
  • getParent
  • run
  • toMetadataEntity

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSharedPreferences (Context)
  • getSupportFragmentManager (FragmentActivity)
  • setContentView (Activity)
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • JButton (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now