/** * @return the service workspace */ public static DeegreeWorkspace getServiceWorkspace() { return getInstance().workspace; }
/** * Returns the HTTP URL for accessing the {@link ResourcesServlet}. * <p> * NOTE: This method will only return a correct result if the calling thread originated in the * {@link #doGet(HttpServletRequest, HttpServletResponse)} or * {@link #doPost(HttpServletRequest, HttpServletResponse)} of this class (or has been spawned as a child thread by * such a thread). * </p> * * @return URL, never <code>null</code> (without trailing slash or question mark) */ public static String getResourcesUrl() { return getContext().getResourcesUrl(); }
public String getWebURL() { String url = OGCFrontController.getHttpGetURL() + "service=WPS&version=1.0.0&request=GetOutput&identifier=" + id; return url; }
private static String getHttpURL() { RequestContext context = getContext(); String xForwardedHost = context.getXForwardedHost(); if ( xForwardedHost != null && xForwardedHost != "" ) { String contextServiceUrl = context.getServiceUrl(); try { URL serviceUrl = new URL( contextServiceUrl ); return buildUrlFromForwardedHeader( context, serviceUrl ); } catch ( MalformedURLException e ) { LOG.warn( "Could not parse service URL as URL: " + contextServiceUrl ); } } return context.getServiceUrl(); }
@Override public void init() { OwsGlobalConfigLoader loader = workspace.getInitializable( OwsGlobalConfigLoader.class ); init( loader.getMetadataConfig(), loader.getMainConfig(), jaxbConfig ); }
private HttpResponseBuffer createHttpResponseBuffer( HttpServletRequest request, HttpServletResponse response ) throws FileNotFoundException, IOException { OwsGlobalConfigLoader loader = workspace.getNewWorkspace().getInitializable( OwsGlobalConfigLoader.class ); if ( loader.getRequestLogger() != null ) { response = createLoggingResponseWrapper( request, response ); } return new HttpResponseBuffer( response ); }
/** * Returns the HTTP URL for accessing the {@link OGCFrontController}/{@link OWS} (using POST requests). * <p> * NOTE: This includes OGC service instance path info (service identifier), if available. This method will only * return a correct result if the calling thread originated in the * {@link #doGet(HttpServletRequest, HttpServletResponse)} or * {@link #doPost(HttpServletRequest, HttpServletResponse)} of this class (or has been spawned as a child thread by * such a thread). * </p> * * @return URL, never <code>null</code> (without trailing slash or question mark) */ public static String getHttpPostURL() { return getHttpURL(); }
@Override public Credentials doXML( XMLStreamReader xmlStream, HttpServletRequest req, HttpServletResponse response ) throws SecurityException { // extract (deegree specific) security information and bind to current thread String user = xmlStream.getAttributeValue( "", "user" ); String password = xmlStream.getAttributeValue( "", "password" ); String tokenId = xmlStream.getAttributeValue( "", "sessionId" ); return new Credentials( user, password, tokenId ); }
/** * Returns the URL for contacting the {@link OGCFrontController} instance via HTTP (including OGC service instance * path info, if available). * * @return the URL (without trailing slash or question mark), never <code>null</code> */ public String getServiceUrl() { if ( hardcodedServicesUrl != null ) { return getServiceUrlWithPathInfo( hardcodedServicesUrl ); } return requestedEndpointUrl; }
public void logKVP( String address, String queryString, long startTime, long endTime, Credentials creds ) { // store address as well? incomingKVP( queryString, startTime ); }
/** * Returns the URL for retrieving the specified workspace file via HTTP. * <p> * NOTE: This method will only return a correct result if the calling thread originated in the * {@link #doGet(HttpServletRequest, HttpServletResponse)} or * {@link #doPost(HttpServletRequest, HttpServletResponse)} of this class (or has been spawned as a child thread by * such a thread). * </p> * * @param workspaceFilePath * relative path to the workspace file, must not be <code>null</code> * @return the URL, never <code>null</code> */ public static String getUrl( String workspaceFilePath ) { return OGCFrontController.getResourcesUrl() + "/" + workspaceFilePath; }
/** * @return * @throws IOException * @see javax.servlet.ServletResponse#getOutputStream() */ public ServletOutputStream getOutputStream() throws IOException { if ( gos == null ) { gos = new GZipServletOutputStream( this, response.getOutputStream() ); } return gos; }
/** * Returns the (local) names of the requests handled by the associated controller. * * @return the (local) names of the handled requests */ public Set<String> getHandledRequests() { if ( handledRequestsMap.isEmpty() && this.handledRequests != null ) { retrieveRequestNames(); } return handledRequestsMap.keySet(); }
public String getRestURL() { return OGCFrontController.getContext().getResourcesUrl() + "../rest" + UriBuilder.fromResource( WSDLResource.class ).path( WSDLResource.class, "get" ).build( "ALL" ).toString(); } }
/** * Returns the {@link ModuleInfo}s for the deegree modules accessible by the webapp classloader. * * @return module infos, never <code>null</code>, but can be empty */ public static Collection<ModuleInfo> getModulesInfo() { return getInstance().modulesInfo; }
/** * Returns the HTTP URL for accessing the {@link OGCFrontController}/{@link OWS} (using GET requests). * <p> * NOTE: This includes OGC service instance path info (service identifier), if available. This method will only * return a correct result if the calling thread originated in the * {@link #doGet(HttpServletRequest, HttpServletResponse)} or * {@link #doPost(HttpServletRequest, HttpServletResponse)} of this class (or has been spawned as a child thread by * such a thread). * </p> * * @return URL (for GET requests), never <code>null</code> (with trailing question mark) */ public static String getHttpGetURL() { return getHttpURL() + "?"; }
@Override public Credentials doKVP( Map<String, String> normalizedKVPParams, HttpServletRequest req, HttpServletResponse response ) throws SecurityException { // extract (deegree specific) security information and bind to current thread String user = normalizedKVPParams.get( "USER" ); String password = normalizedKVPParams.get( "PASSWORD" ); String tokenId = normalizedKVPParams.get( "SESSIONID" ); return new Credentials( user, password, tokenId ); }
/** * @return the service configuration */ public static OwsManager getServiceConfiguration() { return getInstance().serviceConfiguration; }
private static void addHeaders( HttpServletResponse response ) { // add cache control headers response.addHeader( "Cache-Control", "no-cache, no-store" ); // add deegree header response.addHeader( "deegree-version", getInstance().version ); }