1.0.0

org.eclipse.soda.dk.device.configuration.servlet
Class DeviceConfigurationServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.eclipse.soda.dk.device.servlet.DeviceServlet
              extended by org.eclipse.soda.dk.device.configuration.servlet.DeviceConfigurationServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, DeviceServletService

public class DeviceConfigurationServlet
extends DeviceServlet
implements DeviceServletService, javax.servlet.Servlet

Version:
1.0.0
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.eclipse.soda.dk.device.servlet.service.DeviceServletService
SERVICE_NAME
 
Constructor Summary
DeviceConfigurationServlet()
          Constructs an instance of this class.
 
Method Summary
 boolean changeConfiguration(java.util.Hashtable table, java.util.Hashtable oldTable)
          Change configuration with the specified table parameter and return the boolean result.
static java.lang.Object CheckType(java.lang.Object ConvertedValue, int card, int type)
           
 DeviceServletContext createContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Create context with the specified request and response parameters and return the DeviceServletContext result.
protected  void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Do post with the specified request and response parameters.
 int getColorValue()
          Gets the color value (int) value.
 org.osgi.service.cm.ConfigurationAdmin getConfigurationAdmin()
          Gets the configuration admin value.
 java.util.Hashtable getConfigurationAttributes(org.osgi.service.metatype.AttributeDefinition[] attributeDefinitions)
          Get configuration attributes with the specified attribute definitions parameter and return the Hashtable result.
 org.osgi.service.metatype.MetaTypeService getMetaTypeService()
          Gets the meta type service value.
 void processConfigurationAdmin(DeviceConfigurationServletContext context, java.util.Map factoryMetadata)
          Process configuration admin with the specified writer parameter.
 org.osgi.service.metatype.AttributeDefinition processConfigurationAttributes(DeviceServletContext context, java.util.Dictionary properties, org.osgi.service.metatype.AttributeDefinition[] attributeDefinitions, boolean required)
          Process configuration attributes with the specified writer, properties, attribute definitions and required parameters.
 void processRequest(DeviceServletContext context)
          Process request with the specified context parameter.
 void resetColorValue()
          Reset color value.
 void setColorValue(int colorValue)
          Sets the color value value.
 void setConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin configurationAdmin)
          Sets the configuration admin value.
 void setMetaTypeService(org.osgi.service.metatype.MetaTypeService metaTypeService)
          Sets the meta type service value.
static java.lang.String[] SplitString(java.lang.String s, java.lang.String delimiter, int length)
           
static byte[] SplitStringtobyteArray(java.lang.String[] SplitString, int length)
           
 void updateColorValue()
          Update color value.
 java.util.Hashtable validateConfiguration(DeviceServletContext context, java.util.Hashtable table)
          Validate configuration with the specified writer and table parameters and return the Hashtable result.
 
Methods inherited from class org.eclipse.soda.dk.device.servlet.DeviceServlet
buildMenu, doGet, escape, escape, findAttribute, getBundleContext, getBundles, getResouceAliasDefault, getResoucePathDefault, getResourceAlias, getResourcePath, getServer, getServiceReferences, getServletAlias, getServletAliasDefault, processFileRequest, processOverview, setBundleContext, setResourceAlias, setResourcePath, setServer, setServletAlias, setup
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.soda.dk.device.servlet.service.DeviceServletService
getServletAlias
 
Methods inherited from interface javax.servlet.Servlet
destroy, getServletConfig, getServletInfo, init, service
 

Constructor Detail

DeviceConfigurationServlet

public DeviceConfigurationServlet()
Constructs an instance of this class.

Method Detail

changeConfiguration

public boolean changeConfiguration(java.util.Hashtable table,
                                   java.util.Hashtable oldTable)
Change configuration with the specified table parameter and return the boolean result.

Parameters:
table - The table (Hashtable) parameter.
oldTable - The old table (Hashtable) parameter.
Returns:
Results of the change configuration (boolean) value.
See Also:
validateConfiguration(DeviceServletContext,Hashtable)

createContext

public DeviceServletContext createContext(javax.servlet.http.HttpServletRequest request,
                                          javax.servlet.http.HttpServletResponse response)
Create context with the specified request and response parameters and return the DeviceServletContext result.

Overrides:
createContext in class DeviceServlet
Parameters:
request - The request (HttpServletRequest) parameter.
response - The response (HttpServletResponse) parameter.
Returns:
Results of the create context (DeviceServletContext) value.
See Also:
DeviceServlet.getBundleContext(), DeviceServlet.setBundleContext(BundleContext)

doPost

protected void doPost(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws javax.servlet.ServletException,
                      java.io.IOException
Do post with the specified request and response parameters.

Overrides:
doPost in class DeviceServlet
Parameters:
request - The request (HttpServletRequest) parameter.
response - The response (HttpServletResponse) parameter.
Throws:
javax.servlet.ServletException - Servlet Exception.
java.io.IOException

getColorValue

public int getColorValue()
Gets the color value (int) value.

Returns:
The color value (int) value.
See Also:
resetColorValue(), setColorValue(int), updateColorValue()

getConfigurationAdmin

public org.osgi.service.cm.ConfigurationAdmin getConfigurationAdmin()
Gets the configuration admin value.

Returns:
The configuration admin (ConfigurationAdmin) value.
See Also:
processConfigurationAdmin(DeviceConfigurationServletContext,Map), setConfigurationAdmin(ConfigurationAdmin)

getConfigurationAttributes

public java.util.Hashtable getConfigurationAttributes(org.osgi.service.metatype.AttributeDefinition[] attributeDefinitions)
Get configuration attributes with the specified attribute definitions parameter and return the Hashtable result.

Parameters:
attributeDefinitions - The attribute definitions (AttributeDefinition[]) parameter.
Returns:
Results of the get configuration attributes (Hashtable) value.
See Also:
processConfigurationAttributes(DeviceServletContext,Dictionary,AttributeDefinition[],boolean)

getMetaTypeService

public org.osgi.service.metatype.MetaTypeService getMetaTypeService()
Gets the meta type service value.

Returns:
The meta type service (MetaTypeService) value.
See Also:
setMetaTypeService(MetaTypeService)

processConfigurationAdmin

public void processConfigurationAdmin(DeviceConfigurationServletContext context,
                                      java.util.Map factoryMetadata)
Process configuration admin with the specified writer parameter.

Parameters:
writer - The writer (PrintWriter) parameter.
factoryMetadata - The factory metadata (Map) parameter.
context - The context (DeviceServletContext) parameter.
See Also:
getConfigurationAdmin(), setConfigurationAdmin(ConfigurationAdmin)

processConfigurationAttributes

public org.osgi.service.metatype.AttributeDefinition processConfigurationAttributes(DeviceServletContext context,
                                                                                    java.util.Dictionary properties,
                                                                                    org.osgi.service.metatype.AttributeDefinition[] attributeDefinitions,
                                                                                    boolean required)
Process configuration attributes with the specified writer, properties, attribute definitions and required parameters.

Parameters:
writer - The writer (PrintWriter) parameter.
properties - The properties (Dictionary) parameter.
attributeDefinitions - The attribute definitions (AttributeDefinition[]) parameter.
required - The required (boolean) parameter.
context - The context (DeviceServletContext) parameter.
Returns:
Results of the process configuration attributes (AttributeDefinition) value.
See Also:
getConfigurationAttributes(AttributeDefinition[])

processRequest

public void processRequest(DeviceServletContext context)
Process request with the specified context parameter.

Overrides:
processRequest in class DeviceServlet
Parameters:
context - The context (DeviceServletContext) parameter.
See Also:
DeviceServlet.processFileRequest(DeviceServletContext)

resetColorValue

public void resetColorValue()
Reset color value.

See Also:
getColorValue(), setColorValue(int), updateColorValue()

setColorValue

public void setColorValue(int colorValue)
Sets the color value value.

Parameters:
colorValue - The color value (int) parameter.
See Also:
getColorValue(), resetColorValue(), updateColorValue()

setConfigurationAdmin

public void setConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin configurationAdmin)
Sets the configuration admin value.

Parameters:
configurationAdmin - The configuration admin (ConfigurationAdmin) parameter.
See Also:
getConfigurationAdmin(), processConfigurationAdmin(DeviceConfigurationServletContext,Map)

setMetaTypeService

public void setMetaTypeService(org.osgi.service.metatype.MetaTypeService metaTypeService)
Sets the meta type service value.

Parameters:
metaTypeService - The meta type service (MetaTypeService) parameter.
See Also:
getMetaTypeService()

updateColorValue

public void updateColorValue()
Update color value.

See Also:
getColorValue(), resetColorValue(), setColorValue(int)

validateConfiguration

public java.util.Hashtable validateConfiguration(DeviceServletContext context,
                                                 java.util.Hashtable table)
Validate configuration with the specified writer and table parameters and return the Hashtable result.

Parameters:
writer - The writer (PrintWriter) parameter.
table - The table (Hashtable) parameter.
context - The context (DeviceServletContext) parameter.
Returns:
Results of the validate configuration (Hashtable) value.
See Also:
changeConfiguration(Hashtable,Hashtable)

SplitString

public static java.lang.String[] SplitString(java.lang.String s,
                                             java.lang.String delimiter,
                                             int length)
                                      throws java.lang.NumberFormatException
Throws:
java.lang.NumberFormatException

SplitStringtobyteArray

public static byte[] SplitStringtobyteArray(java.lang.String[] SplitString,
                                            int length)
                                     throws java.lang.NumberFormatException
Throws:
java.lang.NumberFormatException

CheckType

public static java.lang.Object CheckType(java.lang.Object ConvertedValue,
                                         int card,
                                         int type)
                                  throws java.lang.NumberFormatException
Throws:
java.lang.NumberFormatException

1.0.0

Copyright (c) 1999, 2007 IBM