|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.perforce.p4java.impl.generic.core.ServerResource
public abstract class ServerResource
Abstract implementation class for the IServerResource interface.
Implementations of interfaces that extend IServerResource should use this as a superclass unless there are good reasons not to.
| Field Summary | |
|---|---|
protected boolean |
refreshable
Refreshable flag |
protected IServer |
server
Server instance |
protected boolean |
updateable
Updateable flag |
| Constructor Summary | |
|---|---|
protected |
ServerResource()
Default constructor -- sets complete to true, completable, refreshable, and updateable to false, and server to null. |
protected |
ServerResource(boolean refreshable,
boolean updateable)
Explicit some-value constructor; sets server to null. |
protected |
ServerResource(boolean refreshable,
boolean updateable,
IServer server)
Explicit all-value constructor. |
protected |
ServerResource(IServer server)
Sets complete to true, completable, refreshable, and updateable to false, and server to the passed-in value. |
| Method Summary | |
|---|---|
boolean |
canRefresh()
Returns true if the underlying object is refreshable from the Perforce server. |
boolean |
canUpdate()
Returns true if the underlying object can be updated back to (or on) the associated Perforce server. |
void |
complete()
|
void |
refresh()
Refresh the underlying object from the Perforce server. |
void |
setRefreshable(boolean refreshable)
Set the resource as refreshable |
void |
setServer(IServer server)
Set the server associated with this resource. |
void |
update()
Update the Perforce server object associated with the underlying P4Java object, if possible. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean refreshable
protected boolean updateable
protected IServer server
| Constructor Detail |
|---|
protected ServerResource()
protected ServerResource(IServer server)
protected ServerResource(boolean refreshable,
boolean updateable)
protected ServerResource(boolean refreshable,
boolean updateable,
IServer server)
| Method Detail |
|---|
public boolean canRefresh()
IServerResourceThe details of what "refreshable" means in this context are always object-dependent, but typically mean that "live" data and metadata will be updated from the server. This is especially useful on objects like changelists, where the underlying server-side data may change often outside P4Java's control.
canRefresh in interface IServerResourceIServerResource.canRefresh()public boolean canUpdate()
IServerResource
canUpdate in interface IServerResourceIServerResource.canUpdate()
public void complete()
throws ConnectionException,
RequestException,
AccessException
ConnectionException
RequestException
AccessExceptioncom.perforce.p4java.core.IServerResource#complete()
public void refresh()
throws ConnectionException,
RequestException,
AccessException
IServerResourceThe details of what "refreshable" means in this context are always object-dependent, but typically mean that "live" data and metadata will be updated from the server.
The results of calling this method on objects whose canRefresh method returns false are undefined (but will generally result in a UnimplementedError being thrown).
refresh in interface IServerResourceConnectionException - if the Perforce server is unreachable or is not
connected.
RequestException - if the Perforce server encounters an error during
its processing of the request
AccessException - if the Perforce server denies access to the callerIServerResource.refresh()
public void update()
throws ConnectionException,
RequestException,
AccessException
IServerResourceThe results of calling this method on objects whose canUpdate method returns false are undefined (but will generally result in a UnimplementedError being thrown).
update in interface IServerResourceConnectionException - if the Perforce server is unreachable or is not
connected.
RequestException - if the Perforce server encounters an error during
its processing of the request
AccessException - if the Perforce server denies access to the callerIServerResource.update()public void setRefreshable(boolean refreshable)
refreshable - public void setServer(IServer server)
IServerResource
setServer in interface IServerResourceserver - IServer to be used for refresh, update, etc.IServerResource.setServer(com.perforce.p4java.server.IServer)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||