Package de.fmui.osb.broker
Class OpenServiceBroker
- java.lang.Object
-
- de.fmui.osb.broker.OpenServiceBroker
-
public class OpenServiceBroker extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description OpenServiceBroker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BrokerAPIVersion
checkBrokerAPIVersion(javax.servlet.http.HttpServletRequest request)
protected boolean
getAcceptsIncomplete(javax.servlet.http.HttpServletRequest request)
BrokerAPIVersion
getBrokerAPIMinVersion()
Gets the minimum Broker API Version that this configured for this broker.ContextHandler
getContextHandler()
Gets the current contextHandler log handler.protected RequestCredentials
getCredentials(javax.servlet.http.HttpServletRequest request)
ErrorLogHandler
getErrorLogHandler()
Gets the current error log handler.protected OriginatingIdentity
getOriginatingIdentity(javax.servlet.http.HttpServletRequest request)
protected java.lang.String
getPathSegment(java.lang.String[] path, int position)
protected java.lang.String
getRequiredParameter(javax.servlet.http.HttpServletRequest request, java.lang.String name)
protected boolean
isBindingFetchRequest(java.lang.String method, java.lang.String[] path)
protected boolean
isBindingLastOperationRequest(java.lang.String method, java.lang.String[] path)
protected boolean
isBindRequest(java.lang.String method, java.lang.String[] path)
protected boolean
isCatalogRequest(java.lang.String method, java.lang.String[] path)
protected boolean
isDeprovsionRequest(java.lang.String method, java.lang.String[] path)
protected boolean
isInstanceFetchRequest(java.lang.String method, java.lang.String[] path)
protected boolean
isInstanceLastOperationRequest(java.lang.String method, java.lang.String[] path)
protected boolean
isInstanceUpdateRequest(java.lang.String method, java.lang.String[] path)
protected boolean
isProvisionRequest(java.lang.String method, java.lang.String[] path)
protected boolean
isUnbindRequest(java.lang.String method, java.lang.String[] path)
protected <T extends java.util.Map<java.lang.String,java.lang.Object>>
TparseBody(javax.servlet.http.HttpServletRequest request, T root)
protected void
populateRequestObject(OpenServiceBrokerRequest osbRequest, javax.servlet.http.HttpServletRequest request, BrokerAPIVersion brokerAPIVersion, RequestCredentials credentials, JSONObject root)
void
processRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, OpenServiceBrokerHandler handler)
Processes an Open Service Broker request.void
setBrokerAPIMinVersion(java.lang.String version)
Sets the minimum Broker API Version that this broker requires.void
setContextHandler(ContextHandler contextHandler)
Sets a new context handler.void
setErrorLogHandler(ErrorLogHandler errorLogHandler)
Sets a new error handler.
-
-
-
Method Detail
-
setBrokerAPIMinVersion
public void setBrokerAPIMinVersion(java.lang.String version)
Sets the minimum Broker API Version that this broker requires.- Parameters:
version
- the Broker API Version as a string
-
getBrokerAPIMinVersion
public BrokerAPIVersion getBrokerAPIMinVersion()
Gets the minimum Broker API Version that this configured for this broker.- Returns:
- the min broker API version
-
setErrorLogHandler
public void setErrorLogHandler(ErrorLogHandler errorLogHandler)
Sets a new error handler.- Parameters:
errorLogHandler
- the error handler ornull
if errors shouldn't be logged
-
getErrorLogHandler
public ErrorLogHandler getErrorLogHandler()
Gets the current error log handler.- Returns:
- the error log handler
-
setContextHandler
public void setContextHandler(ContextHandler contextHandler)
Sets a new context handler.- Parameters:
contextHandler
- the context handler ornull
if context objects shouldn't be converted
-
getContextHandler
public ContextHandler getContextHandler()
Gets the current contextHandler log handler.- Returns:
- the context handler
-
processRequest
public void processRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, OpenServiceBrokerHandler handler) throws java.io.IOException
Processes an Open Service Broker request.- Parameters:
request
- the HTTP request objectresponse
- the HTTP response objecthandler
- the handler that handles the request- Throws:
java.io.IOException
- if the request cannot be read or the response cannot be sent
-
isCatalogRequest
protected boolean isCatalogRequest(java.lang.String method, java.lang.String[] path)
-
isProvisionRequest
protected boolean isProvisionRequest(java.lang.String method, java.lang.String[] path)
-
isDeprovsionRequest
protected boolean isDeprovsionRequest(java.lang.String method, java.lang.String[] path)
-
isInstanceFetchRequest
protected boolean isInstanceFetchRequest(java.lang.String method, java.lang.String[] path)
-
isInstanceUpdateRequest
protected boolean isInstanceUpdateRequest(java.lang.String method, java.lang.String[] path)
-
isInstanceLastOperationRequest
protected boolean isInstanceLastOperationRequest(java.lang.String method, java.lang.String[] path)
-
isBindRequest
protected boolean isBindRequest(java.lang.String method, java.lang.String[] path)
-
isUnbindRequest
protected boolean isUnbindRequest(java.lang.String method, java.lang.String[] path)
-
isBindingFetchRequest
protected boolean isBindingFetchRequest(java.lang.String method, java.lang.String[] path)
-
isBindingLastOperationRequest
protected boolean isBindingLastOperationRequest(java.lang.String method, java.lang.String[] path)
-
checkBrokerAPIVersion
protected BrokerAPIVersion checkBrokerAPIVersion(javax.servlet.http.HttpServletRequest request) throws OpenServiceBrokerException
- Throws:
OpenServiceBrokerException
-
getCredentials
protected RequestCredentials getCredentials(javax.servlet.http.HttpServletRequest request) throws OpenServiceBrokerException
- Throws:
OpenServiceBrokerException
-
getAcceptsIncomplete
protected boolean getAcceptsIncomplete(javax.servlet.http.HttpServletRequest request)
-
getPathSegment
protected java.lang.String getPathSegment(java.lang.String[] path, int position) throws OpenServiceBrokerException
- Throws:
OpenServiceBrokerException
-
getRequiredParameter
protected java.lang.String getRequiredParameter(javax.servlet.http.HttpServletRequest request, java.lang.String name) throws OpenServiceBrokerException
- Throws:
OpenServiceBrokerException
-
getOriginatingIdentity
protected OriginatingIdentity getOriginatingIdentity(javax.servlet.http.HttpServletRequest request) throws OpenServiceBrokerException
- Throws:
OpenServiceBrokerException
-
parseBody
protected <T extends java.util.Map<java.lang.String,java.lang.Object>> T parseBody(javax.servlet.http.HttpServletRequest request, T root) throws OpenServiceBrokerException, ValidationException
-
populateRequestObject
protected void populateRequestObject(OpenServiceBrokerRequest osbRequest, javax.servlet.http.HttpServletRequest request, BrokerAPIVersion brokerAPIVersion, RequestCredentials credentials, JSONObject root) throws OpenServiceBrokerException, ValidationException
-
-