Package org.apache.sling.installer.api
Class UpdateResult
- java.lang.Object
-
- org.apache.sling.installer.api.UpdateResult
-
public class UpdateResult extends java.lang.Object
The update result is returned by anUpdateHandler
if a resource could be persisted by the handler. The update result always contains the complete url where the resource has been persisted. If this url is different from the previous location of this resource, thegetResourceIsMoved()
flag tells the installer whether the resource has moved to a new location or if the resource has been additionally added to a new location (old location contains the old version of the resource).- Since:
- 3.1
-
-
Constructor Summary
Constructors Constructor Description UpdateResult(java.lang.String url)
Create an update result
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDigest()
Return this resource's digest.int
getPriority()
Return the priority of this resource.java.lang.String
getResourceId()
Return just the resource id (everything in the url after the colon)boolean
getResourceIsMoved()
Has this resource been moved or added?java.lang.String
getScheme()
Return the scheme of the provider.java.lang.String
getURL()
Return this data's url.void
setDigest(java.lang.String digest)
Set the digest.void
setPriority(java.lang.Integer prio)
Set the priority.void
setResourceIsMoved(boolean flag)
Set whether this resource has been moved or added.java.lang.String
toString()
-
-
-
Method Detail
-
getURL
public java.lang.String getURL()
Return this data's url. It is opaque for theOsgiInstaller
but should uniquely identify the resource within the namespace of the used installation mechanism. The url includes the scheme followed by a colon followed by the unique id.- Returns:
- The url.
-
getScheme
public java.lang.String getScheme()
Return the scheme of the provider.- Returns:
- The scheme
-
getResourceId
public java.lang.String getResourceId()
Return just the resource id (everything in the url after the colon)- Returns:
- The resource id
-
getDigest
public java.lang.String getDigest()
Return this resource's digest. Not necessarily an actual md5 or other digest of the data, can be any string that changes if the data changes.- Returns:
- The digest or
null
.
-
getPriority
public int getPriority()
Return the priority of this resource. Priorities are used to decide which resource to install when several are registered for the same OSGi entity (bundle, config, etc.)- Returns:
- The priority
-
setPriority
public void setPriority(java.lang.Integer prio)
Set the priority.- Parameters:
prio
- The new priority ornull
for the default priority.
-
setDigest
public void setDigest(java.lang.String digest)
Set the digest.- Parameters:
digest
- The new digest.
-
setResourceIsMoved
public void setResourceIsMoved(boolean flag)
Set whether this resource has been moved or added.- Parameters:
flag
- Flag indicating that this is a move
-
getResourceIsMoved
public boolean getResourceIsMoved()
Has this resource been moved or added?- Returns:
true
if it has been moved
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-