|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.wvcm.ResourceImpl
org.apache.wvcm.ControllableResourceImpl
public class ControllableResourceImpl
Implementation of ControllableResource.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.wvcm.ResourceImpl |
---|
ResourceImpl.LoadedProperties, ResourceImpl.XmlPropertyValue |
Nested classes/interfaces inherited from interface javax.wvcm.ControllableResource |
---|
ControllableResource.Conflict, ControllableResource.Ignore, ControllableResource.MergePreviewReport, ControllableResource.Update |
Nested classes/interfaces inherited from interface javax.wvcm.Resource |
---|
Resource.GenericResourceImpl |
Field Summary |
---|
Fields inherited from class org.apache.wvcm.ResourceImpl |
---|
dnsp, MISSING_PROPERTY_VALUE |
Constructor Summary | |
---|---|
ControllableResourceImpl(Location location)
Constructor |
Method Summary | |
---|---|
void |
doAddLabel(java.lang.String label)
Apply ControllableResource.doAddLabel(java.lang.String) to the CheckedIn version of this ControllableResource . |
void |
doCheckin()
Apply doCheckin(false, true) |
void |
doCheckin(boolean keepCheckedOut,
boolean forkOK)
Changes the state of the resource identified by this ControllableResource
to be checked-in, and synchronizes the persistent state
of the resource to be that of the persistent state
on the client. |
void |
doCheckout()
Apply doCheckout(true, null, false, false) |
void |
doCheckout(boolean forkOK,
java.util.List activityList,
boolean newActivity,
boolean unreserved)
Checkout this ControllableResource so that its content can be modified. |
void |
doControl()
Require that the resource be checked out to be modified and checked in to commit the modifications. |
void |
doCreateResource()
Create a new persistent resource at the location identified by this ControllableResource . |
void |
doCreateVersionControlledResource(Version v)
Create a new controlled resource at the location identified by the proxy. |
ControllableResource |
doMerge(Version source,
boolean noAutoMerge,
boolean noCheckout,
boolean forkOK,
boolean unreserved,
java.util.List activityList,
boolean newActivity,
PropertyNameList wantedPropertyList)
Merge the version specified in source into the resource
identified by this ControllableResource (the "target"). |
ControllableResource.MergePreviewReport |
doMergePreviewReport(Version source)
Return a MergePreviewReport indicating how the resource identified by this ControllableResource
would be modified by a doMerge . |
Version |
doReadLabelledVersionProperties(java.lang.String label,
PropertyNameList wantedPropertyList)
Apply ControllableResource.doReadLabelledVersionProperties(java.lang.String, javax.wvcm.PropertyNameList)
to the version history of this ControllableResource . |
java.util.Iterator |
doRefresh(PropertyNameList wantedPropertyList,
boolean ignoreDirty)
If both the client and the server are maintaining the persistent state of the resource identified by this ControllableResource ,
synchronizes the state on the client to be that of the server. |
void |
doRemoveLabel(java.lang.String label)
Apply ControllableResource.doRemoveLabel(java.lang.String) to the CheckedIn version of this ControllableResource . |
void |
doSetLabel(java.lang.String label)
Apply ControllableResource.doSetLabel(java.lang.String) to the CheckedIn version of this ControllableResource . |
void |
doUncheckout()
Cancels the checkout of a version-controlled resource, and restores its content to the state of its CheckedOut version. |
java.util.Iterator |
doUpdate(Version v,
PropertyNameList wantedPropertyList)
Update the state of this checked-in version-controlled ControllableResource to be the same as the specified version from
the version history of this ControllableResource . |
java.util.List |
getActivityList()
If this ControllableResource is checked-out,
return a list of Activity objects that identify the
activities that will become the activityList of the version created
when this ControllableResource is checked in; otherwise,
return null / |
java.util.List |
getAutoMergeList()
If this ControllableResource is checked-out,
return a list of Version objects that identify the versions whose
content has been merged by the server into the content of
this ControllableResource ; otherwise, return null . |
Version |
getCheckedIn()
If this ControllableResource is checked-in,
return whether the version whose content
is identical to that of this ControllableResource ;
otherwise, return null . |
Version |
getCheckedOut()
If this ControllableResource is checked-out,
return the value of getCheckedIn
when the checkout was performed; otherwise,
return null . |
Configuration |
getControlledConfiguration()
Return the version-controlled configuration of the baseline-controlled folder of which this ControllableResource is a member. |
PropertyNameList |
getDirtyPropertyList()
Return the list of property values whose persistent state is being maintained on both the client and server, and whose client-side state has changed since the client and server state was last synchronized. |
boolean |
getIsCheckedOut()
Return whether the resource identified by this ControllableResource is
checked-out. |
boolean |
getIsDirtyContent()
Return whether both the client and server are maintaining persistent state for the content of this ControllableResource , and whether the client
content has changed since the client and server content
was last synchronized. |
boolean |
getIsStaleContent()
Return whether both the client and server are maintaining persistent state for the content of this ControllableResource , and whether the server
content has changed since the client and server content
was last synchronized. |
java.util.List |
getMergeList()
If this ControllableResource is checked-out, return
a list of Version objects that identify the versions whose
content must be merged by the client into the content of
this ControllableResource ; otherwise, return null . |
java.util.List |
getPredecessorList()
If this ControllableResource is checked-out,
return a list of Version objects that identify the versions that
will become the predecessors of the version created
when this ControllableResource is checked in;
otherwise, return null . |
ControllableResource |
getServerState()
Return the ControllableResource that identifies the resource
on the server that maintains the state for the client resource
identified by this ControllableResource . |
PropertyNameList |
getStalePropertyList()
Return the list of property values whose persistent state is being maintained on both the client and server, and whose server-side state has changed since the client and server state was last synchronized. |
boolean |
getUnreserved()
Return whether this ControllableResource is checked-out, and whether another checkout of the same version can be made in the same activity as the one in the ActivitySet of this ControllableResource . |
boolean |
getVersionControllable()
Return whether version history will be tracked when the resource is controlled. |
VersionHistory |
getVersionHistory()
Return the version history of the CheckedIn or CheckedOut version. |
Workspace |
getWorkspace()
Return the workspace of which this ControllableResource is a member. |
Resource |
readContent(PropertyNameList wantedPropertyList,
java.io.OutputStream content)
If the resource content is available on the client host, the resource content is written to content
and content is closed. |
Resource |
readProperties(PropertyNameList wantedPropertyList)
Return a Resource containing the wanted properties
that are available on the client host
without communicating with the server. |
void |
setActivityList(java.util.List activityList)
Set the ActivityList property of this ControllableResource . |
void |
setAutoMergeList(java.util.List versionList)
Set the AutoMergeList of this ControllableResource . |
void |
setMergeList(java.util.List versionList)
Set the MergeList of this ControllableResource . |
void |
setPredecessorList(java.util.List versionList)
Specify the versions that will be the predecessors of the version created when this ControllableResource is checked in. |
void |
setUnreserved(boolean val)
Set the value of the Unreserved property of this ControllableResource . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ControllableResourceImpl(Location location)
Method Detail |
---|
public Configuration getControlledConfiguration() throws WvcmException
ControllableResource
is a member.
getControlledConfiguration
in interface ControllableResource
WvcmException
- if this ControllableResource
was not created with
PropertyName.VERSION_CONTROLLED_CONFIGURATION
as a wanted property.public void setActivityList(java.util.List activityList)
ControllableResource
.
setActivityList
in interface ControllableResource
activityList
- A list of Activity
objects that identify
the new value for the ActivityList property.public void doCreateResource() throws WvcmException
ControllableResource
. The request will
fail if a resource already exists at that location.
doCreateResource
in interface ControllableResource
WvcmException
- Preconditions:
public ControllableResource doMerge(Version source, boolean noAutoMerge, boolean noCheckout, boolean forkOK, boolean unreserved, java.util.List activityList, boolean newActivity, PropertyNameList wantedPropertyList) throws WvcmException
source
into the resource
identified by this ControllableResource
(the "target").
If the target is checked-in, and the source version is a descendant
of the target version, the target is updated to the source version.
If the target is checked-in, and the source version is an ancestor
of the target version, the target is left unmodified.
If the target is checked-out, or if the target version is on a different
line of descent than the source version, the target is checked out
(if it is not already checked-out), and the source version is either
added to the MergeList or the AutoMergeList of the target.
If a source version is added to the AutoMergeList, the server must
have updated the content of the target to contain the results of merging
the content of the source version with the content of the target at the
time of the merge.
doMerge
in interface ControllableResource
source
- The version to be merged.noAutoMerge
- The server is not allowed to auto-merge.noCheckout
- The server is not allowed to checkout files for merging.forkOK
- Passed into any checkout requests.unreserved
- Passed into any checkout requests.activityList
- Passed into any checkout requests.newActivity
- Passed into any checkout requests.wantedPropertyList
- The properties available in the returned proxy.
ControllableResource
that contains the requested properties
of the resource modified by the merge.
WvcmException
- Preconditions:
public Version getCheckedIn() throws WvcmException
ControllableResource
is checked-in,
return whether the version whose content
is identical to that of this ControllableResource
;
otherwise, return null
.
getCheckedIn
in interface ControllableResource
WvcmException
- if this ControllableResource
was not created with
PropertyName.CHECKED_IN
as a wanted property.public Resource readProperties(PropertyNameList wantedPropertyList) throws WvcmException
Resource
containing the wanted properties
that are available on the client host
without communicating with the server.
readProperties
in interface ControllableResource
wantedPropertyList
- The properties available in the returned proxy.
WvcmException
doReadProperties
public Version getCheckedOut() throws WvcmException
ControllableResource
is checked-out,
return the value of getCheckedIn
when the checkout was performed; otherwise,
return null
.
getCheckedOut
in interface ControllableResource
WvcmException
- if this ControllableResource
was not created with
PropertyName.CHECKED_OUT
as a wanted property.public Resource readContent(PropertyNameList wantedPropertyList, java.io.OutputStream content) throws WvcmException
content
and content
is closed.
readContent
in interface ControllableResource
WvcmException
doReadContent
public void doAddLabel(java.lang.String label) throws WvcmException
ControllableResource.doAddLabel(java.lang.String)
to the CheckedIn version of this ControllableResource
.
doAddLabel
in interface ControllableResource
WvcmException
public java.util.List getPredecessorList() throws WvcmException
ControllableResource
is checked-out,
return a list of Version
objects that identify the versions that
will become the predecessors of the version created
when this ControllableResource
is checked in;
otherwise, return null
.
getPredecessorList
in interface ControllableResource
WvcmException
- if this ControllableResource
was not created with
PropertyName.PREDECESSOR_LIST
as a wanted property.public void setPredecessorList(java.util.List versionList)
ControllableResource
is checked in.
setPredecessorList
in interface ControllableResource
versionList
- A list of Version
objects that will
be the predecessors of the version created when this ControllableResource
is checked in.public void doControl() throws WvcmException
doControl
in interface ControllableResource
WvcmException
- Preconditions:
public void doRemoveLabel(java.lang.String label) throws WvcmException
ControllableResource.doRemoveLabel(java.lang.String)
to the CheckedIn version of this ControllableResource
.
doRemoveLabel
in interface ControllableResource
WvcmException
public void doCheckout(boolean forkOK, java.util.List activityList, boolean newActivity, boolean unreserved) throws WvcmException
ControllableResource
so that its content can be modified.
doCheckout
in interface ControllableResource
forkOK
- Indicates whether to do the checkout even if the
version already has a successor or a checkout.activityList
- A list of Activity
objects that identify
the activities to which the work on the
checked-out resource will contribute.newActivity
- Indicates whether to create a new activity
for the checkout.unreserved
- Indicates whether to do the checkout even
if there already is a checkout from the currently selected
version in one of the activities specified in the activityList.
WvcmException
- Preconditions:
public void doCheckin(boolean keepCheckedOut, boolean forkOK) throws WvcmException
ControllableResource
to be checked-in, and synchronizes the persistent state
of the resource to be that of the persistent state
on the client. If version history is being tracked for the
resource, the current content of the resource is captured
in a new version resource at a server-defined location.
doCheckin
in interface ControllableResource
keepCheckedOut
- indicates whether to checkout the
resource again immediately after checking it in.
If keepCheckedOut is true
, the ActivityList
and Unreserved properties should not be changed by the checkout.forkOK
- indicates whether to fork even if forking
is discouraged.
WvcmException
- Preconditions:
public void doCheckin() throws WvcmException
doCheckin(false, true)
doCheckin
in interface ControllableResource
WvcmException
public java.util.List getActivityList() throws WvcmException
ControllableResource
is checked-out,
return a list of Activity
objects that identify the
activities that will become the activityList of the version created
when this ControllableResource
is checked in; otherwise,
return null
/
getActivityList
in interface ControllableResource
WvcmException
- if this ControllableResource
was not created with
PropertyName.ACTIVITY_LIST
as a wanted property.public ControllableResource.MergePreviewReport doMergePreviewReport(Version source) throws WvcmException
ControllableResource
would be modified by a doMerge
.
doMergePreviewReport
in interface ControllableResource
source
- The version to be merged.
WvcmException
public void doUncheckout() throws WvcmException
doUncheckout
in interface ControllableResource
WvcmException
- Preconditions:
public boolean getIsCheckedOut() throws WvcmException
ControllableResource
is
checked-out.
getIsCheckedOut
in interface ControllableResource
WvcmException
- if this ControllableResource
was not created with
PropertyName.IS_CHECKED_OUT
as a wanted property.public void setMergeList(java.util.List versionList)
ControllableResource
.
In particular, a client is responsible for deleting versions from
the MergeList after the user has verified that the current
content represents a correct merge of that version.
setMergeList
in interface ControllableResource
versionList
- A list of Version
objects that will be
the value of the MergeList property.public java.util.Iterator doUpdate(Version v, PropertyNameList wantedPropertyList) throws WvcmException
ControllableResource
to be the same as the specified version from
the version history of this ControllableResource
.
doUpdate
in interface ControllableResource
v
- The version specifying the new state of the resource
identified by this ControllableResource
.wantedPropertyList
- The list of properties that will be available
on each ControllableResource
in the result.
ControllableResource
objects that
have been modified as a result of the doUpdate request.
Each version-controlled resource contains a value for each
of the properties specified in the WantedPropertyList.
WvcmException
- Preconditions:
public boolean getUnreserved() throws WvcmException
ControllableResource
.
getUnreserved
in interface ControllableResource
WvcmException
- if this ControllableResource
was not created with
PropertyName.UNRESERVED
as a wanted property.public java.util.Iterator doRefresh(PropertyNameList wantedPropertyList, boolean ignoreDirty) throws WvcmException
ControllableResource
,
synchronizes the state on the client to be that of the server.
If this ControllableResource
is a Folder
, every resource in the configuration
rooted at that folder is refreshed.
doRefresh
in interface ControllableResource
wantedPropertyList
- The properties available in the returned proxies.ignoreDirty
- If true, the content should be downloaded even if
it has been changed on the client since the last download from the
server (thereby overwriting those changes). If false, the content should
be downloaded only if it is unchanged since the last download.
ControllableResource
objects
that are dirty or stale
WvcmException
- Preconditions:
public ControllableResource getServerState() throws WvcmException
ControllableResource
that identifies the resource
on the server that maintains the state for the client resource
identified by this ControllableResource
. If this Controllable
resource only has state on the server or only has state on the client,
null
is returned.
getServerState
in interface ControllableResource
WvcmException
- if this ControllableResource
was not created with
PropertyName.SERVER_STATE
as a wanted property.Workspace.setServerState(javax.wvcm.Workspace)
public void setUnreserved(boolean val)
ControllableResource
.
setUnreserved
in interface ControllableResource
val
- The new value for the Unreserved property of this ControllableResource
.public java.util.List getAutoMergeList() throws WvcmException
ControllableResource
is checked-out,
return a list of Version
objects that identify the versions whose
content has been merged by the server into the content of
this ControllableResource
; otherwise, return null
.
getAutoMergeList
in interface ControllableResource
WvcmException
- if this ControllableResource
was not created with
PropertyName.AUTO_MERGE_LIST
as a wanted property.public boolean getIsStaleContent() throws WvcmException
ControllableResource
, and whether the server
content has changed since the client and server content
was last synchronized.
getIsStaleContent
in interface ControllableResource
WvcmException
- if this ControllableResource
was not created with
PropertyName.IS_STALE_CONTENT
as a wanted property.public java.util.List getMergeList() throws WvcmException
ControllableResource
is checked-out, return
a list of Version
objects that identify the versions whose
content must be merged by the client into the content of
this ControllableResource
; otherwise, return null
.
getMergeList
in interface ControllableResource
WvcmException
- if this ControllableResource
was not created with
PropertyName.MERGE_LIST
as a wanted property.public boolean getIsDirtyContent() throws WvcmException
ControllableResource
, and whether the client
content has changed since the client and server content
was last synchronized.
getIsDirtyContent
in interface ControllableResource
WvcmException
- if this ControllableResource
was not created with
PropertyName.IS_DIRTY_CONTENT
as a wanted property.public void doSetLabel(java.lang.String label) throws WvcmException
ControllableResource.doSetLabel(java.lang.String)
to the CheckedIn version of this ControllableResource
.
doSetLabel
in interface ControllableResource
WvcmException
public Version doReadLabelledVersionProperties(java.lang.String label, PropertyNameList wantedPropertyList) throws WvcmException
ControllableResource.doReadLabelledVersionProperties(java.lang.String, javax.wvcm.PropertyNameList)
to the version history of this ControllableResource
.
doReadLabelledVersionProperties
in interface ControllableResource
WvcmException
public PropertyNameList getStalePropertyList() throws WvcmException
getStalePropertyList
in interface ControllableResource
WvcmException
- if this ControllableResource
was not created with
PropertyName.STALE_PROPERTY_LIST
as a wanted property.public void doCheckout() throws WvcmException
doCheckout(true, null, false, false)
doCheckout
in interface ControllableResource
WvcmException
public void setAutoMergeList(java.util.List versionList)
ControllableResource
.
A client is responsible for deleting entries from
the AutoMergeList after the user has verified that the automatic
merge was performed correctly by the server.
setAutoMergeList
in interface ControllableResource
versionList
- A list of Version
objects that identify
the new value for the AutoMergeList property.public PropertyNameList getDirtyPropertyList() throws WvcmException
getDirtyPropertyList
in interface ControllableResource
WvcmException
- if this ControllableResource
was not created with
PropertyName.DIRTY_PROPERTY_LIST
as a wanted property.public boolean getVersionControllable() throws WvcmException
getVersionControllable
in interface ControllableResource
WvcmException
- if this ControllableResource
was not created with
PropertyName.VERSION_CONTROLLABLE
as a wanted property.doControl
public void doCreateVersionControlledResource(Version v) throws WvcmException
doCreateVersionControlledResource
in interface ControllableResource
v
- The version used to initialize the controlled
resource.
WvcmException
- Preconditions:
public VersionHistory getVersionHistory() throws WvcmException
getVersionHistory
in interface ControllableResource
WvcmException
- if this ControllableResource
was not created with
PropertyName.VERSION_HISTORY
as a wanted property.public Workspace getWorkspace() throws WvcmException
ControllableResource
is a member.
By definition, the workspace property of a workspace
identifies itself, and the workspace property of any other
type of resource must identify the same workspace as its parent.
getWorkspace
in interface ControllableResource
WvcmException
- if this ControllableResource
was not created with
PropertyName.WORKSPACE
as a wanted property.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |