|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gcube.vremanagement.resourcemanager.impl.resources.ScopedResource
public abstract class ScopedResource
An abstract model for a scoped GCUBEResource
| Nested Class Summary | |
|---|---|
class |
ScopedResource.ResourceNotFound
Unable to find the resource in the infrastructure |
static class |
ScopedResource.STATUS
resource's legal statuses |
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
ScopedResource(String id,
String type,
org.gcube.common.core.scope.GCUBEScope scope)
|
|
| Method Summary | ||
|---|---|---|
protected abstract void |
addToScope()
Adds the resource to the 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
|
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()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
public ScopedResource(String id,
String type,
org.gcube.common.core.scope.GCUBEScope scope)
| Method Detail |
|---|
protected abstract void find()
throws Exception
ScopedResource.ResourceNotFound - if it is impossible to locate the resource
Exception
public void findResource()
throws ScopedResource.ResourceNotFound
ScopedResource.ResourceNotFound - if it is impossible to locate the resource
public void doAction(Operator.ACTION action)
throws ScopedResource.ResourceNotFound,
Exception
ScopedResource.ResourceNotFound
Exception
protected abstract void addToScope()
throws ScopedResource.ResourceNotFound,
Exception
Exception - if the operation fails
ScopedResource.ResourceNotFound - if the resource does not exist in the infrastructure
protected abstract void removeFromScope()
throws ScopedResource.ResourceNotFound,
Exception
Exception - if the operation fails
ScopedResource.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()
public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Object
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 hopeless
E - the source exception
E extends Exceptionpublic String toString()
toString in class Objectprotected org.gcube.common.core.utils.logging.GCUBELog getLogger()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||