org.apache.wsrp4j.util
Class ParameterChecker

java.lang.Object
  extended byorg.apache.wsrp4j.util.ParameterChecker

public class ParameterChecker
extends java.lang.Object

This class validates the objects and their attributes used for the WSRP communication requests. The object and attribute tree is scanned including the 2nd level. This means, that the input object, it's attributes and ,if the attribute is itself an object, the subsequent object and It's attributes are also checked. The checking is done only for required (R) parameters in the WSRP specification. Optional (O) parameters are ignored. If a parameter is specified as 'nillable' in the WSRP specification, the check is performed if the value is 'not null'. On null value, no checking is done.

Version:
$Id: ParameterChecker.java,v 1.12 2005/08/12 12:56:53 cziegeler Exp $

Field Summary
private  Logger logger
           
 
Constructor Summary
ParameterChecker()
           
 
Method Summary
 void check(oasis.names.tc.wsrp.v1.types.BlockingInteractionResponse response)
          Parameter check for the BlockingInteractionResponse object.
 void check(oasis.names.tc.wsrp.v1.types.ClonePortlet request)
          Parameter check for the ClonePortlet object.
private  void check(oasis.names.tc.wsrp.v1.types.CookieProtocol requiresInit, boolean nillable)
          Validates the CookieProtocol object
private  void check(oasis.names.tc.wsrp.v1.types.DestroyFailed[] destroyFailedArray, boolean nillable)
          Validates the DestroyFailed Array.
 void check(oasis.names.tc.wsrp.v1.types.DestroyPortlets request)
          Parameter check for the DestroyEntites object.
 void check(oasis.names.tc.wsrp.v1.types.DestroyPortletsResponse response)
          Validates the DestroyPortletsResponse object 1) DestroyFailed[], only if available
 void check(oasis.names.tc.wsrp.v1.types.GetMarkup request)
          Check the GetMarkup.
 void check(oasis.names.tc.wsrp.v1.types.GetPortletDescription request)
          Parameter check for the GetPortletDescription object.
 void check(oasis.names.tc.wsrp.v1.types.GetPortletProperties request)
          Parameter check for the SetPortletProperties object.
 void check(oasis.names.tc.wsrp.v1.types.GetPortletPropertyDescription request)
          Parameter check for the SetPortletProperties object.
 void check(oasis.names.tc.wsrp.v1.types.GetServiceDescription request)
          Check the GetServiceDescritpion.
 void check(oasis.names.tc.wsrp.v1.types.InitCookie request)
          Check the InitCookie.
private  void check(oasis.names.tc.wsrp.v1.types.InteractionParams interactionParams, boolean nillable)
          Check the InteractionParams.
private  void check(oasis.names.tc.wsrp.v1.types.MarkupContext context, boolean nillable)
          Parameter check for the MarkupContext object.
private  void check(oasis.names.tc.wsrp.v1.types.MarkupParams markupParams, boolean nillable)
          Check the MarkupParams.
 void check(oasis.names.tc.wsrp.v1.types.MarkupResponse response)
          Parameter check for the MarkupResponse object.
 void check(oasis.names.tc.wsrp.v1.types.ModifyRegistration request)
          Check the ModifyRegistration.
 void check(oasis.names.tc.wsrp.v1.types.PerformBlockingInteraction request)
          Check the PerformBlockingInteraction.
 void check(oasis.names.tc.wsrp.v1.types.PortletContext portletContext, boolean nillable)
          Check the PortletContext.
 void check(oasis.names.tc.wsrp.v1.types.PortletDescription element)
          Parameter check for the PortletDescription object.
 void check(oasis.names.tc.wsrp.v1.types.PortletDescriptionResponse response)
          Validates the PortletDescriptionResponse object 1) PortletDescription 2) ResourceList, only if available
 void check(oasis.names.tc.wsrp.v1.types.PortletPropertyDescriptionResponse response)
          Validates the PortletPropertyDescriptionResponse object 1) ResourceList
 void check(oasis.names.tc.wsrp.v1.types.PropertyList propertyList, boolean nillable)
          Check the PropertyList.
 void check(oasis.names.tc.wsrp.v1.types.RegistrationContext registrationContext, boolean nillable)
          Check the RegistrationContext.
 void check(oasis.names.tc.wsrp.v1.types.RegistrationData registrationData, boolean nillable)
          Check the RegistrationData.
 void check(oasis.names.tc.wsrp.v1.types.ReleaseSessions request)
          Parameter check for the ReleaseSession object.
private  void check(oasis.names.tc.wsrp.v1.types.ResourceList resourceList, boolean nillable)
          Validates the ResourceList object for available resources.
private  void check(oasis.names.tc.wsrp.v1.types.RuntimeContext runtimeContext, boolean nillable)
          Check the RuntimeContext.
 void check(oasis.names.tc.wsrp.v1.types.ServiceDescription response)
          Parameter check for the ServiceDescription object.
private  void check(oasis.names.tc.wsrp.v1.types.SessionContext context, boolean nillable)
          Parameter check for the SessionContext object.
 void check(oasis.names.tc.wsrp.v1.types.SetPortletProperties request)
          Parameter check for the SetPortletProperties object.
private  void check(java.lang.String[] array, boolean nillable)
          Check a string array.
 void check(oasis.names.tc.wsrp.v1.types.Templates element)
          Parameter check for the PortletDescription object.
private  void check(oasis.names.tc.wsrp.v1.types.UpdateResponse response)
          Parameter check for the UpdateResponse object.
private  void check(oasis.names.tc.wsrp.v1.types.UserContext userContext, boolean nillable)
          Check the UserContext.
private  boolean isCheckEnabled()
           
private  void throwMissingParametersFault(java.lang.String msg)
          Creates and throws a MissingParametersFault exception
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private Logger logger
Constructor Detail

ParameterChecker

public ParameterChecker()
Method Detail

isCheckEnabled

private boolean isCheckEnabled()
Returns:
true if we check

check

public void check(oasis.names.tc.wsrp.v1.types.GetServiceDescription request)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Check the GetServiceDescritpion. The following attributes are mandatory: 1) RegistrationContext, only if available 2) String[] DesiredLocales, only if SendAllLocales == false

Parameters:
request - GetServiceDescription
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
GetServiceDescription

check

public void check(oasis.names.tc.wsrp.v1.types.ModifyRegistration request)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Check the ModifyRegistration. The following attributes are mandatory: 1) RegistrationContext, only if available 2) RegistrationData

Parameters:
request - ModifyRegistration
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
ModifyRegistration

check

public void check(oasis.names.tc.wsrp.v1.types.GetMarkup request)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Check the GetMarkup. The following attributes are mandatory: 1) RegistrationContext, only if available 2) PortletContext 3) RuntimeContext 4) UserContext, only if available 5) MarkupParams

Parameters:
request - getMarkup
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
GetMarkup

check

public void check(oasis.names.tc.wsrp.v1.types.PerformBlockingInteraction request)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Check the PerformBlockingInteraction. The following attributes are mandatory: 1) RegistrationContext, only if available 2) PortletContext 3) RuntimeContext 4) UserContext, only if available 5) MarkupParams 6) InteractionParams

Parameters:
request - PerformBlockingInteraction
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
PerformBlockingInteraction

check

public void check(oasis.names.tc.wsrp.v1.types.InitCookie request)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Check the InitCookie. The following attributes are mandatory: 1) RegistrationContext, only if available

Parameters:
request - InitCookie
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
InitCookie

check

public void check(oasis.names.tc.wsrp.v1.types.GetPortletDescription request)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Parameter check for the GetPortletDescription object. The following attributes are mandatory 1) RegistrationContext, only if available 2) PortletContext 3) UserContext, only if available

Parameters:
request - GetPortletDescription
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
GetPortletDescription

check

public void check(oasis.names.tc.wsrp.v1.types.ClonePortlet request)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Parameter check for the ClonePortlet object. The following attributes are mandatory: 1) RegistrationContext, only if available 2) PortletContext 3) UserContext, only if available

Parameters:
request - ClonePortlet
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
ClonePortlet

check

public void check(oasis.names.tc.wsrp.v1.types.DestroyPortlets request)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Parameter check for the DestroyEntites object. The following attributes are mandatory: 1) RegistrationContext, only if available 2) PortletHandle

Parameters:
request - DestroyPortlets
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
DestroyPortlets

check

public void check(oasis.names.tc.wsrp.v1.types.SetPortletProperties request)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Parameter check for the SetPortletProperties object. The following attributes are mandatory: 1) RegistrationContext, only if available 2) PortletContext 3) UserContext, only if available 4) PropertyList

Parameters:
request - SetPortletProperties
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
SetPortletProperties

check

public void check(oasis.names.tc.wsrp.v1.types.GetPortletProperties request)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Parameter check for the SetPortletProperties object. The following attributes are mandatory: 1) RegistrationContext, only if available 2) PortletContext 3) UserContext, only if available 4) Names, only if available

Parameters:
request - GetPortletProperties
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
GetPortletProperties

check

public void check(oasis.names.tc.wsrp.v1.types.GetPortletPropertyDescription request)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Parameter check for the SetPortletProperties object. The following attributes are mandatory: 1) RegistrationContext, only if available 2) PortletContext 3) UserContext, only if available

Parameters:
request - GetPortletPropertyDescription
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
GetPortletPropertyDescription

check

public void check(oasis.names.tc.wsrp.v1.types.ReleaseSessions request)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Parameter check for the ReleaseSession object. The following attributes are mandatory: 1) RegistrationContext, only if available 2) String[] SessionHandles

Parameters:
request - _releaseSession
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
ReleaseSessions

check

public void check(oasis.names.tc.wsrp.v1.types.ServiceDescription response)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Parameter check for the ServiceDescription object. The following attribute needs to be set: - requiresRegistration

Parameters:
response - ServiceDescription
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
ServiceDescription

check

public void check(oasis.names.tc.wsrp.v1.types.BlockingInteractionResponse response)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Parameter check for the BlockingInteractionResponse object. The following attribute needs to be set: either - updateResponse or - redirectURL

Parameters:
response - BlockingInteractionResponse
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
BlockingInteractionResponse

check

private void check(oasis.names.tc.wsrp.v1.types.UpdateResponse response)
            throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Parameter check for the UpdateResponse object. The following attribute needs to be set: 1) SessionContext, only if available 2) PortletContext, only if available 3) MarkupContext, only if available 4) NavigationalState

Parameters:
response - UpdateResponse
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
UpdateResponse

check

public void check(oasis.names.tc.wsrp.v1.types.MarkupResponse response)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Parameter check for the MarkupResponse object. The following attribute needs to be set: 1) MarkupContext 2) SessionContext, only if available

Parameters:
response - MarkupResponse
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
MarkupResponse

check

public void check(oasis.names.tc.wsrp.v1.types.PortletDescriptionResponse response)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Validates the PortletDescriptionResponse object 1) PortletDescription 2) ResourceList, only if available

Parameters:
response - PortletDescriptionResponse
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
PortletDescriptionResponse

check

public void check(oasis.names.tc.wsrp.v1.types.PortletPropertyDescriptionResponse response)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Validates the PortletPropertyDescriptionResponse object 1) ResourceList

Parameters:
response - PortletPropertyDescriptionResponse
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
PortletPropertyDescriptionResponse

check

public void check(oasis.names.tc.wsrp.v1.types.DestroyPortletsResponse response)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Validates the DestroyPortletsResponse object 1) DestroyFailed[], only if available

Parameters:
response - DestroyPortletResponse
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
DestroyPortletsResponse

check

public void check(oasis.names.tc.wsrp.v1.types.PortletDescription element)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Parameter check for the PortletDescription object. The following parameter needs to be set: 1) portletHandle 2) markupType[]

Parameters:
element - PortletDescription
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
PortletDescription

check

public void check(oasis.names.tc.wsrp.v1.types.Templates element)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Parameter check for the PortletDescription object. The following parameter needs to be set: all templates...

Parameters:
element - Templates
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
PortletDescription

check

private void check(oasis.names.tc.wsrp.v1.types.SessionContext context,
                   boolean nillable)
            throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Parameter check for the SessionContext object. The following parameter needs to be set: 1) sessionID 2) expire

Parameters:
context - SessionContext
nillable - boolean true, if the SessionContext can be nill false, if the SessionContext is not nillable
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
SessionContext

check

private void check(oasis.names.tc.wsrp.v1.types.MarkupContext context,
                   boolean nillable)
            throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Parameter check for the MarkupContext object. The following parameter needs to be set: 1) markupBinary and markupString mutually exclusive, if markupType is available 2) locale, if markupType is available

Parameters:
context - MarkupContext
nillable - boolean true, if the MarkupContext can be nill false, if the MarkupContext is not nillable
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
MarkupContext

check

public void check(oasis.names.tc.wsrp.v1.types.PropertyList propertyList,
                  boolean nillable)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Check the PropertyList. The following attributes are mandatory: 1) Property[]

Parameters:
propertyList - PropertyList
nillable - boolean true, if the PropertyList can be nill false, if the PropertyList is not nillable
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
PropertyList

check

public void check(oasis.names.tc.wsrp.v1.types.RegistrationData registrationData,
                  boolean nillable)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Check the RegistrationData. The following attributes are mandatory: 1) ConsumerName 2) ConsumerAgent

Parameters:
registrationData - RegistrationData
nillable - boolean true, if the RegistrationData can be nill false, if the RegistrationData is not nillable
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
RegistrationData

check

private void check(java.lang.String[] array,
                   boolean nillable)
            throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Check a string array. The following attributes are mandatory: 1) must be a string array 2) must have a array.length > 0

Parameters:
array - String[]
nillable - boolean true, if the String[] can be nill false, if the String[] is not nillable
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
String

check

private void check(oasis.names.tc.wsrp.v1.types.InteractionParams interactionParams,
                   boolean nillable)
            throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Check the InteractionParams. The following attributes are mandatory: 1) PortletStateChange

Parameters:
interactionParams - InteractionParams
nillable - boolean true, if the InteractionParams can be nill false, if the InteractionParams is not nillable
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
InteractionParams

check

public void check(oasis.names.tc.wsrp.v1.types.RegistrationContext registrationContext,
                  boolean nillable)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Check the RegistrationContext. The following attributes are mandatory: 1) RegistrationHandle

Parameters:
registrationContext - RegistrationContext
nillable - boolean true, if the RegistrationContext can be nill false, if the RegistrationContext is not nillable
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
RegistrationContext

check

public void check(oasis.names.tc.wsrp.v1.types.PortletContext portletContext,
                  boolean nillable)
           throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Check the PortletContext. The following attributes are mandatory: 1) PortletHandle

Parameters:
portletContext - PortletContext
nillable - boolean true, if the PortletContext can be nill false, if the PortletContext is not nillable
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
PortletContext

check

private void check(oasis.names.tc.wsrp.v1.types.RuntimeContext runtimeContext,
                   boolean nillable)
            throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Check the RuntimeContext. The following attributes are mandatory: 1) UserAuthentication 2) PortletInstanceKey

Parameters:
runtimeContext - RuntimeContext
nillable - boolean true, if the RuntimeContext can be nill false, if the RuntimeContext is not nillable
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
RuntimeContext

check

private void check(oasis.names.tc.wsrp.v1.types.DestroyFailed[] destroyFailedArray,
                   boolean nillable)
            throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Validates the DestroyFailed Array. If DestroyFailed objects are available, they are checked for their content.

Parameters:
destroyFailedArray - DestroyFailed[]
nillable - boolean true, if the DestroyFailed[] can be nill false, if the DestroyFailed[] is not nillable
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault

check

private void check(oasis.names.tc.wsrp.v1.types.UserContext userContext,
                   boolean nillable)
            throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Check the UserContext. The following attributes are mandatory: 1) UserContextKey

Parameters:
userContext - UserContext
nillable - boolean true, if the UserContext can be nill false, if the UserContext is not nillable
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
UserContext

check

private void check(oasis.names.tc.wsrp.v1.types.ResourceList resourceList,
                   boolean nillable)
            throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Validates the ResourceList object for available resources.

Parameters:
resourceList -
nillable - true if null is allowed
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault

check

private void check(oasis.names.tc.wsrp.v1.types.CookieProtocol requiresInit,
                   boolean nillable)
            throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Validates the CookieProtocol object

Parameters:
requiresInit -
nillable - true if null is allowed
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault

check

private void check(oasis.names.tc.wsrp.v1.types.MarkupParams markupParams,
                   boolean nillable)
            throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Check the MarkupParams. The following attributes are mandatory: 1) ClientData 2) Locale 3) MimeType 4) Mode 5) WindowState

Parameters:
markupParams - MarkupParams
nillable - boolean true, if the MarkupParams can be nill false, if the MarkupParams is not nillable
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
MarkupParams

throwMissingParametersFault

private void throwMissingParametersFault(java.lang.String msg)
                                  throws oasis.names.tc.wsrp.v1.types.MissingParametersFault
Creates and throws a MissingParametersFault exception

Parameters:
msg - String error message
Throws:
oasis.names.tc.wsrp.v1.types.MissingParametersFault
See Also:
MissingParametersFault


--