de.fhhannover.inform.trust.ifmapj.channel
Class SsrcImpl

java.lang.Object
  extended by de.fhhannover.inform.trust.ifmapj.channel.SsrcImpl
All Implemented Interfaces:
IfmapChannel, SSRC

public class SsrcImpl
extends Object
implements SSRC


Field Summary
static String VERIFY_PEER_CERT_PROPERTY
           
static String VERIFY_PEER_HOST_PROPERTY
           
 
Constructor Summary
SsrcImpl(String url, KeyManager[] kms, TrustManager[] tms)
          Certificate-based constructor.
SsrcImpl(String url, String user, String pass, TrustManager[] tms)
          Basic-Auth constructor.
 
Method Summary
 void closeTcpConnection()
          Closes the underlying TCP connection.
 void endSession()
          Send endSession request to MAPS
 Result genericRequest(Request req)
          Generic Request Interface
 Result genericRequestWithSessionId(Request req)
           
 ARC getArc()
          Open a ARC corresponding to this SSRC instance
 Integer getMaxPollResSize()
           
 String getPassword()
           
 String getPublisherId()
           
 String getSessionId()
           
 String getUrl()
           
 String getUser()
           
 boolean isBasicAuth()
           
 void newSession()
          Send a newSession request to MAPS
 void newSession(Integer maxPollResSize)
          Send a newSession request to MAPS with the given parameter
 void publish(PublishRequest pr)
          Send a publish request to MAPS.
 void purgePublisher()
          Send purgePublisher request to MAPS in order to purge the MAPCs metadata
 void purgePublisher(String publisherId)
          Send purgePublisher request with the given parameter to MAPS
 void renewSession()
          Send renewSession request to MAPS
 SearchResult search(SearchRequest sr)
          Send a search request to the MAPS
 void setGzip(boolean useGzip)
          Specifies whether GZIP compression should be used.
 void setMaxPollResSize(Integer mprs)
          Set the max-poll-result-size for this channel.
 void setPublisherId(String publisherId)
          Set the ifmap-publisher-id for this channel.
 void setSessionId(String sessionId)
          Set the session-id to be used for this channel.
 void subscribe(SubscribeRequest sr)
          Send a subscribe request to the MAPS.
 boolean usesGzip()
          Indicates whether GZIP compression is used by this channel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.fhhannover.inform.trust.ifmapj.channel.IfmapChannel
closeTcpConnection, genericRequest, genericRequestWithSessionId, setGzip, usesGzip
 

Field Detail

VERIFY_PEER_CERT_PROPERTY

public static final String VERIFY_PEER_CERT_PROPERTY
See Also:
Constant Field Values

VERIFY_PEER_HOST_PROPERTY

public static final String VERIFY_PEER_HOST_PROPERTY
See Also:
Constant Field Values
Constructor Detail

SsrcImpl

public SsrcImpl(String url,
                String user,
                String pass,
                TrustManager[] tms)
         throws InitializationException
Basic-Auth constructor.

Parameters:
url -
user -
pass -
tms -
Throws:
InitializationException

SsrcImpl

public SsrcImpl(String url,
                KeyManager[] kms,
                TrustManager[] tms)
         throws InitializationException
Certificate-based constructor.

Parameters:
url -
kms -
tms -
Throws:
InitializationException
Method Detail

newSession

public void newSession(Integer maxPollResSize)
                throws IfmapErrorResult,
                       IfmapException
Description copied from interface: SSRC
Send a newSession request to MAPS with the given parameter

Specified by:
newSession in interface SSRC
Parameters:
maxPollResSize - the maximum size of poll results that can be processed by the MAPC given in bytes
Throws:
IfmapErrorResult
IfmapException

newSession

public void newSession()
                throws IfmapErrorResult,
                       IfmapException
Description copied from interface: SSRC
Send a newSession request to MAPS

Specified by:
newSession in interface SSRC
Throws:
IfmapErrorResult
IfmapException

endSession

public void endSession()
                throws IfmapErrorResult,
                       IfmapException
Description copied from interface: SSRC
Send endSession request to MAPS

Specified by:
endSession in interface SSRC
Throws:
IfmapErrorResult
IfmapException

renewSession

public void renewSession()
                  throws IfmapErrorResult,
                         IfmapException
Description copied from interface: SSRC
Send renewSession request to MAPS

Specified by:
renewSession in interface SSRC
Throws:
IfmapErrorResult
IfmapException

purgePublisher

public void purgePublisher()
                    throws IfmapErrorResult,
                           IfmapException
Description copied from interface: SSRC
Send purgePublisher request to MAPS in order to purge the MAPCs metadata

Specified by:
purgePublisher in interface SSRC
Throws:
IfmapErrorResult
IfmapException

purgePublisher

public void purgePublisher(String publisherId)
                    throws IfmapErrorResult,
                           IfmapException
Description copied from interface: SSRC
Send purgePublisher request with the given parameter to MAPS

Specified by:
purgePublisher in interface SSRC
Parameters:
publisherId - the publisher-id of the MAPC whose metadata should be purged
Throws:
IfmapErrorResult
IfmapException

publish

public void publish(PublishRequest pr)
             throws IfmapErrorResult,
                    IfmapException
Description copied from interface: SSRC
Send a publish request to MAPS.

Specified by:
publish in interface SSRC
Parameters:
pr - the publish request that is sent
Throws:
IfmapErrorResult
IfmapException

subscribe

public void subscribe(SubscribeRequest sr)
               throws IfmapErrorResult,
                      IfmapException
Description copied from interface: SSRC
Send a subscribe request to the MAPS.

Specified by:
subscribe in interface SSRC
Parameters:
sr - the subscribe request
Throws:
IfmapErrorResult
IfmapException

search

public SearchResult search(SearchRequest sr)
                    throws IfmapErrorResult,
                           IfmapException
Description copied from interface: SSRC
Send a search request to the MAPS

Specified by:
search in interface SSRC
Parameters:
sr - the search request
Returns:
the results of the search
Throws:
IfmapErrorResult
IfmapException

getArc

public ARC getArc()
           throws InitializationException
Description copied from interface: SSRC
Open a ARC corresponding to this SSRC instance

Specified by:
getArc in interface SSRC
Returns:
the new ARC
Throws:
InitializationException

getSessionId

public String getSessionId()
Specified by:
getSessionId in interface IfmapChannel
Returns:
the current session-id for this channel, either set by a call to SSRC.newSession() or IfmapChannel.setSessionId(String), or null if none of these calls was made.

getPublisherId

public String getPublisherId()
Specified by:
getPublisherId in interface IfmapChannel
Returns:
the current ifmap-publisher-id for this channel, either set by a call to SSRC.newSession() or IfmapChannel.setPublisherId(String), or null if none of these calls was made.

getMaxPollResSize

public Integer getMaxPollResSize()
Specified by:
getMaxPollResSize in interface IfmapChannel
Returns:
the current max-poll-result-size for this channel, either set by a call to SSRC.newSession() or IfmapChannel.setMaxPollResSize(Integer), or null if none of these calls was made.

setSessionId

public void setSessionId(String sessionId)
Description copied from interface: IfmapChannel
Set the session-id to be used for this channel. Be aware, calling this on an ARC will change the SSRC object attached to the ARC. Calling it on an SSRC will also change the attached ARC objects for the SSRC.

Specified by:
setSessionId in interface IfmapChannel

setPublisherId

public void setPublisherId(String publisherId)
Description copied from interface: IfmapChannel
Set the ifmap-publisher-id for this channel. Be aware, calling this on an ARC will change the SSRC object attached to the ARC. Calling it on an SSRC will also change the attached ARC objects for the SSRC. This call will only result in having IfmapChannel.getPublisherId() return the set value. Requests won't be influenced.

Specified by:
setPublisherId in interface IfmapChannel

setMaxPollResSize

public void setMaxPollResSize(Integer mprs)
Description copied from interface: IfmapChannel
Set the max-poll-result-size for this channel. Be aware, calling this on an ARC will change the SSRC object attached to the ARC. Calling it on an SSRC will also change the attached ARC objects for the SSRC. This call will only result in having IfmapChannel.getMaxPollResSize() return the set value. Requests won't be influenced.

Specified by:
setMaxPollResSize in interface IfmapChannel

genericRequestWithSessionId

public final Result genericRequestWithSessionId(Request req)
                                         throws IfmapErrorResult,
                                                IfmapException
Specified by:
genericRequestWithSessionId in interface IfmapChannel
Throws:
IfmapErrorResult
IfmapException

genericRequest

public final Result genericRequest(Request req)
                            throws IfmapErrorResult,
                                   IfmapException
Description copied from interface: IfmapChannel
Generic Request Interface

Specified by:
genericRequest in interface IfmapChannel
Returns:
Throws:
IfmapErrorResult
IfmapException

getUrl

public String getUrl()

getUser

public String getUser()

getPassword

public String getPassword()

setGzip

public void setGzip(boolean useGzip)
Description copied from interface: IfmapChannel
Specifies whether GZIP compression should be used.

Specified by:
setGzip in interface IfmapChannel
Parameters:
useGzip - true if GZIP should be used

usesGzip

public boolean usesGzip()
Description copied from interface: IfmapChannel
Indicates whether GZIP compression is used by this channel

Specified by:
usesGzip in interface IfmapChannel
Returns:
true, if GZIP is used

isBasicAuth

public boolean isBasicAuth()
Returns:
whether the channel uses basic authentication

closeTcpConnection

public void closeTcpConnection()
                        throws CommunicationException
Description copied from interface: IfmapChannel
Closes the underlying TCP connection.

Specified by:
closeTcpConnection in interface IfmapChannel
Throws:
CommunicationException


Copyright © 2012 Trust@FHH. All Rights Reserved.