|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ls.lars.communication.LarsNaming
This class represents a simple helper for dealing with agent names. Within this class the following naming conventions are being distinguished:
Method Summary | |
static String |
buildGlobalName(String name)
returns an agent's global name by appending the '@' symbol and this platforms homePlatform . |
static String |
buildGlobalName(String name,
String platformName)
returns an agent's global name by appending the '@' symbol and the given platform name. |
static String |
createAgentName(String localName,
String ipAddress,
String larsId)
creates an agent name from the given elements. if the ipAddress and/or the larsId is null or empty, the current platform's id will be used for creating the agent's name. |
static String |
getLarsId(String name)
returns the lars id as extracted from the given agent name. |
static String |
getLocalName(String name)
returns an agent's local name as extracted from the given name. |
static String |
getPlatformIp(String name)
returns a platform's ip address as extracted from the given agent name. |
static String |
getPlatformName(String name)
returns the platform name as extracted from the given name. |
static boolean |
isGlobalName(String name)
returns whether or not the given name is a global name (that is: the name contains any '@...' platform dependent information. |
static boolean |
isLocalName(String name)
returns whether or not the given name is a local name (that is: the name does not contain any '@...' platform dependent information. |
static boolean |
isValidGlobalName(String name)
returns whether or not the given name is a valid global name. |
static boolean |
isValidIpAddress(String ipAddress)
returns whether or not the given String represents a valid ip address. |
static boolean |
isValidLarsId(String larsId)
returns whether or not the given String represents a valid lars id. |
static boolean |
isValidPlatformName(String name)
returns whether or not the given name is a valid platform name. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static boolean isValidGlobalName(String name)
name
- an agent's global namepublic static boolean isValidPlatformName(String name)
name
- a lars platform's namepublic static boolean isValidIpAddress(String ipAddress)
ipAddress
- the string to checkpublic static boolean isValidLarsId(String larsId)
larsId
- the string to checkpublic static boolean isLocalName(String name)
name
- the name of the agentpublic static boolean isGlobalName(String name)
name
- the name of the agentpublic static String getLocalName(String name)
name
- the name of the agentpublic static String getPlatformName(String name)
name
- the name of the agentMessageRouter.getHomePlatform()
, if no '@' symbol was found
(because then the name is assumed to be local), or name is nullpublic static String getLarsId(String name)
name
- the name of the agentpublic static String getPlatformIp(String name)
name
- the name of the agentpublic static String buildGlobalName(String name)
homePlatform
.name
- the name of the agentpublic static String buildGlobalName(String name, String platformName)
name
- the name of the agentplatformName
- the name of the platformpublic static String createAgentName(String localName, String ipAddress, String larsId)
localName
- the agent's local nameipAddress
- the ip address of the agent's home platformlarsId
- the id of the agent's home platform
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |