|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.xtreemos.xosd.vo.rca.server.ResourceRegistration
public class ResourceRegistration
The class representing the interface to the database of the registered resources for the Resource Certification Authority (RCA). The RCA database keeps a list of resources that are pending registration, and the ones having been registered. Anyone can apply for their resource to be registered, but only the authorised users should be able to grant the application, thus completing the registration of the resource. The resources that have been registered can have their resource certificates signed by the RCA.
Field Summary | |
---|---|
protected java.util.Hashtable<java.lang.String,eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord> |
appliedResources
The collection of resources applied for the registration. |
protected java.lang.String |
dbAppliedStorageFile
The filename where the applied resource database should (de)serialise. |
protected java.lang.String |
dbRegisteredStorageFile
The filename where the registered resource database should (de)serialise. |
(package private) static org.apache.log4j.Logger |
logger
|
protected java.util.Hashtable<java.lang.String,eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord> |
registeredResources
The collection of resources that have been successfully registered. |
protected java.lang.String |
resourceRegistrationFile
The filename for serialising the data into and the object from. |
static java.lang.Integer |
ResourceStatusNone
The status of the resource is none (neither applied nor registered). |
static java.lang.Integer |
ResourceStatusPending
The status of the resource is pending (applied for registration). |
static java.lang.Integer |
ResourceStatusRegistered
The status of the resource is registered. |
Constructor Summary | |
---|---|
ResourceRegistration()
|
|
ResourceRegistration(java.lang.String rcaDBFile)
Provide the name if the file that is to be used for storing and loading the database. |
Method Summary | |
---|---|
void |
applyForResourceRegistration(eu.xtreemos.xosd.vo.rca.ResourceID id,
eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord resource)
Adds the resource to the list of resources that are waiting to be confirmed for registration. |
void |
clear()
Clears the collections containing pending and registered resources. |
eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord |
confirmRegistration(eu.xtreemos.xosd.vo.rca.ResourceID id)
Confirms the resouce registration by moving the resource's entry from the pending resources collection to the registered resources collection. |
protected void |
finalize()
|
protected java.util.Hashtable<java.lang.String,eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord> |
getAppliedResources()
|
java.util.ArrayList<eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord> |
getPendingResources()
Return a list of resources currently pending for registration. |
java.util.ArrayList<eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord> |
getRegisteredResources()
Return a list of currently registered resources. |
protected java.util.Hashtable<java.lang.String,eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord> |
getRegisterefResourcesHT()
|
eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord |
getResource(eu.xtreemos.xosd.vo.rca.ResourceID id)
Checks whether the resource with the given id has been registered or is pending registration, and returns its description. |
java.lang.Integer |
getResourceStatus(eu.xtreemos.xosd.vo.rca.ResourceID id)
Check the status of the resource. |
protected void |
loadData()
|
void |
registerResource(eu.xtreemos.xosd.vo.rca.ResourceID id,
eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord resource)
Adds a resource to the list of registered entries. |
protected void |
saveData()
|
eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord |
unregisterResource(eu.xtreemos.xosd.vo.rca.ResourceID id)
Remove the resource previously registered with the given id. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static org.apache.log4j.Logger logger
public static final java.lang.Integer ResourceStatusNone
public static final java.lang.Integer ResourceStatusPending
public static final java.lang.Integer ResourceStatusRegistered
protected java.util.Hashtable<java.lang.String,eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord> appliedResources
protected java.util.Hashtable<java.lang.String,eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord> registeredResources
protected java.lang.String dbAppliedStorageFile
protected java.lang.String dbRegisteredStorageFile
protected java.lang.String resourceRegistrationFile
Constructor Detail |
---|
public ResourceRegistration()
public ResourceRegistration(java.lang.String rcaDBFile)
rcaDBFile
- The basis of the filenames of the serialised
collections.Method Detail |
---|
protected void loadData() throws java.lang.Exception
java.lang.Exception
protected void saveData() throws java.lang.Exception
java.lang.Exception
public void registerResource(eu.xtreemos.xosd.vo.rca.ResourceID id, eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord resource)
id
- The id of the resource, serving as the key to the resource.resource
- The description of the resource to be registered.public void applyForResourceRegistration(eu.xtreemos.xosd.vo.rca.ResourceID id, eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord resource)
id
- The id of the resource, serving as the key to the resource.resource
- The description of the resource to be registered.public eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord getResource(eu.xtreemos.xosd.vo.rca.ResourceID id)
id
- The id of the resource to retrieve.
public eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord confirmRegistration(eu.xtreemos.xosd.vo.rca.ResourceID id)
id
- The ID of the resource previously placed on the pending
resource list.
public java.lang.Integer getResourceStatus(eu.xtreemos.xosd.vo.rca.ResourceID id)
id
-
public eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord unregisterResource(eu.xtreemos.xosd.vo.rca.ResourceID id)
id
- The id of the resource to unregister.
public java.util.ArrayList<eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord> getRegisteredResources()
public java.util.ArrayList<eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord> getPendingResources()
protected java.util.Hashtable<java.lang.String,eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord> getAppliedResources()
protected java.util.Hashtable<java.lang.String,eu.xtreemos.xosd.resmng.data.ResourceDescriptorRecord> getRegisterefResourcesHT()
public void clear()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |