com.alipay.remoting.rpc
Class RpcAddressParser

java.lang.Object
  extended by com.alipay.remoting.rpc.RpcAddressParser
All Implemented Interfaces:
RemotingAddressParser

public class RpcAddressParser
extends Object
implements RemotingAddressParser

This is address parser for RPC.

Normal format

host:port?paramkey1=paramvalue1&paramkey2=paramvalue2

Normal format example

127.0.0.1:12200?KEY1=VALUE1&KEY2=VALUE2

Illegal format example

 127.0.0.1
 127.0.0.1:
 127.0.0.1:12200?
 127.0.0.1:12200?key1=
 127.0.0.1:12200?key1=value1&
 


Field Summary
 
Fields inherited from interface com.alipay.remoting.RemotingAddressParser
AND, COLON, EQUAL, QUES
 
Constructor Summary
RpcAddressParser()
           
 
Method Summary
 void initUrlArgs(Url url)
          Initialize Url arguments
 Url parse(String url)
          Parse a simple string url to get Url
 String parseProperty(String addr, String propKey)
          Parse to get property value according to specified property key
 String parseUniqueKey(String url)
          Parse a simple string url to get a unique key of a certain address
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RpcAddressParser

public RpcAddressParser()
Method Detail

parse

public Url parse(String url)
Description copied from interface: RemotingAddressParser
Parse a simple string url to get Url

Specified by:
parse in interface RemotingAddressParser
Returns:
parsed Url
See Also:
RemotingAddressParser.parse(java.lang.String)

parseUniqueKey

public String parseUniqueKey(String url)
Description copied from interface: RemotingAddressParser
Parse a simple string url to get a unique key of a certain address

Specified by:
parseUniqueKey in interface RemotingAddressParser
Returns:
See Also:
RemotingAddressParser.parseUniqueKey(java.lang.String)

parseProperty

public String parseProperty(String addr,
                            String propKey)
Description copied from interface: RemotingAddressParser
Parse to get property value according to specified property key

Specified by:
parseProperty in interface RemotingAddressParser
Returns:
propValue
See Also:
RemotingAddressParser.parseProperty(java.lang.String, java.lang.String)

initUrlArgs

public void initUrlArgs(Url url)
Description copied from interface: RemotingAddressParser
Initialize Url arguments

Specified by:
initUrlArgs in interface RemotingAddressParser
See Also:
RemotingAddressParser.initUrlArgs(Url)


Copyright © 2018. All rights reserved.