/** * Returns the name. * * @return The name. */ @Override public String toString() { return getName() + ((getVersion() == null) ? "" : "/" + getVersion()); }
/** * Returns the name. * * @return The name. */ @Override public String toString() { return getName() + ((getVersion() == null) ? "" : "/" + getVersion()); }
@Override public void handle(Request request, Response response) { super.handle(request, response); if (getHelper() != null) { getHelper().handle(request, response); } else { StringBuilder sb = new StringBuilder(); sb.append("No available client connector supports the required protocol: "); sb.append("'").append(request.getProtocol().getName()).append("'."); sb.append(" Please add the JAR of a matching connector to your classpath."); response.setStatus(Status.CONNECTOR_ERROR_INTERNAL, sb.toString()); } }
sb.append("'").append(p.getName()).append("' ");
sb.append("'").append(p.getName()).append("' ");
@Override public void handle(Request request, Response response) { Protocol rProtocol = request.getProtocol(); Reference rReference = request.getResourceRef(); Protocol protocol = (rProtocol != null) ? rProtocol : (rReference != null) ? rReference .getSchemeProtocol() : null; if (protocol != null) { Client c = clients.get(protocol); if (c == null) { c = new Client(protocol); clients.put(protocol, c); getLogger().fine( "Added runtime client for protocol: " + protocol.getName()); } c.handle(request, response); } else { response.setStatus(Status.SERVER_ERROR_INTERNAL, "The server isn't properly configured to handle client calls."); getLogger().warning( "There is no protocol detected for this request: " + request.getResourceRef()); } }
/** * Creates the protocol associated to a URI scheme name. If an existing * constant exists then it is returned, otherwise a new instance is created. * * @param name * The scheme name. * @param version * The version number. * @return The associated protocol. */ public static Protocol valueOf(String name, String version) { Protocol result = valueOf(name); if (!version.equals(result.getVersion())) { result = new Protocol(result.getSchemeName(), result.getName(), result.getTechnicalName(), result.getDescription(), result.getDefaultPort(), result.isConfidential(), version); } return result; }
/** * Creates the protocol associated to a URI scheme name. If an existing * constant exists then it is returned, otherwise a new instance is created. * * @param name * The scheme name. * @param version * The version number. * @return The associated protocol. */ public static Protocol valueOf(String name, String version) { Protocol result = valueOf(name); if (!version.equals(result.getVersion())) { result = new Protocol(result.getSchemeName(), result.getName(), result.getTechnicalName(), result.getDescription(), result.getDefaultPort(), result.isConfidential(), version); } return result; }
@Override public RecipientInfoWriter append(RecipientInfo recipientInfo) { if (recipientInfo.getProtocol() != null) { appendToken(recipientInfo.getProtocol().getName()); append('/'); appendToken(recipientInfo.getProtocol().getVersion()); appendSpace(); if (recipientInfo.getName() != null) { append(recipientInfo.getName()); if (recipientInfo.getComment() != null) { appendSpace(); appendComment(recipientInfo.getComment()); } } else { throw new IllegalArgumentException( "The name (host or pseudonym) of a recipient can't be null"); } } else { throw new IllegalArgumentException( "The protocol of a recipient can't be null"); } return this; }
} else if (variableName.equals("p")) { if (this.request.getProtocol() != null) { result = this.request.getProtocol().getName();
/** * Displays a synthesis of the request like an HTTP request line. * * @return A synthesis of the request like an HTTP request line. */ public String toString() { return ((getMethod() == null) ? "" : getMethod().toString()) + " " + ((getResourceRef() == null) ? "" : getResourceRef() .toString()) + " " + ((getProtocol() == null) ? "" : (getProtocol().getName() + ((getProtocol() .getVersion() == null) ? "" : "/" + getProtocol().getVersion()))); }
return (this.request.getMethod() != null) ? this.request.getMethod().getName() : null; case "p": return (this.request.getProtocol() != null) ? this.request.getProtocol().getName() : null; default: if (variableName.startsWith("o")) {