eu.emi.emir.core
Class ServiceAdminManager

java.lang.Object
  extended by eu.emi.emir.core.ServiceAdminManager

public class ServiceAdminManager
extends Object

Class to perform Service Provider related functions

Author:
a.memon, g.szigeti

Constructor Summary
ServiceAdminManager()
           
ServiceAdminManager(MongoDBServiceDatabase mongoDB)
           
 
Method Summary
 org.codehaus.jettison.json.JSONObject addService(org.codehaus.jettison.json.JSONObject jo)
           
 boolean checkMessageGenerationTime(String messageTime, String sendpointID)
           
 boolean checkOwner(String owner, String sendpointID)
           
 List<ServiceObject> findAll()
           
 org.codehaus.jettison.json.JSONObject findServiceByEndpointID(String endpointID)
          Finding a service by endpoint id
 org.codehaus.jettison.json.JSONObject findServiceByUrl(String url)
          Finding a service by its url
 void removeAll()
           
 void removeExpiredEntries()
          Remove expired entries
 void removeService(String endpointID, String messageTime)
          Removing the service by endpoint ID
 org.codehaus.jettison.json.JSONObject updateService(org.codehaus.jettison.json.JSONObject jo)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceAdminManager

public ServiceAdminManager()
Throws:
DatabaseUnavilableException

ServiceAdminManager

public ServiceAdminManager(MongoDBServiceDatabase mongoDB)
Method Detail

addService

public org.codehaus.jettison.json.JSONObject addService(org.codehaus.jettison.json.JSONObject jo)
                                                 throws InvalidServiceDescriptionException,
                                                        org.codehaus.jettison.json.JSONException,
                                                        ExistingResourceException,
                                                        eu.unicore.util.configuration.ConfigurationException,
                                                        ParseException
Parameters:
jo -
Returns:
the inserted service description
Throws:
InvalidServiceDescriptionException
org.codehaus.jettison.json.JSONException
ExistingResourceException
ParseException
eu.unicore.util.configuration.ConfigurationException
Exception

removeService

public void removeService(String endpointID,
                          String messageTime)
                   throws MultipleResourceException,
                          NonExistingResourceException,
                          PersistentStoreFailureException,
                          org.codehaus.jettison.json.JSONException
Removing the service by endpoint ID

Parameters:
url -
messageTime -
Throws:
PersistentStoreFailureException
NonExistingResourceException
MultipleResourceException
org.codehaus.jettison.json.JSONException

updateService

public org.codehaus.jettison.json.JSONObject updateService(org.codehaus.jettison.json.JSONObject jo)
                                                    throws UnknownServiceException,
                                                           InvalidServiceDescriptionException,
                                                           org.codehaus.jettison.json.JSONException,
                                                           javax.ws.rs.WebApplicationException,
                                                           eu.unicore.util.configuration.ConfigurationException,
                                                           ParseException
Parameters:
jo -
Throws:
org.codehaus.jettison.json.JSONException
InvalidServiceDescriptionException
ParseException
eu.unicore.util.configuration.ConfigurationException
NonExistingResourceException
MultipleResourceException
UnknownServiceException
javax.ws.rs.WebApplicationException

findServiceByUrl

public org.codehaus.jettison.json.JSONObject findServiceByUrl(String url)
                                                       throws NonExistingResourceException,
                                                              PersistentStoreFailureException
Finding a service by its url

Parameters:
string -
Throws:
NonExistingResourceException
MultipleResourceException
PersistentStoreFailureException

findServiceByEndpointID

public org.codehaus.jettison.json.JSONObject findServiceByEndpointID(String endpointID)
                                                              throws NonExistingResourceException,
                                                                     PersistentStoreFailureException
Finding a service by endpoint id

Parameters:
string -
Throws:
NonExistingResourceException
MultipleResourceException
PersistentStoreFailureException

removeExpiredEntries

public void removeExpiredEntries()
                          throws org.codehaus.jettison.json.JSONException,
                                 QueryException,
                                 PersistentStoreFailureException
Remove expired entries

Throws:
org.codehaus.jettison.json.JSONException
PersistentStoreFailureException
QueryException

removeAll

public void removeAll()

findAll

public List<ServiceObject> findAll()
                            throws org.codehaus.jettison.json.JSONException
Throws:
org.codehaus.jettison.json.JSONException

checkOwner

public boolean checkOwner(String owner,
                          String sendpointID)
                   throws QueryException,
                          PersistentStoreFailureException,
                          org.codehaus.jettison.json.JSONException
Parameters:
owner -
sendpointID -
Returns:
Throws:
PersistentStoreFailureException
QueryException
org.codehaus.jettison.json.JSONException

checkMessageGenerationTime

public boolean checkMessageGenerationTime(String messageTime,
                                          String sendpointID)
                                   throws QueryException,
                                          PersistentStoreFailureException
Parameters:
messageGenerationTime -
sendpointID -
Returns:
Throws:
PersistentStoreFailureException
QueryException - TODO: What this method is doing? document it!!!


Copyright © 2012. All Rights Reserved.