2009-01-09 1.2.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

Since:
1.0
Version:
1.2.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 and old table parameters and return the boolean result.
static java.lang.Object CheckType(java.lang.Object ConvertedValue, int card, int type)
          Check type with the specified converted value, card and type parameters and return the Object result.
 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 context and factory meta data parameters.
 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 context, properties, attribute definitions and required parameters and return the AttributeDefinition result.
 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)
          Split string with the specified s, delimiter and length parameters and return the String[] result.
static byte[] SplitStringtobyteArray(java.lang.String[] SplitString, int length)
          Split stringtobyte array with the specified split string and length parameters and return the byte[] result.
 void updateColorValue()
          Update color value.
 java.util.Hashtable validateConfiguration(DeviceServletContext context, java.util.Hashtable table)
          Validate configuration with the specified context 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

CheckType

public static java.lang.Object CheckType(java.lang.Object ConvertedValue,
                                         int card,
                                         int type)
                                  throws java.lang.NumberFormatException
Check type with the specified converted value, card and type parameters and return the Object result.

Parameters:
ConvertedValue - The converted value (Object) parameter.
card - The card (int) parameter.
type - The type (int) parameter.
Returns:
Results of the check type (Object) value.
Throws:
java.lang.NumberFormatException - Number Format Exception.

SplitString

public static java.lang.String[] SplitString(java.lang.String s,
                                             java.lang.String delimiter,
                                             int length)
                                      throws java.lang.NumberFormatException
Split string with the specified s, delimiter and length parameters and return the String[] result.

Parameters:
s - The s (String) parameter.
delimiter - The delimiter (String) parameter.
length - The length (int) parameter.
Returns:
Results of the split string (String[]) value.
Throws:
java.lang.NumberFormatException - Number Format Exception.

SplitStringtobyteArray

public static byte[] SplitStringtobyteArray(java.lang.String[] SplitString,
                                            int length)
                                     throws java.lang.NumberFormatException
Split stringtobyte array with the specified split string and length parameters and return the byte[] result.

Parameters:
SplitString - The split string (String[]) parameter.
length - The length (int) parameter.
Returns:
Results of the split stringtobyte array (byte[]) value.
Throws:
java.lang.NumberFormatException - Number Format Exception.

changeConfiguration

public boolean changeConfiguration(java.util.Hashtable table,
                                   java.util.Hashtable oldTable)
Change configuration with the specified table and old table parameters 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. The old table (Hashtable) parameter.
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. The request (HttpServletRequest) parameter. The response (HttpServletResponse) parameter. Servlet Exception.

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 - 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 context and factory meta data parameters.

Parameters:
context - The context (DeviceConfigurationServletContext) parameter.
factoryMetadata - The factory meta data (Map) 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 context, properties, attribute definitions and required parameters and return the AttributeDefinition result.

Parameters:
context - The context (DeviceServletContext) parameter.
properties - The properties (Dictionary) parameter.
attributeDefinitions - The attribute definitions (AttributeDefinition[]) parameter.
required - The required (boolean) 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 context and table parameters and return the Hashtable result.

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

2009-01-09 1.2.0

Copyright (c) 2009 IBM. See license in Legal section.