| 
OpenShift Java Client 2.5.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.openshift.internal.client.AbstractOpenShiftResource
com.openshift.internal.client.ApplicationResource
public class ApplicationResource
The ApplicationResource object is an implementation of com.openshift.client.IApplication, and provides a runtime model for the real application that resides on the OpenShift platform being accessed.
| Nested Class Summary | |
|---|---|
protected static class | 
ApplicationResource.SshStreams
 | 
| Nested classes/interfaces inherited from class com.openshift.internal.client.AbstractOpenShiftResource | 
|---|
AbstractOpenShiftResource.Parameters, AbstractOpenShiftResource.ServiceRequest | 
| Constructor Summary | |
|---|---|
protected  | 
ApplicationResource(ApplicationResourceDTO dto,
                    DomainResource domain)
 | 
protected  | 
ApplicationResource(String name,
                    String uuid,
                    String creationTime,
                    Messages messages,
                    String applicationUrl,
                    String sshUrl,
                    String gitUrl,
                    String initialGitUrl,
                    IGearProfile gearProfile,
                    ApplicationScale scale,
                    List<String> aliases,
                    Map<String,CartridgeResourceDTO> cartridgesByName,
                    Map<String,Link> links,
                    DomainResource domain)
Instantiates a new application.  | 
| Method Summary | |
|---|---|
 void | 
addAlias(String alias)
Add application alias  | 
 IEmbeddedCartridge | 
addEmbeddableCartridge(IEmbeddableCartridge cartridge)
Adds the given embedded cartridge to this application.  | 
 List<IEmbeddedCartridge> | 
addEmbeddableCartridges(Collection<IEmbeddableCartridge> cartridges)
Adds all given embedded cartridges from this app, given their names.  | 
 IEnvironmentVariable | 
addEnvironmentVariable(String name,
                       String value)
Adds an environment variable to this application.  | 
 Map<String,IEnvironmentVariable> | 
addEnvironmentVariables(Map<String,String> environmentVariables)
Adds a map of environment variables to the application  | 
 boolean | 
canGetEnvironmentVariables()
Used to determine if environment variables exist and are available to be retrieved  | 
protected  boolean | 
canResolv(String url)
 | 
 boolean | 
canUpdateEnvironmentVariables()
Used to determine if the current instance is able to update environment variables.  | 
 void | 
destroy()
Destroys this application (and removes it from the list of available applications)  | 
 boolean | 
equals(Object object)
 | 
 List<String> | 
getAliases()
Retrieve all application aliases  | 
 ApplicationScale | 
getApplicationScale()
Returns true if scaling is enabled on this application (only set at creation time).  | 
 String | 
getApplicationUrl()
Returns the url at which this application may be reached at.  | 
 IStandaloneCartridge | 
getCartridge()
Returns the cartridge (application type) that this app is running on.  | 
protected  ICartridge | 
getCartridge(String cartridgeName)
Returns the main (standalone) cartrige or one of the embedded cartridges whose name matches the given param.  | 
protected  IOpenShiftConnection | 
getConnection()
 | 
 Date | 
getCreationTime()
Returns the timestamp at which this app was created.  | 
 void | 
getDescriptor()
 | 
 IDomain | 
getDomain()
Get the domain of the application.  | 
 IEmbeddedCartridge | 
getEmbeddedCartridge(IEmbeddableCartridge cartridge)
Returns the embedded cartridge in this application.  | 
 IEmbeddedCartridge | 
getEmbeddedCartridge(String cartridgeName)
Returns the embedded cartridge given its name.  | 
 List<IEmbeddedCartridge> | 
getEmbeddedCartridges()
Returns all embedded cartridges.  | 
 List<String> | 
getEnvironmentProperties()
Retrieves the list of environment properties.  | 
 IEnvironmentVariable | 
getEnvironmentVariable(String name)
Return the environment variable for the specified name  | 
 Map<String,IEnvironmentVariable> | 
getEnvironmentVariables()
Retrieves the map of environment variables  | 
 List<IApplicationPortForwarding> | 
getForwardablePorts()
Returns the list of forwardable ports on OpenShift for this application.  | 
 Collection<IGearGroup> | 
getGearGroups()
Returns the gear groups for this application.  | 
 IGearProfile | 
getGearProfile()
Returns true if scaling is enabled on this application (only set at creation time).  | 
 String | 
getGitUrl()
Returns the uri at which the git repository of this application may be reached at.  | 
 String | 
getInitialGitUrl()
Returns the git url that the application will get its initial code and configuration from.  | 
 String | 
getName()
Returns the name of this application.  | 
protected  Map<String,IEnvironmentVariable> | 
getOrLoadEnvironmentVariables()
 | 
 com.jcraft.jsch.Session | 
getSSHSession()
Returns the SSH session that this application uses to connect to OpenShift.  | 
 String | 
getSshUrl()
Returns the url to use to connect with ssh.  | 
 String | 
getUUID()
Returns the uuid of this application.  | 
 boolean | 
hasAlias(String name)
 | 
 boolean | 
hasEmbeddedCartridge(IEmbeddableCartridge cartridge)
Returns true if this application has an embedded cartridge. | 
 boolean | 
hasEmbeddedCartridge(String cartridgeName)
Returns true if this application has an embedded cartridge. | 
 boolean | 
hasEnvironmentVariable(String name)
Checks if the environment variable is present in the application.  | 
 int | 
hashCode()
 | 
 boolean | 
hasSSHSession()
Returns true if the application was already provided with an SSH session, and this session is still valid (connected).  | 
 boolean | 
isPortFowardingStarted()
Returns true if the port-forwarding has been started, false otherwise.  | 
 void | 
refresh()
Refresh the application but reloading its content from OpenShift.  | 
protected  void | 
refreshEmbeddedCartridges()
Queries the backend to list the embedded cartridges and adds the new ones & update the ones that are already present  | 
 List<IApplicationPortForwarding> | 
refreshForwardablePorts()
Refreshes the list of port-forwarding.  | 
 void | 
removeAlias(String alias)
Remove application alias  | 
 void | 
removeEmbeddedCartridge(IEmbeddableCartridge cartridge)
Removes the given embedded cartridge that is equal to the given embeddable cartridge.  | 
protected  void | 
removeEmbeddedCartridge(IEmbeddedCartridge embeddedCartridge)
"callback" from the embeddedCartridge once it has been destroyed.  | 
 void | 
removeEmbeddedCartridges(Collection<IEmbeddableCartridge> cartridges)
Removes the given embedded cartridges in this application that are equal to the given IEmbeddableCartridge.  | 
 void | 
removeEnvironmentVariable(IEnvironmentVariable environmentVariable)
Removes the environment variables with the given name from this application.  | 
 void | 
removeEnvironmentVariable(String targetName)
Removes the environment variables with the given name from this application.  | 
 void | 
restart()
Restarts this application.  | 
 void | 
scaleDown()
Scale down application  | 
 void | 
scaleUp()
Scale up application  | 
 void | 
setSSHSession(com.jcraft.jsch.Session session)
Sets the SSH session that this application will use to connect to OpenShift to perform some operations.  | 
protected  List<String> | 
sshExecCmd(String command,
           ApplicationResource.SshStreams sshStream)
 | 
 void | 
start()
Starts this application.  | 
 List<IApplicationPortForwarding> | 
startPortForwarding()
 | 
 void | 
stop()
Stops this application.  | 
 void | 
stop(boolean force)
Stops this application  | 
 List<IApplicationPortForwarding> | 
stopPortForwarding()
Stop the port-forwarding for all ports.  | 
 String | 
toString()
 | 
protected  void | 
update(ApplicationResourceDTO dto)
 | 
protected  void | 
updateEnvironmentVariables()
 | 
 boolean | 
waitForAccessible(long timeout)
Waits for this application to become accessible on its public url.  | 
 Future<Boolean> | 
waitForAccessibleAsync(long timeout)
Returns a Future that the caller can use to wait for the application to become accessible on its public url.  | 
| Methods inherited from class com.openshift.internal.client.AbstractOpenShiftResource | 
|---|
getCreationLog, getLink, getMessages, hasCreationLog, setLinks | 
| Methods inherited from class java.lang.Object | 
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait | 
| Methods inherited from interface com.openshift.client.IOpenShiftResource | 
|---|
getCreationLog, getMessages, hasCreationLog | 
| Constructor Detail | 
|---|
protected ApplicationResource(ApplicationResourceDTO dto,
                              DomainResource domain)
protected ApplicationResource(String name,
                              String uuid,
                              String creationTime,
                              Messages messages,
                              String applicationUrl,
                              String sshUrl,
                              String gitUrl,
                              String initialGitUrl,
                              IGearProfile gearProfile,
                              ApplicationScale scale,
                              List<String> aliases,
                              Map<String,CartridgeResourceDTO> cartridgesByName,
                              Map<String,Link> links,
                              DomainResource domain)
name - the nameuuid - the uuidcreationTime - the creation timemessages - the creation logapplicationUrl - the application urlgitUrl - the git urlsshUrl - the ssh urlcartridge - the cartridge (type/framework)aliases - the aliaseslinks - the linksdomain - the domain this application belongs to
DatatypeConfigurationException| Method Detail | 
|---|
public String getName()
IApplication
getName in interface IApplicationpublic ApplicationScale getApplicationScale()
IApplication
getApplicationScale in interface IApplicationpublic IGearProfile getGearProfile()
IApplication
getGearProfile in interface IApplicationpublic String getUUID()
IApplication
getUUID in interface IApplicationpublic IStandaloneCartridge getCartridge()
IApplication
getCartridge in interface IApplicationprotected ICartridge getCartridge(String cartridgeName)
cartridgeName - the name of the cartridge to look for.
public Date getCreationTime()
IApplication
getCreationTime in interface IApplicationpublic IDomain getDomain()
IApplication
getDomain in interface IApplication
public void destroy()
             throws OpenShiftException
IApplication
destroy in interface IApplicationOpenShiftExceptionIUser#getApplications()
public void start()
           throws OpenShiftException
IApplication
start in interface IApplicationOpenShiftException
public void restart()
             throws OpenShiftException
IApplication
restart in interface IApplicationOpenShiftException
public void stop()
          throws OpenShiftException
IApplication
stop in interface IApplicationOpenShiftException
public void stop(boolean force)
          throws OpenShiftException
IApplication
stop in interface IApplicationforce - : true to force stop, false otherwise
OpenShiftExceptionpublic void getDescriptor()
public void scaleDown()
               throws OpenShiftException
IApplication
scaleDown in interface IApplicationOpenShiftException
public void scaleUp()
             throws OpenShiftException
IApplication
scaleUp in interface IApplicationOpenShiftException
public void addAlias(String alias)
              throws OpenShiftException
IApplication
addAlias in interface IApplicationOpenShiftExceptionpublic List<String> getAliases()
IApplication
getAliases in interface IApplicationpublic boolean hasAlias(String name)
hasAlias in interface IApplication
public void removeAlias(String alias)
                 throws OpenShiftException
IApplication
removeAlias in interface IApplicationOpenShiftExceptionpublic String getGitUrl()
IApplication
getGitUrl in interface IApplicationpublic String getInitialGitUrl()
IApplication
getInitialGitUrl in interface IApplicationpublic String getSshUrl()
IApplication
getSshUrl in interface IApplicationpublic String getApplicationUrl()
IApplication
getApplicationUrl in interface IApplication
public IEmbeddedCartridge addEmbeddableCartridge(IEmbeddableCartridge cartridge)
                                          throws OpenShiftException
addEmbeddableCartridge in interface IApplicationcartridge - the embeddable cartridge that shall be added to this
            application
OpenShiftException
public List<IEmbeddedCartridge> addEmbeddableCartridges(Collection<IEmbeddableCartridge> cartridges)
                                                 throws OpenShiftException
IApplication
addEmbeddableCartridges in interface IApplicationOpenShiftException#addEmbeddableCartridge(IEmbeddedCartridge), 
#removeEmbeddedCartridge(IEmbeddedCartridge)
protected void removeEmbeddedCartridge(IEmbeddedCartridge embeddedCartridge)
                                throws OpenShiftException
embeddedCartridge - 
OpenShiftException
protected void refreshEmbeddedCartridges()
                                  throws OpenShiftException
OpenShiftException
public List<IEmbeddedCartridge> getEmbeddedCartridges()
                                               throws OpenShiftException
IApplication
getEmbeddedCartridges in interface IApplicationOpenShiftExceptionIEmbeddedCartridge, 
#addEmbeddableCartridge(IEmbeddedCartridge), 
#removeEmbeddedCartridge(IEmbeddedCartridge)
public boolean hasEmbeddedCartridge(String cartridgeName)
                             throws OpenShiftException
IApplicationtrue if this application has an embedded cartridge.
 Returns false otherwise.
hasEmbeddedCartridge in interface IApplicationOpenShiftExceptionIEmbeddedCartridge, 
#addEmbeddableCartridge(IEmbeddedCartridge), 
#removeEmbeddedCartridge(IEmbeddedCartridge)
public boolean hasEmbeddedCartridge(IEmbeddableCartridge cartridge)
                             throws OpenShiftException
IApplicationtrue if this application has an embedded cartridge.
 Returns false otherwise.
hasEmbeddedCartridge in interface IApplicationOpenShiftExceptionIEmbeddedCartridge, 
#addEmbeddableCartridge(IEmbeddedCartridge), 
#removeEmbeddedCartridge(IEmbeddedCartridge)
public IEmbeddedCartridge getEmbeddedCartridge(IEmbeddableCartridge cartridge)
                                        throws OpenShiftException
IApplicationnull if none was
 found.
getEmbeddedCartridge in interface IApplicationOpenShiftException
public IEmbeddedCartridge getEmbeddedCartridge(String cartridgeName)
                                        throws OpenShiftException
IApplicationnull
 if none was found.
getEmbeddedCartridge in interface IApplicationOpenShiftException
public void removeEmbeddedCartridge(IEmbeddableCartridge cartridge)
                             throws OpenShiftException
IApplication
removeEmbeddedCartridge in interface IApplicationcartridge - the cartridge that shall be removed
OpenShiftException
public void removeEmbeddedCartridges(Collection<IEmbeddableCartridge> cartridges)
                              throws OpenShiftException
IApplication
removeEmbeddedCartridges in interface IApplicationcartridges - the cartridges that shall get removed
OpenShiftException
public Collection<IGearGroup> getGearGroups()
                                     throws OpenShiftException
IApplication
getGearGroups in interface IApplicationIGearGroup for this application.
OpenShiftException
public boolean waitForAccessible(long timeout)
                          throws OpenShiftException
IApplication
waitForAccessible in interface IApplicationOpenShiftExceptionIApplication.getApplicationUrl()
public Future<Boolean> waitForAccessibleAsync(long timeout)
                                       throws OpenShiftException
IApplication
waitForAccessibleAsync in interface IApplicationOpenShiftExceptionIApplication.getApplicationUrl(), 
IApplication.waitForAccessible(long), 
IOpenShiftConnection.getExecutorService(), 
Futureprotected IOpenShiftConnection getConnection()
protected boolean canResolv(String url)
                     throws MalformedURLException
MalformedURLException
public void refresh()
             throws OpenShiftException
IApplication
refresh in interface IApplicationrefresh in interface IOpenShiftResourceOpenShiftExceptionpublic void setSSHSession(com.jcraft.jsch.Session session)
IApplication
setSSHSession in interface IApplicationsession - the SSH sessionpublic com.jcraft.jsch.Session getSSHSession()
IApplication
getSSHSession in interface IApplicationpublic boolean hasSSHSession()
IApplication
hasSSHSession in interface IApplication
public boolean isPortFowardingStarted()
                               throws OpenShiftSSHOperationException
IApplication
isPortFowardingStarted in interface IApplicationOpenShiftSSHOperationException
public List<IApplicationPortForwarding> refreshForwardablePorts()
                                                         throws OpenShiftSSHOperationException
IApplication
refreshForwardablePorts in interface IApplicationOpenShiftSSHOperationException
public List<IApplicationPortForwarding> getForwardablePorts()
                                                     throws OpenShiftSSHOperationException
IApplication
getForwardablePorts in interface IApplicationOpenShiftSSHOperationException
public List<String> getEnvironmentProperties()
                                      throws OpenShiftSSHOperationException
IApplication
getEnvironmentProperties in interface IApplicationOpenShiftSSHOperationException
public Map<String,IEnvironmentVariable> getEnvironmentVariables()
                                                         throws OpenShiftException
IApplication
getEnvironmentVariables in interface IApplicationOpenShiftSSHOperationException
OpenShiftException
protected Map<String,IEnvironmentVariable> getOrLoadEnvironmentVariables()
                                                                  throws OpenShiftException
OpenShiftException
public IEnvironmentVariable addEnvironmentVariable(String name,
                                                   String value)
                                            throws OpenShiftException
IApplication
addEnvironmentVariable in interface IApplicationname - key associated with the variable to addvalue - value of the new variable
OpenShiftSSHOperationException - - if the variable already exists
OpenShiftException
public Map<String,IEnvironmentVariable> addEnvironmentVariables(Map<String,String> environmentVariables)
                                                         throws OpenShiftException
IApplication
addEnvironmentVariables in interface IApplicationenvironmentVariables - MapOpenShiftSSHOperationException
OpenShiftExceptionpublic void removeEnvironmentVariable(String targetName)
IApplication
removeEnvironmentVariable in interface IApplicationtargetName - key associated with the IEnvironmentVariable to be removedpublic void removeEnvironmentVariable(IEnvironmentVariable environmentVariable)
IApplication
removeEnvironmentVariable in interface IApplicationenvironmentVariable - IEnvironmentVariable instance which should be removed
public boolean hasEnvironmentVariable(String name)
                               throws OpenShiftException
IApplication
hasEnvironmentVariable in interface IApplicationname - Name of the environment variable
true if the current instance has IEnvironmentVariables to return false if the current instance has no IEnvironmentVariables to return
OpenShiftSSHOperationException
OpenShiftException
protected void updateEnvironmentVariables()
                                   throws OpenShiftException
OpenShiftExceptionpublic IEnvironmentVariable getEnvironmentVariable(String name)
IApplication
getEnvironmentVariable in interface IApplicationname - key to be used to locate the environment variable
public boolean canGetEnvironmentVariables()
IApplication
canGetEnvironmentVariables in interface IApplicationtrue if this application can list its environment variables. false if it cannot. Internally this translates to the presence of the link to list environment variables.#getEnvironmentVariablesMap(), 
IApplication.getEnvironmentVariable(String), 
LINK_LIST_ENVIRONMENT_VARIABLESpublic boolean canUpdateEnvironmentVariables()
IApplication
canUpdateEnvironmentVariables in interface IApplicationtrue if this application can augment its environment variables.false if it cannot. IApplication.addEnvironmentVariable(String, String), 
IApplication.addEnvironmentVariables(Map), 
LINK_SET_UNSET_ENVIRONMENT_VARIABLES
protected List<String> sshExecCmd(String command,
                                  ApplicationResource.SshStreams sshStream)
                           throws OpenShiftSSHOperationException
command - 
OpenShiftSSHOperationException
public List<IApplicationPortForwarding> startPortForwarding()
                                                     throws OpenShiftSSHOperationException
startPortForwarding in interface IApplicationOpenShiftSSHOperationException
public List<IApplicationPortForwarding> stopPortForwarding()
                                                    throws OpenShiftSSHOperationException
IApplication
stopPortForwarding in interface IApplicationOpenShiftSSHOperationExceptionprotected void update(ApplicationResourceDTO dto)
public int hashCode()
hashCode in class Objectpublic boolean equals(Object object)
equals in class Objectpublic String toString()
toString in class Object
  | 
OpenShift Java Client 2.5.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||