deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.portal.owswatch
Class ServiceConfiguration

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

public class ServiceConfiguration
extends java.lang.Object
implements java.io.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, java.lang.String serviceName, java.lang.String httpMethod, java.lang.String onlineResource, boolean active, int interval, int timeout, java.util.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  java.lang.String createGETRequest()
           
 java.lang.String createHttpRequest()
          Creates a http request based on the content of the Service.
protected  java.lang.String createPOSTRequest()
           
static int generateServiceId()
           
 java.lang.String getHttpMethod()
           
 org.apache.commons.httpclient.HttpMethodBase getHttpMethodBase()
          Creates an HttpMethodBase on the first call and keeps returning it back
 java.lang.String getOnlineResource()
           
 java.util.Properties getProperties()
           
 int getRefreshRate()
           
 java.lang.String getRequestType()
           
static int getServiceCounter()
           
 int getServiceid()
           
 java.lang.String getServiceName()
           
 java.lang.String getServiceType()
           
 java.lang.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(java.lang.String onlineResource)
           
static void setServiceCounter(int serviceCounter)
           
 void setServiceName(java.lang.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,
                            java.lang.String serviceName,
                            java.lang.String httpMethod,
                            java.lang.String onlineResource,
                            boolean active,
                            int interval,
                            int timeout,
                            java.util.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 java.util.Properties getProperties()
Returns:
Service properties

createHttpRequest

public java.lang.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 java.lang.String createGETRequest()
Returns:
the created GET Request

createPOSTRequest

protected java.lang.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 java.lang.String getHttpMethod()
Returns:
String

getRefreshRate

public int getRefreshRate()
Returns:
the refresh refreshRate

getOnlineResource

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

getRequestType

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

getServiceName

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

getServiceType

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

getServiceVersion

public java.lang.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(java.lang.String onlineResource)
Parameters:
onlineResource - of the service

setServiceName

public void setServiceName(java.lang.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 java.lang.Object

deegree 2.5 (2011/06/29 09:44 build-8-official)

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