|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.graph.request.Request
org.modeshape.graph.request.ChangeRequest
org.modeshape.graph.request.UpdatePropertiesRequest
public class UpdatePropertiesRequest
Instruction to update the properties on the node at the specified location.
This request is capable of specifying that certain properties are to have new values and that other properties are to be removed. The request has a single map of properties keyed by their name. If a property is to be set with new values, the map will contain an entry with the property keyed by its name. However, if a property is to be removed, the entry will contain the property name for the key but will have a null entry value.
The use of the map also ensures that a single property appears only once in the request (it either has new values or it is to be removed).
Note that the number of values in a property (e.g., Property.size()
, Property.isEmpty()
,
Property.isSingle()
, and Property.isMultiple()
) has no influence on whether the property should be removed. It
is possible for a property to have no values.
Constructor Summary | |
---|---|
UpdatePropertiesRequest(Location on,
String workspaceName,
Map<Name,Property> properties)
Create a request to update the properties on the node at the supplied location. |
|
UpdatePropertiesRequest(Location on,
String workspaceName,
Map<Name,Property> properties,
boolean removeOtherProperties)
Create a request to update the properties on the node at the supplied location. |
Method Summary | |
---|---|
void |
cancel()
Cancel this request. |
Location |
changedLocation()
Get the location of the top-most node that is to be changed by this request. |
String |
changedWorkspace()
Get the name of the workspace that was changed by this request. |
boolean |
changes(String workspace,
Path path)
Determine if this request changes the branch at the given path. |
UpdatePropertiesRequest |
clone()
This method does not clone the results. |
boolean |
equals(Object obj)
|
boolean |
freeze()
Freeze this request to prevent any further modification. |
Location |
getActualLocationOfNode()
Get the actual location of the node that was updated. |
Set<Name> |
getNewPropertyNames()
Get the names of the properties that were created by this request. |
RequestType |
getType()
Returns the type of the request |
int |
hashCode()
|
String |
inWorkspace()
Get the name of the workspace in which the node exists. |
boolean |
isAllNewProperties()
Determine whether this request only added the properties. |
boolean |
isNewProperty(Name name)
Determine whether the named property was created by this request |
boolean |
isReadOnly()
Return whether this request only reads information. |
Location |
on()
Get the location defining the node that is to be updated. |
Map<Name,Property> |
properties()
Get the map of properties for the node, keyed by property name. |
boolean |
removeOtherProperties()
Return whether any properties not being updated should be removed. |
void |
setActualLocationOfNode(Location actual)
Sets the actual and complete location of the node being updated. |
void |
setNewProperties(Iterable<Name> nameOfCreatedProperties)
Record that the named properties did not exist prior to the processing of this request and were actually created by this request. |
void |
setNewProperties(Name... nameOfCreatedProperties)
Record that the named properties did not exist prior to the processing of this request and were actually created by this request. |
void |
setNewProperty(Name nameOfCreatedProperty)
Record that the named property did not exist prior to the processing of this request and was actually created by this request. |
String |
toString()
|
Methods inherited from class org.modeshape.graph.request.Request |
---|
checkNotFrozen, getError, hasError, isCancelled, isFrozen, printable, printable, setError, setLatchForFreezing |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public UpdatePropertiesRequest(Location on, String workspaceName, Map<Name,Property> properties)
on
- the location of the node to be readworkspaceName
- the name of the workspace containing the nodeproperties
- the map of properties (keyed by their name), which is reused without copying
IllegalArgumentException
- if the location or workspace name is null or if there are no properties to updatepublic UpdatePropertiesRequest(Location on, String workspaceName, Map<Name,Property> properties, boolean removeOtherProperties)
on
- the location of the node to be readworkspaceName
- the name of the workspace containing the nodeproperties
- the map of properties (keyed by their name), which is reused without copyingremoveOtherProperties
- if any properties not being updated should be removed
IllegalArgumentException
- if the location or workspace name is null or if there are no properties to updateMethod Detail |
---|
public boolean isReadOnly()
isReadOnly
in class Request
Request.isReadOnly()
public Location on()
public String inWorkspace()
public Map<Name,Property> properties()
public boolean removeOtherProperties()
public void setActualLocationOfNode(Location actual)
path
.
actual
- the actual location of the node being updated, or null if the current location
should be used
IllegalArgumentException
- if the actual location is null or does not have a path.
IllegalStateException
- if the request is frozensetNewProperties(Iterable)
,
setNewProperties(Name...)
,
setNewProperty(Name)
public Location getActualLocationOfNode()
public void setNewProperty(Name nameOfCreatedProperty)
nameOfCreatedProperty
- the name of one of the properties
that was created by this request
IllegalStateException
- if the request is frozen
IllegalArgumentException
- if the name is null or if it is not the name of one of the properties
setActualLocationOfNode(Location)
,
setNewProperties(Name...)
,
setNewProperties(Iterable)
public void setNewProperties(Name... nameOfCreatedProperties)
nameOfCreatedProperties
- the names of the properties
that were created by this request
IllegalStateException
- if the request is frozen
IllegalArgumentException
- if the name is null or if it is not the name of one of the properties
setActualLocationOfNode(Location)
,
setNewProperties(Iterable)
,
setNewProperty(Name)
public void setNewProperties(Iterable<Name> nameOfCreatedProperties)
nameOfCreatedProperties
- the names of the properties
that were created by this request
IllegalStateException
- if the request is frozen
IllegalArgumentException
- if any of the names are not in the updated properties
setActualLocationOfNode(Location)
,
setNewProperties(Name...)
,
setNewProperty(Name)
public Set<Name> getNewPropertyNames()
properties
that were created by this request.
public boolean isNewProperty(Name name)
name
- the property name
public boolean isAllNewProperties()
public boolean freeze()
freeze
in class Request
Request.freeze()
public boolean changes(String workspace, Path path)
changes
in class ChangeRequest
workspace
- the name of the workspace; may not be nullpath
- the path; may not be null
ChangeRequest.changes(java.lang.String, org.modeshape.graph.property.Path)
public void cancel()
cancellation flag
is set, and any current or
future processing of the request may be affected by the cancellation. (Note however, that processors may choose to not
respect this request.)
This method is safe to be called by different threads.
cancel
in class Request
Request.cancel()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public Location changedLocation()
path
.
changedLocation
in class ChangeRequest
ChangeRequest.changedLocation()
public String changedWorkspace()
changedWorkspace
in class ChangeRequest
ChangeRequest.changedWorkspace()
public String toString()
toString
in class Object
Object.toString()
public UpdatePropertiesRequest clone()
This method does not clone the results.
This method does not clone the results.
clone
in class ChangeRequest
ChangeRequest.clone()
public RequestType getType()
Request
getType
in class Request
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |