public class RegisteredResourceImpl extends Object implements TaskResource, Serializable, Comparable<RegisteredResourceImpl>
ATTR_INSTALL_EXCLUDED, ATTR_INSTALL_INFO
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Clean up used data files.
|
TaskResource |
clone(TransformationResult transformationResult)
Create a new resource with updated information
|
static int |
compare(TaskResource a,
TaskResource b)
Compare resources.
|
int |
compareTo(RegisteredResourceImpl b) |
static RegisteredResourceImpl |
create(InternalResource input)
Try to create a registered resource.
|
boolean |
equals(Object obj) |
Object |
getAttribute(String key)
Get the value of an attribute.
|
Dictionary<String,Object> |
getDictionary()
Return this resource's dictionary.
|
String |
getDigest()
Return this resource's digest.
|
String |
getEntityId()
Return the identifier of the OSGi "entity" that this resource
represents, for example "bundle:SID" where SID is the bundle's
symbolic ID, or "config:PID" where PID is config's PID.
|
InputStream |
getInputStream()
Return an input stream with the data of this resource.
|
long |
getLastChange()
When did the last change happen?
|
int |
getPriority()
Return the priority of this resource.
|
String |
getScheme()
Return the scheme from where the artifact is originated.
|
ResourceState |
getState()
Get the current state of the resource.
|
Object |
getTemporaryAttribute(String key)
Get the value of a temporary attribute.
|
String |
getType()
Return the type of this resource.
|
String |
getURL()
Return this data's URL.
|
org.osgi.framework.Version |
getVersion()
Return the version of the artifact.
|
boolean |
hasDataFile() |
int |
hashCode() |
static boolean |
isSameResource(RegisteredResourceImpl a,
RegisteredResourceImpl b)
Compare two resources where we know that they point to the same entity and have the
same URL!
|
void |
setAttribute(String key,
Object value)
Set the value of an attribute.
|
void |
setState(ResourceState s)
Set the state for the resource.
|
void |
setTemporaryAttribute(String key,
Object value)
Set the value of a temporary attribute.
|
String |
toString() |
void |
update(File file,
Dictionary<String,Object> dict,
String digest,
int priority,
String url) |
void |
update(InternalResource rsrc)
Update the resource uri - if provided.
|
public static RegisteredResourceImpl create(InternalResource input) throws IOException
IOException
public boolean hasDataFile()
public void cleanup()
public String getURL()
RegisteredResource
RegisteredResource.getScheme()
followed by a colon, followed by a unique identifier of
the resource within the providers space..getURL
in interface RegisteredResource
RegisteredResource.getURL()
public InputStream getInputStream() throws IOException
RegisteredResource
getInputStream
in interface RegisteredResource
IOException
RegisteredResource.getInputStream()
public Dictionary<String,Object> getDictionary()
RegisteredResource
getDictionary
in interface RegisteredResource
RegisteredResource.getDictionary()
public String getDigest()
RegisteredResource
getDigest
in interface RegisteredResource
RegisteredResource.getDigest()
public String getType()
RegisteredResource
getType
in interface RegisteredResource
RegisteredResource.getType()
public String getEntityId()
RegisteredResource
getEntityId
in interface RegisteredResource
RegisteredResource.getEntityId()
public Object getAttribute(String key)
TaskResource
ResourceTransformer
or a InstallTask
for
processing.
Typical attributes are the bundle symbolic name or bundle version.getAttribute
in interface TaskResource
key
- The name of the attributenull
TaskResource.getAttribute(java.lang.String)
public void setAttribute(String key, Object value)
TaskResource
setAttribute
in interface TaskResource
key
- The name of the attributevalue
- The attribute value or null
to remove it.TaskResource.setAttribute(java.lang.String, java.lang.Object)
public String getScheme()
RegisteredResource
getScheme
in interface RegisteredResource
RegisteredResource.getScheme()
public int getPriority()
RegisteredResource
getPriority
in interface RegisteredResource
RegisteredResource.getPriority()
public ResourceState getState()
TaskResource
getState
in interface TaskResource
TaskResource.getState()
public void setState(ResourceState s)
public long getLastChange()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public int compareTo(RegisteredResourceImpl b)
compareTo
in interface Comparable<RegisteredResourceImpl>
Comparable.compareTo(java.lang.Object)
public static boolean isSameResource(RegisteredResourceImpl a, RegisteredResourceImpl b)
public static int compare(TaskResource a, TaskResource b)
public Object getTemporaryAttribute(String key)
TaskResource
getTemporaryAttribute
in interface TaskResource
key
- The name of the attributenull
TaskResource.getTemporaryAttribute(java.lang.String)
public void setTemporaryAttribute(String key, Object value)
TaskResource
setTemporaryAttribute
in interface TaskResource
key
- The name of the attributevalue
- The attribute value or null
to remove it.TaskResource.setTemporaryAttribute(java.lang.String, java.lang.Object)
public void update(InternalResource rsrc)
public TaskResource clone(TransformationResult transformationResult) throws IOException
IOException
public void update(File file, Dictionary<String,Object> dict, String digest, int priority, String url)
public org.osgi.framework.Version getVersion()
TaskResource
getVersion
in interface TaskResource
null
TaskResource.getVersion()
Copyright © 2007–2014 The Apache Software Foundation. All rights reserved.