org.openptk.spi
Class Service

java.lang.Object
  extended by org.openptk.common.Component
      extended by org.openptk.spi.Service
All Implemented Interfaces:
java.lang.Comparable<org.openptk.common.ComponentIF>, org.openptk.common.ComponentIF, ServiceIF
Direct Known Subclasses:
BasicService, RestartService

public abstract class Service
extends org.openptk.common.Component
implements ServiceIF

Author:
Scott Fehrman, Sun Microsystems, Inc. contributor Derrick Harcey, Sun Microsystems, Inc.

Field Summary
protected static int DEF_TIMEOUT
           
protected  java.lang.String RESPONSE_DESC
           
 
Fields inherited from interface org.openptk.spi.ServiceIF
PROP_URL
 
Fields inherited from interface org.openptk.common.ComponentIF
EXECUTE_BEGIN, EXECUTE_END, PROP_OPENPTK_HOME, PROP_OPENPTK_TEMP, SORT_BEGIN, SORT_END
 
Constructor Summary
Service()
           
 
Method Summary
protected  java.lang.String checkNullPointer(java.lang.String msg)
           
 org.openptk.common.ResponseIF execute(org.openptk.common.RequestIF request)
           
 org.openptk.common.ComponentIF getAssociation(org.openptk.common.Operation operation)
           
 java.util.Map<org.openptk.common.Operation,org.openptk.common.ComponentIF> getAssociations()
           
 org.openptk.common.ComponentIF getAttrGroup(org.openptk.common.Operation operation)
           
 java.util.Map<org.openptk.common.Operation,org.openptk.common.ComponentIF> getAttrGroups()
           
 org.openptk.context.ContextIF getContext()
           
 java.util.Map<java.lang.String,java.lang.String> getFw2SrvcNames(org.openptk.common.Operation operation)
           
 java.lang.String getFwName(org.openptk.common.Operation operation, java.lang.String name)
           
 java.lang.String getKey(org.openptk.common.Operation operation)
           
 OperationsIF getOperation(org.openptk.common.Operation oper)
           
 java.util.Map<org.openptk.common.Operation,OperationsIF> getOperations()
           
 org.openptk.common.ComponentIF getOperAttr(org.openptk.common.Operation operation)
           
 java.util.Properties getOperProps(org.openptk.common.Operation operation)
           
 Query getQuery(org.openptk.common.Operation operation)
           
 java.util.List<java.lang.String> getSortAttributes()
           
 java.util.Map<java.lang.String,java.lang.String> getSrvc2FwNames(org.openptk.common.Operation operation)
           
 java.lang.String getSrvcName(org.openptk.common.Operation operation, java.lang.String name)
           
 int getTimeout(org.openptk.common.Operation operation)
           
protected  void handleError(java.lang.String msg)
           
 boolean hasOperation(org.openptk.common.Operation operation)
           
 boolean hasOperation(java.lang.String operStr)
           
 void setAssociation(org.openptk.common.Operation operation, org.openptk.common.ComponentIF comp)
           
 void setAttrGroup(org.openptk.common.Operation operation, org.openptk.common.ComponentIF comp)
           
 void setContext(org.openptk.context.ContextIF context)
           
 void setFw2SrvcNames(org.openptk.common.Operation operation, java.util.Map<java.lang.String,java.lang.String> map)
           
 void setKey(org.openptk.common.Operation operation, java.lang.String key)
           
 void setOperation(org.openptk.common.Operation oper, OperationsIF operation)
           
 void setOperAttr(org.openptk.common.Operation operation, org.openptk.common.ComponentIF comp)
           
 void setOperProps(org.openptk.common.Operation operation, java.util.Properties props)
           
 void setQuery(org.openptk.common.Operation operation, Query query)
           
 void setSortAttributes(java.util.List<java.lang.String> sortAttrs)
           
 void setSrvc2FwNames(org.openptk.common.Operation operation, java.util.Map<java.lang.String,java.lang.String> map)
           
 void setTimeout(org.openptk.common.Operation operation, int msec)
           
 void shutdown()
           
 void startup()
           
protected  void throwServiceException(java.lang.String msg)
           
protected  void throwServiceException(java.lang.Throwable ex)
           
 java.lang.String[] toFw(org.openptk.common.Operation operation, java.lang.String[] srvc)
           
 java.lang.String[] toSrvc(org.openptk.common.Operation operation, java.lang.String[] fw)
           
protected  boolean validateRequest(org.openptk.common.RequestIF request, org.openptk.common.ResponseIF response)
           
 
Methods inherited from class org.openptk.common.Component
compareTo, copy, getAttribute, getAttributes, getAttributesNames, getAttributesSize, getCategory, getCategoryAsString, getDebugLevel, getDebugLevelAsInt, getDebugLevelAsString, getDescription, getProperties, getPropertiesSize, getProperty, getSortValue, getState, getStateAsString, getStatus, getTimeStamp, getTimeStampNames, getTimeStamps, getUniqueId, getUniqueIdType, isDebug, isError, isTimeStamp, setAttribute, setAttributes, setCategory, setDebug, setDebugLevel, setDescription, setError, setProperties, setProperty, setSortValue, setState, setState, setStatus, setTimeStamp, setTimeStamp, setUniqueId, setUniqueId, setUniqueId, setUniqueId, toString, useTimeStamp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openptk.common.ComponentIF
copy, getAttribute, getAttributes, getAttributesNames, getAttributesSize, getCategory, getCategoryAsString, getDebugLevel, getDebugLevelAsInt, getDebugLevelAsString, getDescription, getProperties, getPropertiesSize, getProperty, getSortValue, getState, getStateAsString, getStatus, getTimeStamp, getTimeStampNames, getTimeStamps, getUniqueId, getUniqueIdType, isDebug, isError, isTimeStamp, setAttribute, setAttributes, setCategory, setDebug, setDebugLevel, setDescription, setError, setProperties, setProperty, setSortValue, setState, setState, setStatus, setTimeStamp, setTimeStamp, setUniqueId, setUniqueId, setUniqueId, setUniqueId, useTimeStamp
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

DEF_TIMEOUT

protected static final int DEF_TIMEOUT
See Also:
Constant Field Values

RESPONSE_DESC

protected java.lang.String RESPONSE_DESC
Constructor Detail

Service

public Service()
Method Detail

checkNullPointer

protected java.lang.String checkNullPointer(java.lang.String msg)

execute

public org.openptk.common.ResponseIF execute(org.openptk.common.RequestIF request)
                                      throws ServiceException
Specified by:
execute in interface ServiceIF
Parameters:
request -
Returns:
ResponseIF
Throws:
ServiceException

getAssociation

public final org.openptk.common.ComponentIF getAssociation(org.openptk.common.Operation operation)
Specified by:
getAssociation in interface ServiceIF
Parameters:
operation -
Returns:
ComponentIF

getAssociations

public final java.util.Map<org.openptk.common.Operation,org.openptk.common.ComponentIF> getAssociations()
Returns:
Map

getAttrGroup

public final org.openptk.common.ComponentIF getAttrGroup(org.openptk.common.Operation operation)
Specified by:
getAttrGroup in interface ServiceIF
Parameters:
operation -
Returns:
ComponentIF

getAttrGroups

public final java.util.Map<org.openptk.common.Operation,org.openptk.common.ComponentIF> getAttrGroups()
Returns:
Map

getContext

public final org.openptk.context.ContextIF getContext()
Specified by:
getContext in interface ServiceIF
Returns:
ContextIF

getFw2SrvcNames

public final java.util.Map<java.lang.String,java.lang.String> getFw2SrvcNames(org.openptk.common.Operation operation)
Specified by:
getFw2SrvcNames in interface ServiceIF
Parameters:
operation -
Returns:
Map

getFwName

public final java.lang.String getFwName(org.openptk.common.Operation operation,
                                        java.lang.String name)
Specified by:
getFwName in interface ServiceIF
Parameters:
operation -
name -
Returns:
String

getKey

public final java.lang.String getKey(org.openptk.common.Operation operation)
Specified by:
getKey in interface ServiceIF
Parameters:
operation -
Returns:
String

getOperation

public final OperationsIF getOperation(org.openptk.common.Operation oper)
Specified by:
getOperation in interface ServiceIF
Parameters:
oper -
Returns:
OperationsIF

getOperations

public final java.util.Map<org.openptk.common.Operation,OperationsIF> getOperations()
Specified by:
getOperations in interface ServiceIF
Returns:
Map

getOperAttr

public final org.openptk.common.ComponentIF getOperAttr(org.openptk.common.Operation operation)
Specified by:
getOperAttr in interface ServiceIF
Parameters:
operation -
Returns:
ComponentIF

getOperProps

public final java.util.Properties getOperProps(org.openptk.common.Operation operation)
Specified by:
getOperProps in interface ServiceIF
Parameters:
operation -
Returns:
Properties

getQuery

public final Query getQuery(org.openptk.common.Operation operation)
Specified by:
getQuery in interface ServiceIF
Parameters:
operation -
Returns:
Query

getSortAttributes

public final java.util.List<java.lang.String> getSortAttributes()
Specified by:
getSortAttributes in interface ServiceIF
Returns:
List

getSrvc2FwNames

public final java.util.Map<java.lang.String,java.lang.String> getSrvc2FwNames(org.openptk.common.Operation operation)
Specified by:
getSrvc2FwNames in interface ServiceIF
Parameters:
operation -
Returns:
Map

getSrvcName

public final java.lang.String getSrvcName(org.openptk.common.Operation operation,
                                          java.lang.String name)
Specified by:
getSrvcName in interface ServiceIF
Parameters:
operation -
name -
Returns:
String

getTimeout

public final int getTimeout(org.openptk.common.Operation operation)
Specified by:
getTimeout in interface ServiceIF
Parameters:
operation -
Returns:
int

handleError

protected void handleError(java.lang.String msg)
                    throws ServiceException
Throws:
ServiceException

hasOperation

public final boolean hasOperation(org.openptk.common.Operation operation)
Specified by:
hasOperation in interface ServiceIF
Parameters:
operation -
Returns:
boolean

hasOperation

public final boolean hasOperation(java.lang.String operStr)
Specified by:
hasOperation in interface ServiceIF
Parameters:
operStr -
Returns:
boolean

setAssociation

public final void setAssociation(org.openptk.common.Operation operation,
                                 org.openptk.common.ComponentIF comp)
Specified by:
setAssociation in interface ServiceIF
Parameters:
operation -
comp -

setAttrGroup

public final void setAttrGroup(org.openptk.common.Operation operation,
                               org.openptk.common.ComponentIF comp)
Specified by:
setAttrGroup in interface ServiceIF
Parameters:
operation -
comp -

setContext

public final void setContext(org.openptk.context.ContextIF context)
Specified by:
setContext in interface ServiceIF
Parameters:
context -

setFw2SrvcNames

public final void setFw2SrvcNames(org.openptk.common.Operation operation,
                                  java.util.Map<java.lang.String,java.lang.String> map)
Specified by:
setFw2SrvcNames in interface ServiceIF
Parameters:
operation -
map -

setKey

public final void setKey(org.openptk.common.Operation operation,
                         java.lang.String key)
Specified by:
setKey in interface ServiceIF
Parameters:
operation -
key -

setOperation

public final void setOperation(org.openptk.common.Operation oper,
                               OperationsIF operation)
Specified by:
setOperation in interface ServiceIF
Parameters:
oper -
operation -

setOperAttr

public final void setOperAttr(org.openptk.common.Operation operation,
                              org.openptk.common.ComponentIF comp)
Specified by:
setOperAttr in interface ServiceIF
Parameters:
operation -
comp -

setOperProps

public final void setOperProps(org.openptk.common.Operation operation,
                               java.util.Properties props)
Specified by:
setOperProps in interface ServiceIF
Parameters:
operation -
props -

setQuery

public final void setQuery(org.openptk.common.Operation operation,
                           Query query)
Specified by:
setQuery in interface ServiceIF
Parameters:
operation -
query -

setSortAttributes

public final void setSortAttributes(java.util.List<java.lang.String> sortAttrs)
Specified by:
setSortAttributes in interface ServiceIF
Parameters:
sortAttrs -

setSrvc2FwNames

public final void setSrvc2FwNames(org.openptk.common.Operation operation,
                                  java.util.Map<java.lang.String,java.lang.String> map)
Specified by:
setSrvc2FwNames in interface ServiceIF
Parameters:
operation -
map -

setTimeout

public final void setTimeout(org.openptk.common.Operation operation,
                             int msec)
Specified by:
setTimeout in interface ServiceIF
Parameters:
operation -
msec -

shutdown

public void shutdown()
Specified by:
shutdown in interface ServiceIF

startup

public void startup()
Specified by:
startup in interface ServiceIF

throwServiceException

protected final void throwServiceException(java.lang.String msg)
                                    throws ServiceException
Parameters:
msg -
Throws:
ServiceException

throwServiceException

protected final void throwServiceException(java.lang.Throwable ex)
                                    throws ServiceException
Parameters:
ex -
Throws:
ServiceException

toFw

public final java.lang.String[] toFw(org.openptk.common.Operation operation,
                                     java.lang.String[] srvc)
Specified by:
toFw in interface ServiceIF
Parameters:
operation -
srvc -
Returns:
String[]

toSrvc

public final java.lang.String[] toSrvc(org.openptk.common.Operation operation,
                                       java.lang.String[] fw)
Specified by:
toSrvc in interface ServiceIF
Parameters:
operation -
fw -
Returns:
String[]

validateRequest

protected boolean validateRequest(org.openptk.common.RequestIF request,
                                  org.openptk.common.ResponseIF response)


View/submit a bug or feature

For further API reference and developer documentation, see www.openptk.org. That documentation contains more detailed, developer-targeted descriptions, definitions of terms, workarounds, and working code examples.

Copyright (C) 2008-2012, Project OpenPTK. All Rights Reserved