com.wewebu.ow.server.ecmimpl.cmis
Class OwCMISSecurityHandler

java.lang.Object
  extended by com.wewebu.ow.server.ecmimpl.cmis.OwCMISSecurityHandler
All Implemented Interfaces:
OwCMISSecurityHandlerInterface, Handler<SOAPMessageContext>, SOAPHandler<SOAPMessageContext>

public class OwCMISSecurityHandler
extends Object
implements OwCMISSecurityHandlerInterface

WSS handler for CMIS user PasswordText authentication.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Field Summary
protected static Set<QName> HEADER_SUPPORT
          Set of headers which are supported by this security handler.
protected static QName SECURITY
          Security Header
 
Fields inherited from interface com.wewebu.ow.server.ecmimpl.cmis.wshandler.OwCMISSecurityHandlerInterface
PWD, USER, WS_I18N, WS_I18N_PREFIX, WS_SECEXT, WS_SECEXT_PREFIX, WS_SECUTILITY, WS_SECUTILITY_PREFIX, WS_USER_TOKEN_PROFILE
 
Constructor Summary
OwCMISSecurityHandler(String username_p, String password_p)
          Create a handler with UTC time zone settings, without any locale information.
OwCMISSecurityHandler(String username_p, String password_p, Locale locale_p, TimeZone wssi18nTimeZone_p, TimeZone wssecTimeZone_p)
          New Constructor to define directly the parameter of the security handler.
 
Method Summary
 void close(MessageContext context_p)
           
protected  String createTimezoneString(TimeZone ctz)
          Simple helper to create GMT representation of the client time zone.
protected  void createWsi18nHeader(SOAPHeader soapHeader_p)
          (overridable) Create an i18n-header if a locale was set for this security handler.
protected  void createWssecHeader(SOAPHeader soapHeader_p)
          (overridable) Create the depending header structure depending on the implemented security handling.
 Set<QName> getHeaders()
           
 Locale getLocale()
          Return the defined Locale which should be used by for the SOAP WS-i18n header.
 String getTimezoneString()
          Deprecated. 
 String getWsi18nTimeZone()
          Return the Time zone String which should be used in web services header.
protected  TimeZone getWsSecTimeZone()
          Get the WsSecTimeZone to be used for security header TTL (time to live) definition.
 boolean handleFault(SOAPMessageContext context_p)
           
 boolean handleMessage(SOAPMessageContext messageContext_p)
           
 void init(Map<String,String> arr_p)
          Initial method which is called after instantiation of the Security handler.
 void setLocale(Locale locale_p)
          Set the Locale which should be provided for WS-i18n localization.
 void setTimezoneString(String timeZone_p)
          Deprecated. 
 void setWsi18nTimeZone(String timeZone_p)
          Set the String which should represent the value of the time zone web service header.
 void setWsi18nTimeZone(TimeZone timeZone_p)
          Transform the provided Timezone into a string which should be used for WSI communication with CMIS system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SECURITY

protected static final QName SECURITY
Security Header


HEADER_SUPPORT

protected static final Set<QName> HEADER_SUPPORT
Set of headers which are supported by this security handler.

Constructor Detail

OwCMISSecurityHandler

public OwCMISSecurityHandler(String username_p,
                             String password_p,
                             Locale locale_p,
                             TimeZone wssi18nTimeZone_p,
                             TimeZone wssecTimeZone_p)
New Constructor to define directly the parameter of the security handler.

Parameters:
username_p - String
password_p - String
locale_p - Locale can be null
wssi18nTimeZone_p - TimeZone can be null
wssecTimeZone_p - TimeZone if null will be set to UTC
Since:
4.0.0.0

OwCMISSecurityHandler

public OwCMISSecurityHandler(String username_p,
                             String password_p)
Create a handler with UTC time zone settings, without any locale information.

Parameters:
username_p - String
password_p - String
Method Detail

handleMessage

public boolean handleMessage(SOAPMessageContext messageContext_p)
Specified by:
handleMessage in interface Handler<SOAPMessageContext>

getHeaders

public Set<QName> getHeaders()
Specified by:
getHeaders in interface SOAPHandler<SOAPMessageContext>

handleFault

public boolean handleFault(SOAPMessageContext context_p)
Specified by:
handleFault in interface Handler<SOAPMessageContext>

close

public void close(MessageContext context_p)
Specified by:
close in interface Handler<SOAPMessageContext>

setLocale

public void setLocale(Locale locale_p)
Description copied from interface: OwCMISSecurityHandlerInterface
Set the Locale which should be provided for WS-i18n localization. Remember that the locale should be used with the LDML definitions if added to the SOAP header.

Specified by:
setLocale in interface OwCMISSecurityHandlerInterface
Parameters:
locale_p - Locale to be used, or null

getLocale

public Locale getLocale()
Description copied from interface: OwCMISSecurityHandlerInterface
Return the defined Locale which should be used by for the SOAP WS-i18n header. Can return null to avoid the attaching/creation of the web service localization header.

Specified by:
getLocale in interface OwCMISSecurityHandlerInterface
Returns:
Locale or null

setWsi18nTimeZone

public void setWsi18nTimeZone(TimeZone timeZone_p)
Description copied from interface: OwCMISSecurityHandlerInterface
Transform the provided Timezone into a string which should be used for WSI communication with CMIS system.

Specified by:
setWsi18nTimeZone in interface OwCMISSecurityHandlerInterface
Parameters:
timeZone_p - TimeZone can be null.
See Also:
OwCMISSecurityHandlerInterface.setWsi18nTimeZone(String)

createTimezoneString

protected String createTimezoneString(TimeZone ctz)
Simple helper to create GMT representation of the client time zone.

Returns:
String representing client time zone.
Since:
3.2.0.0

init

public void init(Map<String,String> arr_p)
Description copied from interface: OwCMISSecurityHandlerInterface
Initial method which is called after instantiation of the Security handler. Provided are HTTP headers and also USERNAME and USERPASSWORD for simple authentication.

Specified by:
init in interface OwCMISSecurityHandlerInterface
Parameters:
arr_p - Map Strings header to value mapping

createWssecHeader

protected void createWssecHeader(SOAPHeader soapHeader_p)
                          throws SOAPException,
                                 DatatypeConfigurationException
(overridable) Create the depending header structure depending on the implemented security handling.

Parameters:
soapHeader_p - SOAPHeader to attach to
Throws:
SOAPException - if problems with creation of the attaching new child elements
DatatypeConfigurationException - if could not create DatatypeFactory for XMLGregorianCalendar
Since:
3.1.0.0

createWsi18nHeader

protected void createWsi18nHeader(SOAPHeader soapHeader_p)
                           throws SOAPException
(overridable) Create an i18n-header if a locale was set for this security handler.

Parameters:
soapHeader_p - SOAPHeader where to attach the new i18n-elements
Throws:
SOAPException - if problem occurs during attaching/creating header element
Since:
3.1.0.0

setTimezoneString

@Deprecated
public void setTimezoneString(String timeZone_p)
Deprecated. 

Description copied from interface: OwCMISSecurityHandlerInterface
Set the String which should represent the value of the time zone web service header. The String should be regarding the W3C definition of WS-i18n specification.

deprecated since 4.0.0.0 use OwCMISSecurityHandlerInterface.setWsi18nTimeZone(TimeZone) or OwCMISSecurityHandlerInterface.setWsi18nTimeZone(String) instead

Specified by:
setTimezoneString in interface OwCMISSecurityHandlerInterface
Parameters:
timeZone_p - String can be null.

getTimezoneString

@Deprecated
public String getTimezoneString()
Deprecated. 

Description copied from interface: OwCMISSecurityHandlerInterface
Return the Time zone String which should be used in web services header. Can return null, if the time zone web service header should not be added.

Specified by:
getTimezoneString in interface OwCMISSecurityHandlerInterface
Returns:
String or null

setWsi18nTimeZone

public void setWsi18nTimeZone(String timeZone_p)
Description copied from interface: OwCMISSecurityHandlerInterface
Set the String which should represent the value of the time zone web service header. The String should be regarding the W3C definition of WS-i18n specification.

Specified by:
setWsi18nTimeZone in interface OwCMISSecurityHandlerInterface
Parameters:
timeZone_p - String can be null.

getWsi18nTimeZone

public String getWsi18nTimeZone()
Description copied from interface: OwCMISSecurityHandlerInterface
Return the Time zone String which should be used in web services header. Can return null, if the time zone web service header should not be added.
For further information see W3C definition of WS-i18n.

Specified by:
getWsi18nTimeZone in interface OwCMISSecurityHandlerInterface
Returns:
String or null

getWsSecTimeZone

protected TimeZone getWsSecTimeZone()
Get the WsSecTimeZone to be used for security header TTL (time to live) definition.

Returns:
Timezone
Since:
4.0.0.0


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.