deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.portal.owswatch
Class ServiceConfiguration

java.lang.Object
  extended by org.deegree.portal.owswatch.ServiceConfiguration
All Implemented Interfaces:
Serializable

public class ServiceConfiguration
extends Object
implements Serializable

A data class to hold the information about a certain test. Like test name , type, etc..

Version:
$Revision: 20271 $, $Date: 2009-10-21 13:07:15 +0200 (Mi, 21. Okt 2009) $
Author:
Moataz Elmasry, last edited by: $Author: jmays $
See Also:
Serialized Form

Constructor Summary
ServiceConfiguration(int serviceId, String serviceName, String httpMethod, String onlineResource, boolean active, int interval, int timeout, Properties requestParams)
          This constructor is used by both ServicesConfigurationFactory and to build requests from the jsp page ,when adding/changing a service.
 
Method Summary
protected  String createGETRequest()
           
 String createHttpRequest()
          Creates a http request based on the content of the Service.
protected  String createPOSTRequest()
           
static int generateServiceId()
           
 String getHttpMethod()
           
 org.apache.commons.httpclient.HttpMethodBase getHttpMethodBase()
          Creates an HttpMethodBase on the first call and keeps returning it back
 String getOnlineResource()
           
 Properties getProperties()
           
 int getRefreshRate()
           
 String getRequestType()
           
static int getServiceCounter()
           
 int getServiceid()
           
 String getServiceName()
           
 String getServiceType()
           
 String getServiceVersion()
           
 int getTimeout()
           
 Validator getValidator()
          Generically creates an instance of the needed Validator using reflection
 int hashCode()
           
 boolean isActive()
           
 void setActive(boolean active)
           
 void setOnlineResource(String onlineResource)
           
static void setServiceCounter(int serviceCounter)
           
 void setServiceName(String serviceName)
           
 void setTimeout(int timeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceConfiguration

public ServiceConfiguration(int serviceId,
                            String serviceName,
                            String httpMethod,
                            String onlineResource,
                            boolean active,
                            int interval,
                            int timeout,
                            Properties requestParams)
                     throws ConfigurationsException
This constructor is used by both ServicesConfigurationFactory and to build requests from the jsp page ,when adding/changing a service.

Parameters:
serviceId - -1 to assign a new id to this service
serviceName -
httpMethod -
onlineResource -
active -
interval -
timeout -
requestParams - Contains the kvp request parameter, it must at least the following keys include VERSION, SERVICE, REQUEST
Throws:
ConfigurationsException - if any of the mandatory parameters is null
Method Detail

getProperties

public Properties getProperties()
Returns:
Service properties

createHttpRequest

public String createHttpRequest()
Creates a http request based on the content of the Service. These contens also include whether its POST or GET method

Returns:
the request String

createGETRequest

protected String createGETRequest()
Returns:
the created GET Request

createPOSTRequest

protected String createPOSTRequest()
Returns:
stored XML POST fragment

generateServiceId

public static int generateServiceId()
Returns:
int

getServiceid

public int getServiceid()
Returns:
int

isActive

public boolean isActive()
Returns:
boolean

setActive

public void setActive(boolean active)
Parameters:
active -

getHttpMethod

public String getHttpMethod()
Returns:
String

getRefreshRate

public int getRefreshRate()
Returns:
the refresh refreshRate

getOnlineResource

public String getOnlineResource()
Returns:
the server address to which the requests will be sent

getRequestType

public String getRequestType()
Returns:
ex. Getcapabilities, GetFeature, etc..

getServiceName

public String getServiceName()
Returns:
the given name during adding a new test

getServiceType

public String getServiceType()
Returns:
ex WMS, WFS, etc..

getServiceVersion

public String getServiceVersion()
Returns:
String

getTimeout

public int getTimeout()
Returns:
Timeout of the requests

getServiceCounter

public static int getServiceCounter()
Returns:
counter is assigned to the newly created service

setServiceCounter

public static void setServiceCounter(int serviceCounter)
Parameters:
serviceCounter - Sets the service counter. It should be used solely by the class ServiceWatcher

setOnlineResource

public void setOnlineResource(String onlineResource)
Parameters:
onlineResource - of the service

setServiceName

public void setServiceName(String serviceName)
Parameters:
serviceName -

setTimeout

public void setTimeout(int timeout)
Parameters:
timeout - in milliseconds

getHttpMethodBase

public org.apache.commons.httpclient.HttpMethodBase getHttpMethodBase()
                                                               throws OGCWebServiceException
Creates an HttpMethodBase on the first call and keeps returning it back

Returns:
HttpMethodBase
Throws:
OGCWebServiceException - If no Httpmethod could be initialized as POST

getValidator

public Validator getValidator()
                       throws ConfigurationsException
Generically creates an instance of the needed Validator using reflection

Returns:
Validator
Throws:
ConfigurationsException

hashCode

public int hashCode()
Overrides:
hashCode in class Object

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org