edu.internet2.middleware.ldappc.spml.provider
Class BaseSpmlProvider

java.lang.Object
  extended by edu.internet2.middleware.shibboleth.common.config.BaseService
      extended by edu.internet2.middleware.shibboleth.common.config.BaseReloadableService
          extended by edu.internet2.middleware.ldappc.spml.provider.BaseSpmlProvider
All Implemented Interfaces:
SpmlProvider, edu.internet2.middleware.shibboleth.common.service.ReloadableService, edu.internet2.middleware.shibboleth.common.service.Service, org.springframework.beans.factory.BeanNameAware, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
BaseSpmlTargetProvider, PSP

public abstract class BaseSpmlProvider
extends edu.internet2.middleware.shibboleth.common.config.BaseReloadableService
implements SpmlProvider

Base class for SPMLv2 Provisioning Service Providers. Handling of requests is provided by subclasses. Extends Shibboleth's BaseReloadableService.


Nested Class Summary
 
Nested classes/interfaces inherited from class edu.internet2.middleware.shibboleth.common.config.BaseReloadableService
edu.internet2.middleware.shibboleth.common.config.BaseReloadableService.ConfigurationResourceListener
 
Field Summary
static String methodName
          Method name to look for in subclasses.
 
Constructor Summary
BaseSpmlProvider()
           
 
Method Summary
 org.openspml.v2.msg.spml.Response execute(org.openspml.v2.msg.spml.Request request)
          Execute a Request and return the Response.
 org.openspml.v2.msg.spml.Response fail(org.openspml.v2.msg.spml.Response response, org.openspml.v2.msg.spml.ErrorCode errorCode, Exception e)
          See fail(Response, ErrorCode, String...) The messages from the given exception are added to the response.
 org.openspml.v2.msg.spml.Response fail(org.openspml.v2.msg.spml.Response response, org.openspml.v2.msg.spml.ErrorCode errorCode, String... messages)
          Set the status code of the given response to failure and set the error code and messages.
 String generateRequestID()
          Generate a reasonably unique id.
 String getId()
          
 String getOrGenerateRequestID(org.openspml.v2.msg.spml.Request request)
          Return the request ID of the given request or generate a new request ID.
 org.openspml.v2.msg.XMLMarshaller getXMLMarshaller()
          Return the XML marshaller, which will be instantiated once and reused per instance of this class.
 org.openspml.v2.msg.XMLUnmarshaller getXmlUnmarshaller()
          Return the XML unmarshaller, which will be instantiated once and reused per instance of this class.
 void setId(String id)
          Sets the id.
 void setXMLMarshaller(org.openspml.v2.msg.XMLMarshaller xmlMarshaller)
          Set the XML marshaller
 void setXmlUnmarshaller(org.openspml.v2.msg.XMLUnmarshaller xmlUnmarshaller)
          Set the XML unmarshaller
 String toXML(org.openspml.v2.msg.Marshallable marshallable)
          Return the XML representation of the given object.
 
Methods inherited from class edu.internet2.middleware.shibboleth.common.config.BaseReloadableService
destroy, getPollingFrequency, getPollingRetryAttempts, getPollingTimer, initialize, reload, setPollingFrequency, setPollingRetryAttempts, setPollingTimer
 
Methods inherited from class edu.internet2.middleware.shibboleth.common.config.BaseService
getApplicationContext, getReadWriteLock, getServiceConfigurations, getServiceContext, isDestroyed, isInitialized, loadContext, onNewContextCreated, setApplicationContext, setBeanName, setInitialized, setServiceConfigurations, setServiceContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.internet2.middleware.shibboleth.common.service.Service
isDestroyed, isInitialized
 

Field Detail

methodName

public static final String methodName
Method name to look for in subclasses.

See Also:
Constant Field Values
Constructor Detail

BaseSpmlProvider

public BaseSpmlProvider()
Method Detail

execute

public org.openspml.v2.msg.spml.Response execute(org.openspml.v2.msg.spml.Request request)
Execute a Request and return the Response. Only the synchronous execution mode is supported.

Specified by:
execute in interface SpmlProvider
Parameters:
request - the SPML request
Returns:
the SPML response, never null

getId

public String getId()

Specified by:
getId in interface edu.internet2.middleware.shibboleth.common.service.Service
Overrides:
getId in class edu.internet2.middleware.shibboleth.common.config.BaseService

setId

public void setId(String id)
Sets the id.

Parameters:
id -

getXMLMarshaller

public org.openspml.v2.msg.XMLMarshaller getXMLMarshaller()
Return the XML marshaller, which will be instantiated once and reused per instance of this class.

Returns:
the XMLMarshaller

setXMLMarshaller

public void setXMLMarshaller(org.openspml.v2.msg.XMLMarshaller xmlMarshaller)
Set the XML marshaller

Parameters:
xmlMarshaller - the XMLMarshaller

getXmlUnmarshaller

public org.openspml.v2.msg.XMLUnmarshaller getXmlUnmarshaller()
Return the XML unmarshaller, which will be instantiated once and reused per instance of this class.

Returns:
the XMLUnmarshaller

setXmlUnmarshaller

public void setXmlUnmarshaller(org.openspml.v2.msg.XMLUnmarshaller xmlUnmarshaller)
Set the XML unmarshaller

Parameters:
xmlUnmarshaller - the XMLUnmarshaller

fail

public org.openspml.v2.msg.spml.Response fail(org.openspml.v2.msg.spml.Response response,
                                              org.openspml.v2.msg.spml.ErrorCode errorCode,
                                              Exception e)
See fail(Response, ErrorCode, String...) The messages from the given exception are added to the response.

Parameters:
response - the Response
errorCode - the ErrorCode
e - the exception
Returns:
the updated Response

fail

public org.openspml.v2.msg.spml.Response fail(org.openspml.v2.msg.spml.Response response,
                                              org.openspml.v2.msg.spml.ErrorCode errorCode,
                                              String... messages)
Set the status code of the given response to failure and set the error code and messages. Kludge : the 0x0 unicode character is replaced with an underscore to avoid exceptions when handling Active Directory error messages.

Parameters:
response - the Response
errorCode - the ErrorCode
messages - error text
Returns:
the updated Response

generateRequestID

public String generateRequestID()
Generate a reasonably unique id. see PSPUtil.uniqueRequestId()

Returns:
the id

getOrGenerateRequestID

public String getOrGenerateRequestID(org.openspml.v2.msg.spml.Request request)
Return the request ID of the given request or generate a new request ID.

Parameters:
request -
Returns:
the request ID

toXML

public String toXML(org.openspml.v2.msg.Marshallable marshallable)
Return the XML representation of the given object. Return null if an exception occurs.

Parameters:
marshallable - the Marshallable object
Returns:
the XML representation


Copyright © 2011 Internet2. All Rights Reserved.