public class APIResource extends AbstractOpenShiftResource implements IOpenShiftConnection
AbstractOpenShiftResource.Parameters, AbstractOpenShiftResource.ServiceRequest
DEFAULT_CLIENT_ID
Modifier | Constructor and Description |
---|---|
protected |
APIResource(String token,
IRestService service,
Map<String,Link> links) |
protected |
APIResource(String login,
String password,
String token,
IRestService service,
Map<String,Link> links) |
Modifier and Type | Method and Description |
---|---|
IAuthorization |
createAuthorization(String note,
String scopes) |
protected AuthorizationResource |
createAuthorization(String note,
String scopes,
Integer expiresIn) |
IDomain |
createDomain(String id) |
void |
disconnect() |
protected <C extends ICartridge> |
filterObsolete(boolean includeObsolete,
List<C> allCartridges) |
IAuthorization |
getAuthorization() |
IAuthorization |
getAuthorization(String id) |
List<IAuthorization> |
getAuthorizations() |
List<ICartridge> |
getCartridges()
Returns all the available cartridges, embeddable and standalone ones.
|
List<ICartridge> |
getCartridges(boolean includeObsolete)
Returns all the available cartridges, embeddable and standalone ones.
|
IDomain |
getDefaultDomain() |
IDomain |
getDomain(String id) |
List<IDomain> |
getDomains()
Returns the domains associated with the current OpenShift connection.
|
List<IEmbeddableCartridge> |
getEmbeddableCartridges()
Returns the available embeddable cartridges associated with the current
OpenShift connection.
|
List<IEmbeddableCartridge> |
getEmbeddableCartridges(boolean includeObsolete)
Returns the available embeddable cartridges associated with the current
OpenShift connection.
|
ExecutorService |
getExecutorService()
Returns the executor service instance that's available in this
connection.
|
protected String |
getLogin() |
protected AuthorizationResource |
getOrCreateAuthorization(String token) |
protected List<IEmbeddableCartridge> |
getOrLoadEmbeddableCartridges() |
protected List<IStandaloneCartridge> |
getOrLoadStandaloneCartridges() |
protected String |
getPassword() |
List<IQuickstart> |
getQuickstarts()
Returns the available quickstarts associated with the current
OpenShift connection.
|
String |
getServer()
Returns the server this connection is bound to.
|
List<IStandaloneCartridge> |
getStandaloneCartridges()
Returns the available standalone cartridges associated with the current
OpenShift connection.
|
List<IStandaloneCartridge> |
getStandaloneCartridges(boolean includeObsolete)
Returns the available standalone cartridges associated with the current
OpenShift connection.
|
IUser |
getUser()
Returns the user associated with the current OpenShift connection.
|
protected boolean |
hasDomain(String name) |
void |
refresh()
Refresh the resource and its list of children resources that were
previously loaded
|
protected void |
removeAuthorization() |
protected void |
removeDomain(IDomain domain)
Called after a domain has been destroyed
|
IDomain |
showDomain(String id) |
getCreationLog, getLink, getMessages, hasCreationLog, setLinks
protected APIResource(String token, IRestService service, Map<String,Link> links)
protected final String getLogin()
protected final String getPassword()
public String getServer()
IOpenShiftConnection
getServer
in interface IOpenShiftConnection
public IUser getUser() throws OpenShiftException
IOpenShiftConnection
getUser
in interface IOpenShiftConnection
OpenShiftException
public IAuthorization createAuthorization(String note, String scopes) throws OpenShiftException
OpenShiftException
protected AuthorizationResource createAuthorization(String note, String scopes, Integer expiresIn) throws OpenShiftException
OpenShiftException
protected void removeAuthorization()
protected AuthorizationResource getOrCreateAuthorization(String token)
public IAuthorization getAuthorization() throws OpenShiftException
OpenShiftException
public IAuthorization getAuthorization(String id) throws OpenShiftException
OpenShiftException
public List<IAuthorization> getAuthorizations() throws OpenShiftException
OpenShiftException
public List<IDomain> getDomains() throws OpenShiftException
IOpenShiftConnection
getDomains
in interface IOpenShiftConnection
OpenShiftException
public IDomain getDomain(String id) throws OpenShiftException
OpenShiftException
public IDomain getDefaultDomain()
public IDomain createDomain(String id) throws OpenShiftException
OpenShiftException
public IDomain showDomain(String id) throws OpenShiftException
OpenShiftException
public List<IStandaloneCartridge> getStandaloneCartridges() throws OpenShiftException
IOpenShiftConnection
getStandaloneCartridges
in interface IOpenShiftConnection
OpenShiftException
public List<IStandaloneCartridge> getStandaloneCartridges(boolean includeObsolete) throws OpenShiftException
IOpenShiftConnection
getStandaloneCartridges
in interface IOpenShiftConnection
includeObsolete
- include obsolete cartridgesOpenShiftException
protected List<IStandaloneCartridge> getOrLoadStandaloneCartridges() throws OpenShiftException
OpenShiftException
public List<IEmbeddableCartridge> getEmbeddableCartridges() throws OpenShiftException
IOpenShiftConnection
getEmbeddableCartridges
in interface IOpenShiftConnection
OpenShiftException
public List<IEmbeddableCartridge> getEmbeddableCartridges(boolean includeObsolete) throws OpenShiftException
IOpenShiftConnection
getEmbeddableCartridges
in interface IOpenShiftConnection
includeObsolete
- include obsolete cartridgesOpenShiftException
protected List<IEmbeddableCartridge> getOrLoadEmbeddableCartridges() throws OpenShiftException
OpenShiftException
protected <C extends ICartridge> List<C> filterObsolete(boolean includeObsolete, List<C> allCartridges)
public List<ICartridge> getCartridges()
IOpenShiftConnection
getCartridges
in interface IOpenShiftConnection
public List<ICartridge> getCartridges(boolean includeObsolete)
IOpenShiftConnection
getCartridges
in interface IOpenShiftConnection
includeObsolete
- whether to include obsolete cartridges or not.public void refresh() throws OpenShiftException
IOpenShiftResource
refresh
in interface IOpenShiftResource
OpenShiftException
protected void removeDomain(IDomain domain)
domain
- the domain to remove from the API's domains list.protected boolean hasDomain(String name) throws OpenShiftException
OpenShiftException
public List<IQuickstart> getQuickstarts()
IOpenShiftConnection
getQuickstarts
in interface IOpenShiftConnection
public ExecutorService getExecutorService()
IOpenShiftConnection
getExecutorService
in interface IOpenShiftConnection
ExecutorService
,
Executors
public void disconnect()
Copyright © 2016 JBoss by Red Hat. All rights reserved.