|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.ethz.iks.slp.impl.AuthenticatedURL ch.ethz.iks.slp.ServiceURL
public final class ServiceURL
Implementation of the SLP ServiceURL class defined in RFC 2614.
Field Summary | |
---|---|
static int |
LIFETIME_DEFAULT
|
static int |
LIFETIME_MAXIMUM
|
static int |
LIFETIME_NONE
|
static int |
LIFETIME_PERMANENT
|
static int |
NO_PORT
|
Fields inherited from class ch.ethz.iks.slp.impl.AuthenticatedURL |
---|
authBlocks |
Constructor Summary | |
---|---|
ServiceURL(java.lang.String serviceURL,
int lifeTime)
create a new ServiceURL instance from a String. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Check if two instances are equal. |
static ServiceURL |
fromBytes(java.io.DataInputStream input)
Reads a byte stream from a DataInput and constructs a ServiceURL from it, following the RFC 2608 schema: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reserved | Lifetime | URL Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |URL len, contd.| URL (variable length) \ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |# of URL auths | Auth. blocks (if any) \ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ . |
java.lang.String |
getHost()
get the host. |
int |
getLength()
|
int |
getLifetime()
get the lifetime. |
int |
getPort()
get the port. |
java.lang.String |
getProtocol()
get the protocol. |
ServiceType |
getServiceType()
get the service type. |
java.lang.String |
getTransport()
Deprecated. |
java.lang.String |
getURLPath()
get the URL path. |
int |
hashCode()
get the hashCode of the ServiceURL instance. |
boolean |
matches(java.lang.Object obj)
Check if a ServiceURL matches another ServiceURL or a ServiceType. |
java.lang.String |
toString()
get a String representation of the ServiceURL. |
void |
writeTo(java.io.DataOutputStream out)
get the byte representation of the ServiceURL instance. |
Methods inherited from class ch.ethz.iks.slp.impl.AuthenticatedURL |
---|
getAuthBlockLength, parseAuthBlock, sign, verify, writeAuthBlock |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int NO_PORT
public static final int LIFETIME_NONE
public static final int LIFETIME_DEFAULT
public static final int LIFETIME_MAXIMUM
public static final int LIFETIME_PERMANENT
Constructor Detail |
---|
public ServiceURL(java.lang.String serviceURL, int lifeTime) throws ServiceLocationException
serviceURL
- the string representation of a ServiceURL like
service::"serviceType"://"addrspec"where servicetype should be of the form abstractType:concreteType and addrspec is the hostname or dotted decimal notation of the host's address followed by an optional :portNumber. Example:
service:osgi:remote://my.host.ch:9200
lifeTime
- the lifetime of the ServiceURL in seconds.
ServiceLocationException
- if the String is not parsable.Method Detail |
---|
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to compare to.
public boolean matches(java.lang.Object obj)
obj
- a ServiceURL or ServiceType. All other objects will return
false.
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public ServiceType getServiceType()
public java.lang.String getTransport()
public java.lang.String getProtocol()
public java.lang.String getHost()
public int getPort()
public java.lang.String getURLPath()
public int getLifetime()
public void writeTo(java.io.DataOutputStream out) throws java.io.IOException
java.io.IOException
java.io.IOException
- if an internal processing error occurs.public int getLength()
public static ServiceURL fromBytes(java.io.DataInputStream input) throws ServiceLocationException, java.io.IOException
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reserved | Lifetime | URL Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |URL len, contd.| URL (variable length) \ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |# of URL auths | Auth. blocks (if any) \ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.
input
- the DataInput streaming the ServiceURL bytes.
ServiceLocationException
- in case of IO exceptions.
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |