restart.server
Class Service

java.lang.Object
  extended by restart.server.Service
Direct Known Subclasses:
XMLService

public class Service
extends java.lang.Object

Author:
Thibault Ducray

Constructor Summary
Service(Method authorizedMethod, java.lang.String name)
          Construct the Service with the default policy, the callback should be defined later
Service(Method authorizedMethod, java.lang.String name, Callback cb)
          Construct the Service with the default policy and the given callback
Service(Method authorizedMethod, java.lang.String name, Callback cb, ServicePolicy policy)
          Construct the Service with the given callback and the given policy
Service(Method authorizedMethod, java.lang.String name, ServicePolicy policy)
          Construct the Service with the given policy, the callback should be defined later
 
Method Summary
 boolean authorizeMethod(java.lang.String method)
           
 Method getAuthorizedMethod()
           
 java.lang.String getName()
          Get the name (relative URL) of the service
 ServicePolicy getServicePolicy()
          Get the policy.
 ServiceOutput invoke(ServiceInput data)
          Don't call this method yourself : it's being called by the server thread
 void setAuthorizedMethod(Method authMethod)
           
 void setCallback(Callback cb)
          Set the callback of the service (the callback is called when the service is invoked)
 void setName(java.lang.String name)
          Set the name (relative URL) of the service
 void setServicePolicy(ServicePolicy policy)
          Set the policy.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Service

public Service(Method authorizedMethod,
               java.lang.String name)
Construct the Service with the default policy, the callback should be defined later


Service

public Service(Method authorizedMethod,
               java.lang.String name,
               ServicePolicy policy)
Construct the Service with the given policy, the callback should be defined later


Service

public Service(Method authorizedMethod,
               java.lang.String name,
               Callback cb)
Construct the Service with the default policy and the given callback


Service

public Service(Method authorizedMethod,
               java.lang.String name,
               Callback cb,
               ServicePolicy policy)
Construct the Service with the given callback and the given policy

Method Detail

setName

public void setName(java.lang.String name)
Set the name (relative URL) of the service

Parameters:
name - the name (relative URL) of the service

getName

public java.lang.String getName()
Get the name (relative URL) of the service

Returns:
the name (relative URL) of the service

setServicePolicy

public void setServicePolicy(ServicePolicy policy)
Set the policy.


getServicePolicy

public ServicePolicy getServicePolicy()
Get the policy.


setCallback

public void setCallback(Callback cb)
Set the callback of the service (the callback is called when the service is invoked)

Parameters:
cb -

invoke

public ServiceOutput invoke(ServiceInput data)
                     throws RestException
Don't call this method yourself : it's being called by the server thread

Throws:
RestException

getAuthorizedMethod

public Method getAuthorizedMethod()

setAuthorizedMethod

public void setAuthorizedMethod(Method authMethod)

authorizeMethod

public boolean authorizeMethod(java.lang.String method)