de.fhg.igd.atlas.lsp
Class LSPLookupResult

java.lang.Object
  extended bycodec.asn1.ASN1AbstractType
      extended bycodec.asn1.ASN1OctetString
          extended byde.fhg.igd.atlas.lsp.LSPLookupResult
All Implemented Interfaces:
ASN1Type, Cloneable

public class LSPLookupResult
extends ASN1OctetString

Represents an LSP_Lookup_Result structure of the Location Service Protocol (LSP). Encapsulated in a LSPReply it is sent to the Location Service Client (LSClient) as reply to a LSPLookup request. This class is used by the Location Sevice Server (LSServer) and Location Service Proxy (LSProxy) to transport the requested contact address.

The ASN.1 structure of this reply is as follows

 LSP_Lookup_Result ::= ContactAddress
 ContactAddress    ::= OCTET STRING
 
The contact address should consist of a URL string that specifies the protocol, address, and port of a management service provided by the server, which is in possession of the specified object.

Version:
"$Id: LSPLookupResult.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Jan Peters
See Also:
LSPLookup, LSPRequest, LSPReply

Field Summary
 
Fields inherited from class codec.asn1.ASN1OctetString
 
Fields inherited from class codec.asn1.ASN1AbstractType
 
Constructor Summary
LSPLookupResult()
          Creates an instance ready for decoding.
LSPLookupResult(URL contactAddress)
          Creates an instance with the given contact address..
 
Method Summary
static LSPLookupResult createReply(byte[] code)
          Creates a new reply from the given encoded reply.
 URL getContactAddress()
          Returns the contact address or an empty URL, if the encoded contact address is not well-formed.
 byte[] getEncoded()
          Returns the DER encoded reply.
 String toString()
          Returns the string representation of this reply.
 
Methods inherited from class codec.asn1.ASN1OctetString
byteCount, clone, decode, encode, getByteArray, getTag, getValue, setByteArray
 
Methods inherited from class codec.asn1.ASN1AbstractType
checkConstraints, getConstraint, getTagClass, isExplicit, isOptional, isType, setConstraint, setExplicit, setOptional
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LSPLookupResult

public LSPLookupResult()
Creates an instance ready for decoding.


LSPLookupResult

public LSPLookupResult(URL contactAddress)
Creates an instance with the given contact address..

Parameters:
contactAddress - The contact address.
Method Detail

createReply

public static LSPLookupResult createReply(byte[] code)
                                   throws CorruptedCodeException,
                                          IllegalStateException,
                                          NullPointerException
Creates a new reply from the given encoded reply.

Parameters:
code - The encoded reply.
Returns:
The decoded reply.
Throws:
CorruptedCodeException - if the code is bad.
IllegalStateException - if an error occurs while decoding with DERDecoder (RuntimeException).
NullPointerException - if code is null (RuntimeException).

getContactAddress

public URL getContactAddress()
Returns the contact address or an empty URL, if the encoded contact address is not well-formed.

Returns:
The contact address.

getEncoded

public byte[] getEncoded()
                  throws IllegalStateException
Returns the DER encoded reply.

Returns:
The encoded reply.
Throws:
IllegalStateException - if an exception occures during ASN1 encoding (RuntimeException).

toString

public String toString()
Returns the string representation of this reply. This is done in following manner
 ASN1StructureName {
 Property  : Value
 }
 

Returns:
The string representation.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.