App Engine SDK 1.8.4 release.
[gae.git] / java / src / main / com / google / appengine / api / labs / modules / ModulesService.java
blobb7e147ee7db39f374aadfd9b621268468cac448f
1 package com.google.appengine.api.labs.modules;
3 import java.util.Set;
5 /**
6 * ModulesService allows the application to fetch information about its
7 * own module and version information. Additionally, the service has the
8 * ability to start, stop and change the number of instances associated with a
9 * module version.
12 public interface ModulesService {
14 /**
15 * Get the name of the current module.
17 * @return the name of the module
19 String getCurrentModule();
21 /**
22 * Get the name of the current version.
24 * @return the name of the version
26 String getCurrentVersion();
28 /**
29 * Get the id of the current instance.
31 * @return current instance id
32 * @throws ModulesException when no instance id exists for the current instance
34 String getCurrentInstanceId();
36 /**
37 * Get the set of modules that are available to the application.
39 * @return Set of modules available to the application
40 * @throws ModulesException when an error occurs
42 Set<String> getModules();
44 /**
45 * Returns the set of versions that are available to the given module.
47 * @param module the name of the module
48 * @throws ModulesException when input is invalid
50 Set<String> getVersions(String module);
52 /**
53 * Returns the name of the default version for the module.
55 * @param module the name of the module
56 * @throws ModulesException when an error occurs
58 String getDefaultVersion(String module);
60 /**
61 * Returns the number of instances that are available to the given module and version.
63 * @param module the name of the module
64 * @param version the name of the version
65 * @throws ModulesException when input is invalid
67 long getNumInstances(String module, String version);
69 /**
70 * Set the number of instances that are available to the given module and version.
72 * @param module the name of the module
73 * @param version the name of the version
74 * @param instances the number of instances to set
75 * @throws ModulesException when input is invalid
77 void setNumInstances(String module, String version, long instances);
79 /**
80 * Start a given module and version.
82 * @param module the name of the module
83 * @param version the name of the version
84 * @throws ModulesException when input or existing state is invalid
86 void startModule(String module, String version);
88 /**
89 * Stop a given module and version.
91 * @param module the name of the module
92 * @param version the name of the version
93 * @throws ModulesException when input or existing state is invalid
95 void stopModule(String module, String version);
97 /**
98 * Returns a hostname to use for the given module and version.
100 * @param module the name of the module or null to indicate the current module
101 * @param version the name of the version or null to indicate the current version
102 * @throws ModulesException when input is invalid
104 String getModuleHostname(String module, String version);
107 * Returns a hostname to use for the given module and version.
109 * @param module the name of the module or null to indicate the current module
110 * @param version the name of the version or null to indicate the current version
111 * @param instance the id of a particular instance to address
112 * @return the hostname of the given instance
113 * @throws ModulesException when input is invalid
115 String getModuleHostname(String module, String version, int instance);