@Immutable public class Server extends Object implements IModeShapeObject
Server
class is the business object for a server that is hosting one or more ModeShape repositories.
The server requires a url, user name, and a password in order to connect. The url
that is used
has a format of http://hostname:port/context root. Where
The deployed war context root is based on what the deployed war file is called. If the ModeShape deployed war is called resources.war (which is the default build name), then the context root would be resources.
Modifier | Constructor and Description |
---|---|
|
Server(String url,
String user,
String password)
Constructs on new
Server . |
protected |
Server(String originalUrl,
String validatedUrl,
String user,
String password)
Constructs on new
Server . |
Modifier and Type | Method and Description |
---|---|
Server |
asValidated(String validatedUrl)
Create a copy of this object that represents a validated URL to a server.
|
boolean |
equals(Object obj) |
String |
getName() |
String |
getOriginalUrl()
Get the original URL that the user supplied.
|
String |
getPassword() |
String |
getShortDescription() |
String |
getUrl() |
String |
getUser() |
int |
hashCode() |
boolean |
hasSameKey(Server otherServer)
A server has the same identifying properties if their URL and user matches.
|
boolean |
isValidated()
Determine whether this server has been
validated . |
String |
toString() |
public Server(String url, String user, String password)
Server
.url
- the server URL, which must contain the deployed war file context (never null
)user
- the server user (may be null
)password
- the server password (may be null
)IllegalArgumentException
- if the URL or user arguments are null
protected Server(String originalUrl, String validatedUrl, String user, String password)
Server
.originalUrl
- the original, user-supplied server URL (may not be null
)validatedUrl
- the validated server URL to which the server can connect, which must contain the deployed war file
context (never null
)user
- the server user (may be null
)password
- the server password (may be null
)IllegalArgumentException
- if the URL or user arguments are null
public Server asValidated(String validatedUrl)
validatedUrl
- the validated URL; may not be nullpublic String getOriginalUrl()
public boolean isValidated()
validated
.public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public String getName()
getName
in interface IModeShapeObject
null
)IModeShapeObject.getName()
public String getPassword()
public String getShortDescription()
getShortDescription
in interface IModeShapeObject
null
)IModeShapeObject.getShortDescription()
public String getUrl()
null
)public String getUser()
null
)public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean hasSameKey(Server otherServer)
otherServer
- the server whose key is being compared (never null
)true
if the servers have the same keyIllegalArgumentException
- if the argument is null
public String toString()
toString
in class Object
Object.toString()
Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.