/** * Creates a new routing table specification for a named protocol. * * @param protocol The name of the protocol that this belongs to. */ public RoutingTableSpec(Utf8String protocol) { this(protocol.toString(), true); }
@Override public String toString() { return utf8.toString(); } public final Utf8String getUtf8() {
@Override public String toString() { return id.toString(); }
@Override public String getName() { return NAME.toString(); }
public String getName() { return NAME.toString(); }
@Override public char charAt(int index) { return toString().charAt(index); } @Override
@Override public int length() { return toString().length(); } @Override
@Override public CharSequence subSequence(int start, int end) { return toString().subSequence(start, end); }
public String toString() { if (cache == null) { cache = createToString(); } return cache.toString(); } public Utf8String toUtf8() {
/** * <p>Returns a named routing table, may return null.</p> * * @param name The name of the routing table to return. * @return The routing table object. */ public RoutingTable getRoutingTable(Utf8String name) { return getRoutingTable(name.toString()); }
/** * <p>Returns a routing policy that corresponds to the argument protocol * name, policy name and policy parameter. This will cache reuse all * policies as soon as they are first requested.</p> * * @param protocolName The name of the protocol to invoke {@link Protocol#createPolicy(String,String)} on. * @param policyName The name of the routing policy to retrieve. * @param policyParam The parameter for the routing policy to retrieve. * @return A corresponding routing policy, or null. */ public RoutingPolicy getRoutingPolicy(Utf8String protocolName, String policyName, String policyParam) { return protocolRepository.getRoutingPolicy(protocolName.toString(), policyName, policyParam); }
private static boolean verifyAny(byte c, byte [] identifier) { if (!((c == '_') || (c == '.') || ((c >= 'a') && (c <= 'z')) || ((c >= '0') && (c <= '9')))) { throw new IllegalArgumentException("Illegal character '" + (char)c + "' of identifier '" + new Utf8String(new Utf8Array(identifier)).toString() +"'."); } return true; }
private static boolean verifyAny(byte c, byte [] identifier) { if ((c >= 'A') && (c <= 'Z')) { throw new IllegalArgumentException("Illegal uppercase character '" + (char)c + "' of identifier '" + new Utf8String(new Utf8Array(identifier)).toString() +"'."); } return true; }
private static boolean verifyFirst(byte c, byte [] identifier) { if (!((c == '_') || ((c >= 'a') && (c <= 'z')))) { throw new IllegalArgumentException("Illegal starting character '" + (char)c + "' of identifier '" + new Utf8String(new Utf8Array(identifier)).toString() +"'."); } return true; } private static boolean verifyAny(byte c, byte [] identifier) {
private static boolean verifyFirst(byte c, byte [] identifier) { if (!((c == '_') || ((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')))) { throw new IllegalArgumentException("Illegal starting character '" + (char)c + "' of identifier '" + new Utf8String(new Utf8Array(identifier)).toString() +"'."); } return true; } private static boolean verifyAny(byte c, byte [] identifier) {
private static boolean verifyAny(byte c, byte [] identifier) { if (!((c == '_') || ((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')) || ((c >= '0') && (c <= '9')))) { throw new IllegalArgumentException("Illegal character '" + (char)c + "' of identifier '" + new Utf8String(new Utf8Array(identifier)).toString() +"'."); } return true; } }
public DocumentId readDocumentId() { Utf8String uri = new Utf8String(parseNullTerminatedString(getBuf().getByteBuffer())); return DocumentId.createFromSerialized(uri.toString()); }
public DocumentId readDocumentId() { Utf8String uri = new Utf8String(parseNullTerminatedString(getBuf().getByteBuffer())); return DocumentId.createFromSerialized(uri.toString()); }
public DocumentType readDocumentType() { Utf8Array docTypeName = parseNullTerminatedString(); int ignored = getShort(null); // used to hold the version DocumentType docType = manager.getDocumentType(new DataTypeName(docTypeName)); if (docType == null) { throw new DeserializationException("No known document type with name " + new Utf8String(docTypeName).toString()); } return docType; }
public DocumentType readDocumentType() { Utf8Array docTypeName = parseNullTerminatedString(); int ignored = getShort(null); // used to hold the version DocumentType docType = manager.getDocumentType(new DataTypeName(docTypeName)); if (docType == null) { throw new DeserializationException("No known document type with name " + new Utf8String(docTypeName).toString()); } return docType; }