public class ApplicationResource extends AbstractOpenShiftResource implements IApplication
AbstractOpenShiftResource.ServiceRequest| Modifier | Constructor and Description |
|---|---|
protected |
ApplicationResource(ApplicationResourceDTO dto,
ICartridge cartridge,
DomainResource domain)
Constructor...
|
protected |
ApplicationResource(String name,
String uuid,
String creationTime,
List<Message> creationLog,
String applicationUrl,
String gitUrl,
IGearProfile gearProfile,
ApplicationScale scale,
ICartridge cartridge,
List<String> aliases,
Map<String,String> embeddedCartridgesInfos,
Map<String,Link> links,
DomainResource domain)
Instantiates a new application.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAlias(String alias)
Add application alias
|
List<IEmbeddedCartridge> |
addEmbeddableCartridge(ICartridgeConstraint cartridgeConstraint)
Adds the embeddable cartridges that match the given constraint.
|
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.
|
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.
|
ICartridge |
getCartridge()
Returns the cartridge (application type) that this app is running on.
|
String |
getCartridge(String cartridgeName) |
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.
|
Collection<IEmbeddedCartridge> |
getEmbeddedCartridges(ICartridgeConstraint constraint)
Returns the embedded cartridges in this application that match the given cartridge constraint.
|
List<String> |
getEnvironmentProperties()
Retrieves the list of environment properties.
|
List<IApplicationPortForwarding> |
getForwardablePorts()
Returns the list of forwardable ports on OpenShift 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 |
getName()
Returns the name of this application.
|
com.jcraft.jsch.Session |
getSSHSession()
Returns the SSH session that this application uses to connect to
OpenShift.
|
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. |
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.
|
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 |
removeEmbeddedCartridges(ICartridgeConstraint cartridgeConstraint)
Removes the embeddable cartridges that match the given constraint.
|
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.
|
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() |
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.
|
areLinksLoaded, getCreationLog, getLink, getService, hasCreationLogclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetCreationLog, hasCreationLogprotected ApplicationResource(ApplicationResourceDTO dto, ICartridge cartridge, DomainResource domain)
dto - cartridge - domain - protected ApplicationResource(String name, String uuid, String creationTime, List<Message> creationLog, String applicationUrl, String gitUrl, IGearProfile gearProfile, ApplicationScale scale, ICartridge cartridge, List<String> aliases, Map<String,String> embeddedCartridgesInfos, Map<String,Link> links, DomainResource domain)
name - the nameuuid - the uuidcreationTime - the creation timecreationLog - the creation logapplicationUrl - the application urlgitUrl - the git urlcartridge - the cartridge (type/framework)aliases - the aliaseslinks - the linksdomain - the domain this application belongs toDatatypeConfigurationExceptionpublic String getName()
IApplicationgetName in interface IApplicationpublic ApplicationScale getApplicationScale()
IApplicationgetApplicationScale in interface IApplicationpublic IGearProfile getGearProfile()
IApplicationgetGearProfile in interface IApplicationpublic String getUUID()
IApplicationgetUUID in interface IApplicationpublic ICartridge getCartridge()
IApplicationgetCartridge in interface IApplicationpublic Date getCreationTime()
IApplicationgetCreationTime in interface IApplicationpublic IDomain getDomain()
IApplicationgetDomain in interface IApplicationpublic void destroy()
throws OpenShiftException
IApplicationdestroy in interface IApplicationOpenShiftExceptionIUser#getApplications()public void start()
throws OpenShiftException
IApplicationstart in interface IApplicationOpenShiftExceptionpublic void restart()
throws OpenShiftException
IApplicationrestart in interface IApplicationOpenShiftExceptionpublic void stop()
throws OpenShiftException
IApplicationstop in interface IApplicationOpenShiftExceptionpublic void stop(boolean force)
throws OpenShiftException
IApplicationstop in interface IApplicationforce - : true to force stop, false otherwiseOpenShiftExceptionpublic void getDescriptor()
public void scaleDown()
throws OpenShiftException
IApplicationscaleDown in interface IApplicationOpenShiftExceptionpublic void scaleUp()
throws OpenShiftException
IApplicationscaleUp in interface IApplicationOpenShiftExceptionpublic void addAlias(String alias) throws OpenShiftException
IApplicationaddAlias in interface IApplicationOpenShiftExceptionpublic List<String> getAliases()
IApplicationgetAliases in interface IApplicationpublic boolean hasAlias(String name)
hasAlias in interface IApplicationpublic void removeAlias(String alias) throws OpenShiftException
IApplicationremoveAlias in interface IApplicationOpenShiftExceptionpublic String getGitUrl()
IApplicationgetGitUrl in interface IApplicationpublic String getApplicationUrl()
IApplicationgetApplicationUrl in interface IApplicationpublic List<IEmbeddedCartridge> addEmbeddableCartridge(ICartridgeConstraint cartridgeConstraint) throws OpenShiftException
IApplicationaddEmbeddableCartridge in interface IApplicationcartridgeConstraint - the constraint that determines what cartridges shall be addedOpenShiftException - if no cartridge matches the constraintpublic IEmbeddedCartridge addEmbeddableCartridge(IEmbeddableCartridge cartridge) throws OpenShiftException
addEmbeddableCartridge in interface IApplicationcartridge - the embeddable cartridge that shall be added to this
applicationOpenShiftExceptionpublic List<IEmbeddedCartridge> addEmbeddableCartridges(Collection<IEmbeddableCartridge> cartridges) throws OpenShiftException
IApplicationaddEmbeddableCartridges in interface IApplicationOpenShiftException#addEmbeddableCartridge(IEmbeddedCartridge),
#removeEmbeddedCartridge(IEmbeddedCartridge)protected void removeEmbeddedCartridge(IEmbeddedCartridge embeddedCartridge) throws OpenShiftException
embeddedCartridge - OpenShiftExceptionpublic List<IEmbeddedCartridge> getEmbeddedCartridges() throws OpenShiftException
IApplicationgetEmbeddedCartridges 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 IApplicationOpenShiftExceptionpublic Collection<IEmbeddedCartridge> getEmbeddedCartridges(ICartridgeConstraint constraint) throws OpenShiftException
IApplicationgetEmbeddedCartridges in interface IApplicationconstraint - the constraint that the embedded cartridges shall matchOpenShiftExceptionpublic IEmbeddedCartridge getEmbeddedCartridge(String cartridgeName) throws OpenShiftException
IApplicationnull
if none was found.getEmbeddedCartridge in interface IApplicationOpenShiftExceptionpublic void removeEmbeddedCartridges(ICartridgeConstraint cartridgeConstraint) throws OpenShiftException
IApplicationremoveEmbeddedCartridges in interface IApplicationcartridgeConstraint - the constraint that the cartridge shall matchOpenShiftException - if no cartridge matches the constraintpublic void removeEmbeddedCartridge(IEmbeddableCartridge cartridge) throws OpenShiftException
IApplicationremoveEmbeddedCartridge in interface IApplicationcartridge - the cartridge that shall be removedOpenShiftExceptionpublic void removeEmbeddedCartridges(Collection<IEmbeddableCartridge> cartridges) throws OpenShiftException
IApplicationremoveEmbeddedCartridges in interface IApplicationcartridges - the cartridges that shall get removedOpenShiftExceptionpublic boolean waitForAccessible(long timeout)
throws OpenShiftException
IApplicationwaitForAccessible in interface IApplicationOpenShiftExceptionIApplication.getApplicationUrl()public Future<Boolean> waitForAccessibleAsync(long timeout) throws OpenShiftException
IApplicationwaitForAccessibleAsync in interface IApplicationOpenShiftExceptionIApplication.getApplicationUrl(),
IApplication.waitForAccessible(long),
IOpenShiftConnection.getExecutorService(),
Futurepublic String getCartridge(String cartridgeName) throws OpenShiftException
getCartridge in interface IApplicationOpenShiftExceptionprotected IOpenShiftConnection getConnection()
public void refresh()
throws OpenShiftException
IApplicationrefresh in interface IApplicationrefresh in interface IOpenShiftResourceOpenShiftExceptionpublic void setSSHSession(com.jcraft.jsch.Session session)
IApplicationsetSSHSession in interface IApplicationsession - the SSH sessionpublic com.jcraft.jsch.Session getSSHSession()
IApplicationgetSSHSession in interface IApplicationpublic boolean hasSSHSession()
IApplicationhasSSHSession in interface IApplicationpublic boolean isPortFowardingStarted()
throws OpenShiftSSHOperationException
IApplicationisPortFowardingStarted in interface IApplicationOpenShiftSSHOperationExceptionpublic List<IApplicationPortForwarding> refreshForwardablePorts() throws OpenShiftSSHOperationException
IApplicationrefreshForwardablePorts in interface IApplicationOpenShiftSSHOperationExceptionpublic List<IApplicationPortForwarding> getForwardablePorts() throws OpenShiftSSHOperationException
IApplicationgetForwardablePorts in interface IApplicationOpenShiftSSHOperationExceptionpublic List<String> getEnvironmentProperties() throws OpenShiftSSHOperationException
IApplicationgetEnvironmentProperties in interface IApplicationOpenShiftSSHOperationExceptionpublic List<IApplicationPortForwarding> startPortForwarding() throws OpenShiftSSHOperationException
startPortForwarding in interface IApplicationOpenShiftSSHOperationExceptionpublic List<IApplicationPortForwarding> stopPortForwarding() throws OpenShiftSSHOperationException
IApplicationstopPortForwarding in interface IApplicationOpenShiftSSHOperationExceptionCopyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.