public abstract class ScopedResource extends Object
GCUBEResource| Modifier and Type | Class and Description |
|---|---|
class |
ScopedResource.ResourceNotFound
Unable to find the resource in the infrastructure
|
static class |
ScopedResource.STATUS
resource's legal statuses
|
| Modifier and Type | Field and Description |
|---|---|
protected Operator.ACTION |
action
the last action performed on the resource
|
protected String |
errorMessage
the error message, if any, from the last operation
|
protected String |
hostedOn
where the resource is hosted on, it makes sense for RI, GHN
|
protected String |
id
the resource identifier
|
protected Date |
jointTime
Last modification time stamp
|
protected Date |
lastModificationTime
Last modification time stamp
|
protected org.gcube.common.core.utils.logging.GCUBELog |
logger
Object getLogger()
|
protected String |
scope |
protected ScopedResource.STATUS |
status
the current status of the resource
|
protected boolean |
success
result of the last operation performed on the resource
|
protected String |
type
the resource type
|
| Constructor and Description |
|---|
ScopedResource(String id,
String type,
org.gcube.common.core.scope.GCUBEScope scope) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addToScope()
Adds the resource to the scope
|
protected boolean |
checkGhnType(String id,
org.gcube.common.core.scope.GCUBEScope scope) |
void |
doAction(Operator.ACTION action) |
boolean |
equals(Object obj) |
protected abstract void |
find()
Custom
|
void |
findResource()
Looks for the resource in the infrastructure
|
Operator.ACTION |
getAction() |
String |
getErrorMessage() |
String |
getHostedOn() |
String |
getId() |
Date |
getJointTime() |
Date |
getLastModificationTime() |
protected org.gcube.common.core.utils.logging.GCUBELog |
getLogger() |
protected int |
getMaxFindAttempts()
Number of times the resource is searched in the IS before to declare it lost
|
org.gcube.common.core.scope.GCUBEScope |
getScope() |
ScopedResource.STATUS |
getStatus() |
String |
getType() |
int |
hashCode() |
boolean |
isSuccess() |
protected org.gcube.common.vremanagement.whnmanager.client.proxies.WHNManagerProxy |
loadWHNManager(String nodename) |
protected <E extends Exception> |
noHopeForMe(String message,
E e)
Gives up the operation on the resource
|
protected abstract void |
removeFromScope()
Removes the resource from the scope
|
void |
setErrorMessage(String errorMessage) |
void |
setHostedON(String hostedOn) |
void |
setJointTime(Date time)
Updates the time the resource joined the scope
|
void |
setScope(org.gcube.common.core.scope.GCUBEScope scope) |
void |
setStatus(ScopedResource.STATUS status) |
String |
toString() |
protected org.gcube.common.core.utils.logging.GCUBELog logger
protected String id
protected String type
protected String hostedOn
protected boolean success
protected String errorMessage
protected String scope
protected Operator.ACTION action
protected Date lastModificationTime
protected Date jointTime
protected ScopedResource.STATUS status
protected abstract void find()
throws Exception
ScopedResource.ResourceNotFound - if it is impossible to locate the resourceExceptionpublic void findResource()
throws ScopedResource.ResourceNotFound
ScopedResource.ResourceNotFound - if it is impossible to locate the resourcepublic void doAction(Operator.ACTION action) throws ScopedResource.ResourceNotFound, Exception
protected boolean checkGhnType(String id, org.gcube.common.core.scope.GCUBEScope scope) throws Exception
Exceptionprotected org.gcube.common.vremanagement.whnmanager.client.proxies.WHNManagerProxy loadWHNManager(String nodename) throws MalformedURLException
MalformedURLExceptionprotected abstract void addToScope()
throws ScopedResource.ResourceNotFound,
Exception
Exception - if the operation failsScopedResource.ResourceNotFound - if the resource does not exist in the infrastructureprotected abstract void removeFromScope()
throws ScopedResource.ResourceNotFound,
Exception
Exception - if the operation failsScopedResource.ResourceNotFound - if the resource does not exist in the infrastructurepublic String getId()
public String getType()
public final org.gcube.common.core.scope.GCUBEScope getScope()
public final void setScope(org.gcube.common.core.scope.GCUBEScope scope)
public Operator.ACTION getAction()
public String getErrorMessage()
public void setErrorMessage(String errorMessage)
errorMessage - the errorMessage to setpublic void setJointTime(Date time)
time - the new joint timepublic boolean isSuccess()
public String getHostedOn()
public void setHostedON(String hostedOn)
public Date getJointTime()
public Date getLastModificationTime()
public ScopedResource.STATUS getStatus()
public void setStatus(ScopedResource.STATUS status)
status - the status to setprotected int getMaxFindAttempts()
protected <E extends Exception> void noHopeForMe(String message, E e) throws E extends Exception
message - the error message to returne - the exception that generates the hopelessE - the source exceptionE extends Exceptionprotected org.gcube.common.core.utils.logging.GCUBELog getLogger()
Copyright © 2015. All Rights Reserved.