protected Context getContext() { return ReadOnlyContext.getContext(Constants.HTTP_REQUEST.REST.uri, m_servletRequest); }
public static final ReadOnlyContext getContext(String messageProtocol, String subjectId, String password, /* * String[] * roles, */ boolean noOp) throws Exception { MultiValueMap<URI> environmentMap = beginEnvironmentMap(messageProtocol); environmentMap.lock(); // no request to grok more from return getContext(null, environmentMap, subjectId, password, /* roles, */ null, noOp); }
@Override public List<String> getObjectHistory(String pid) { MessageContext ctx = context.getMessageContext(); Context context = ReadOnlyContext.getSoapContext(ctx); assertInitialized(); try { String[] sDefs = m_access.getObjectHistory(context, pid); if (sDefs != null && debug) { for (int i = 0; i < sDefs.length; i++) { LOG.debug("sDef[{}] = {}", i, sDefs[i]); } } return sDefs == null ? null : Arrays.asList(sDefs); } catch (Throwable th) { LOG.error("Error getting object history", th); throw CXFUtility.getFault(th); } }
public InputStream getContentStreamForChecksum() throws StreamIOException { /** * What should the context be here? */ MultiValueMap<URI> environmentAttributes = beginEnvironmentMap(""); try { environmentAttributes.set(Constants.HTTP_REQUEST.CLIENT_IP_ADDRESS.attributeId, "127.0.0.1"); } catch (Exception e) { logger.warn("Could not set client IP for checksum context!"); } ReadOnlyContext context; try { context = ReadOnlyContext.getContext(null, null, "fcrepo-checksum", false); } catch (Exception e) { throw new StreamIOException(e.getMessage(),e); } context.setEnvironmentValues(environmentAttributes); return getContentStream(context); }
new ReadOnlyContext(null, null, null, "", true); static { EMPTY.setActionAttributes(null); EMPTY.setResourceAttributes(null); subjectMap.lock(); return new ReadOnlyContext(request, environmentMap, subjectMap,
boolean noOp) { setEnvironmentValues(environmentAttributes); m_subjectAttributes = subjectAttributes; if (m_subjectAttributes == null) { extendedHttpServletRequest = (ExtendedHttpServletRequest) request; m_requestHeaders = getHeaders(request);
public InputStream getContentStreamForChecksum() throws StreamIOException { /** * What should the context be here? */ MultiValueMap<URI> environmentAttributes = beginEnvironmentMap(""); try { environmentAttributes.set(Constants.HTTP_REQUEST.CLIENT_IP_ADDRESS.attributeId, "127.0.0.1"); } catch (Exception e) { logger.warn("Could not set client IP for checksum context!"); } ReadOnlyContext context; try { context = ReadOnlyContext.getContext(null, null, "fcrepo-checksum", false); } catch (Exception e) { throw new StreamIOException(e.getMessage(),e); } context.setEnvironmentValues(environmentAttributes); return getContentStream(context); }
new ReadOnlyContext(null, null, null, "", true); static { EMPTY.setActionAttributes(null); EMPTY.setResourceAttributes(null); subjectMap.lock(); return new ReadOnlyContext(request, environmentMap, subjectMap,
boolean noOp) { setEnvironmentValues(environmentAttributes); m_subjectAttributes = subjectAttributes; if (m_subjectAttributes == null) { extendedHttpServletRequest = (ExtendedHttpServletRequest) request; m_requestHeaders = getHeaders(request);
private Context getContext() throws Exception { if (fedoraCtx != null) { return fedoraCtx; } fedoraCtx = ReadOnlyContext.getContext(null, null, null, ReadOnlyContext.DO_OP); return fedoraCtx; }
public static final ReadOnlyContext getContext(String messageProtocol, String subjectId, String password, /* * String[] * roles, */ boolean noOp) throws Exception { MultiValueMap<URI> environmentMap = beginEnvironmentMap(messageProtocol); environmentMap.lock(); // no request to grok more from return getContext(null, environmentMap, subjectId, password, /* roles, */ null, noOp); }
@Override public List<String> getObjectHistory(String pid) { MessageContext ctx = context.getMessageContext(); Context context = ReadOnlyContext.getSoapContext(ctx); assertInitialized(); try { String[] sDefs = m_access.getObjectHistory(context, pid); if (sDefs != null && debug) { for (int i = 0; i < sDefs.length; i++) { LOG.debug("sDef[{}] = {}", i, sDefs[i]); } } return sDefs == null ? null : Arrays.asList(sDefs); } catch (Throwable th) { LOG.error("Error getting object history", th); throw CXFUtility.getFault(th); } }
protected Context getContext() { return ReadOnlyContext.getContext(Constants.HTTP_REQUEST.REST.uri, m_servletRequest); }
environmentMap = beginEnvironmentMap(messageProtocol); auxSubjectRoles = (Map<String, ?>) testFedoraAuxSubjectAttributes; return getContext(request, environmentMap, subjectId, password, auxSubjectRoles, noOp);
@Override public List<String> getObjectHistory(String pid) { MessageContext ctx = context.getMessageContext(); Context context = ReadOnlyContext.getSoapContext(ctx); assertInitialized(); try { String[] changeTimestamps = m_access.getObjectHistory(context, pid); if (changeTimestamps != null && debug) { for (int i = 0; i < changeTimestamps.length; i++) { LOG.debug("changeTimestamps[{}] = {}", i, changeTimestamps[i]); } } return changeTimestamps == null ? null : Arrays.asList(changeTimestamps); } catch (Throwable th) { LOG.error("Error getting object history", th); throw CXFUtility.getFault(th); } }
public InputStream getContentStream() throws StreamIOException { Context context = null; try { context = ReadOnlyContext.getContext(null, null, "", false); } catch (Throwable t){ context = null; } return getContentStream(context); }
environmentMap = beginEnvironmentMap(messageProtocol); auxSubjectRoles = (Map<String, ?>) testFedoraAuxSubjectAttributes; return getContext(request, environmentMap, subjectId, password, auxSubjectRoles, noOp);
@Override public byte[] getObjectXML(String pid) { assertInitialized(); try { MessageContext ctx = context.getMessageContext(); InputStream in = m_management.getObjectXML(ReadOnlyContext .getSoapContext(ctx), pid, "UTF-8"); ByteArrayOutputStream out = new ByteArrayOutputStream(2048); pipeStream(in, out); return out.toByteArray(); } catch (Throwable th) { LOG.error("Error getting object XML", th); throw CXFUtility.getFault(th); } }
private Context getContext() throws PolicyStoreException { try { return ReadOnlyContext.getContext(null, "fedoraBootstrap", null, false); } catch (Exception e) { throw new PolicyStoreException(e.getMessage(), e); } }
@Override public byte[] getObjectXML(String pid) { assertInitialized(); try { MessageContext ctx = context.getMessageContext(); InputStream in = m_management.getObjectXML(ReadOnlyContext .getSoapContext(ctx), pid, "UTF-8"); ByteArrayOutputStream out = new ByteArrayOutputStream(2048); pipeStream(in, out); return out.toByteArray(); } catch (Throwable th) { LOG.error("Error getting object XML", th); throw CXFUtility.getFault(th); } }