public abstract class Resource extends java.lang.Object implements ResourceConst, oracle.lite.util.Sortable
AUTH_TYPE, CONN_MAX_EXCEEDED, DEVICE_DELETE, DEVICE_REGISTER, EMPTY_STR, INVALID_ADDRESS, INVALID_DEVICE, INVALID_DIR, INVALID_ID, INVALID_INF, INVALID_NAME, INVALID_PARAM, INVALID_PLATFORM, INVALID_PROVIDER, INVALID_RESOURCE, INVALID_TYPE, INVALID_URL, NOT_FOUND, NOT_INITIALIZED, NOTIFY_CLASS, NOTIFY_ON_STATUS, NOTIFY_ON_VERIFY, RESOURCE_ENABLED, RESOURCE_VALID, SEP, STR_ANY, STR_BASE_NAME, STR_DMC, STR_EMPTY, STR_FALSE, STR_INF, STR_INF_EXT, STR_ONE, STR_TRUE, STR_WILD, STR_ZERO, SYSTEM_ID, TIME, UPDATE_MAJOR, UPDATE_MINOR, UPDATE_SOFTWARE, UPDATE_SOFTWARE_APPS, UPDATE_SOFTWARE_DMC
Constructor and Description |
---|
Resource(java.sql.ResultSet rs)
Construct a resource object from a ResultSet
|
Modifier and Type | Method and Description |
---|---|
void |
delete()
Deletes (or drops) this object from the repository.
|
boolean |
equals(java.lang.Object o)
Check if the given Resource object is same as this object.
|
java.lang.Object |
getAttribute(java.lang.String name)
Retrieve resource attribute value
|
java.lang.String |
getId()
Get 'id' of the resource object.
|
java.lang.String |
getKey(int type)
Return the sort key.
|
int |
hashCode() |
boolean |
isEnabled()
Check if the resource is enabled or not.
|
boolean |
isSystemResource()
Check if the resource is a 'SYSTEM' resource or not.
|
boolean |
isValid()
Check if the resource is a valid resource or not.
|
void |
removeAttribute(java.lang.String name)
Remove resource attribute.
|
void |
save()
Save the object information in the repository.
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Set resource attribute value
|
void |
setEnabled(boolean val)
Enable or Disable a resource.
|
void |
setNew(boolean flag) |
boolean |
validateAttribute(java.lang.String name,
java.lang.Object check)
Check if a resource attribute value is valid or not.
|
public Resource(java.sql.ResultSet rs) throws java.sql.SQLException
rs
- ResultSet object.java.sql.SQLException
java.sql.SQLException
public void delete() throws ResourceException
ResourceException
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.Object getAttribute(java.lang.String name)
name
- Attribute namenull
if attribute does not
exist.public java.lang.String getId()
String
public java.lang.String getKey(int type)
getKey
in interface oracle.lite.util.Sortable
type
- User defined typepublic int hashCode()
hashCode
in class java.lang.Object
public boolean isEnabled()
true
if enabled, false
otherwise.public boolean isSystemResource()
public boolean isValid()
true
if the resource is valid, false
otherwise.public void removeAttribute(java.lang.String name)
name
- Attribute namepublic void save() throws ResourceException
oracle.lite.resource.ResourceException
ResourceException
public void setAttribute(java.lang.String name, java.lang.Object value)
name
- Attribute namevalue
- Attribute valuepublic void setEnabled(boolean val) throws ResourceException
val
- true
to enable a resourceoracle.lite.resource.ResourceException
ResourceException
public void setNew(boolean flag)
public boolean validateAttribute(java.lang.String name, java.lang.Object check)
java.lang.String
, then it
should be same as the check value.
2. If the value is of type java.util.Date
, then it should
be less than or equals to the current date and time.
3. If the value is null
or undefined, return 'true'.name
- Attribute namecheck
- Check value