Package com.bea.wcp.diameter.sh
Class ShApplication
java.lang.Object
com.bea.wcp.diameter.Application
com.bea.wcp.diameter.ClientApplication
com.bea.wcp.diameter.sh.ShApplication
Sh client application. See
3GPP TS 29.328 v6.8.0
and 3GPP TS 29.329 v6.6.0
for Sh protocol details.
- Author:
- Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a new client ShSession.createSession(String id, Object parent) getDocument(AccessKey key) Retrieves the data associated with the specified AccessKey by sending a UDR request and waiting for the corresponding UDA.getId()Returns the Sh application identifier.Returns the RepositoryData for the specified Sh AccessKey.longReturns the current request timeout.voidinit()Initializes the ShApplication.voidputDocument(AccessKey key, Document doc) Updates data for the specified AccessKey by sending a PDR request and waiting for the corresponding PDA.voidputRepositoryData(AccessKey key, RepositoryData rd) Updates repository data for specified AccessKey.protected voidCalled whenever a new PNR message has been received.protected voidrcvRequest(Request req) Called by the container when a new Sh request has been received.voidsetTimeout(long msec) Sets the maximum number of millisecons to wait for an answer from the HSS.voidStarts subscription for the data referred to by the specified AccessKey.voidunsubscribe(AccessKey key) Unsubscribes from the data referred to by the specified AccessKey.Methods inherited from class com.bea.wcp.diameter.Application
createRequest, createSession, createSessionId, getDestinationHost, getDestinationRealm, getName, getNode, getOriginHost, getOriginRealm, getParameter, getParameter, log, log, rcvAnswer, rcvMessage, setDestinationHost, setDestinationRealm
-
Field Details
-
ID
Sh application identifier
-
-
Constructor Details
-
ShApplication
public ShApplication()
-
-
Method Details
-
init
Initializes the ShApplication. The hss host and realm can be configured with the application init parameters "destination.host" and "destination.realm" respectively. The "timeout" parameter can also be optionally used to specific the maximum number of milliseconds to wait for an answer from the HSS. By default, this is 30 seconds.- Overrides:
initin classClientApplication- Throws:
DiameterException- if the initialization failed
-
getId
Returns the Sh application identifier.- Specified by:
getIdin classApplication- Returns:
- the Sh ApplicationId
-
getRepositoryData
Returns the RepositoryData for the specified Sh AccessKey. If the repository data does not exist then an empty RepositoryData instance will be created with a sequence number of 0. See 3GPP TS 29.328 v6.8.0 table 7.6.1 for details on data access key format.- Parameters:
key- the AccessKey for the requested data- Returns:
- the RepositoryData for the key
- Throws:
IllegalArgumentException- if not a repository data AccessKeyMessageException- if the answer from the HSS indicated an errorIOException- if an I/O error occurredDiameterException
-
putRepositoryData
public void putRepositoryData(AccessKey key, RepositoryData rd) throws DiameterException, IOException Updates repository data for specified AccessKey.- Parameters:
key- the AccessKey for the datard- the new RepositoryData- Throws:
MessageException- if the answer from the HSS indicated an errorIOException- if an I/O error occurredDiameterException
-
getDocument
Retrieves the data associated with the specified AccessKey by sending a UDR request and waiting for the corresponding UDA.- Parameters:
key- the AccessKey for the data- Returns:
- the data associated with the key, or null if not found
- Throws:
MessageException- if the answer from the HSS indicated an errorIOException- if an I/O error occurredDiameterException
-
putDocument
Updates data for the specified AccessKey by sending a PDR request and waiting for the corresponding PDA.- Parameters:
key- the AccessKey for the datadoc- the updated user data- Throws:
IllegalArgumentException- if the document format was invalidMessageException- if the answer from the HSS indicated an errorIOException- if an I/O error occurredDiameterException
-
subscribe
Starts subscription for the data referred to by the specified AccessKey.- Parameters:
key- the AccessKey for the data- Throws:
MessageException- if the answer from the HSS indicated an errorIOException- if an I/O error occurredDiameterException
-
unsubscribe
Unsubscribes from the data referred to by the specified AccessKey.- Parameters:
key- the AccessKey for the data- Throws:
MessageException- if the answer from the HSS indicated an errorIOException- if an I/O error occurredDiameterException
-
createSession
Creates a new client ShSession.- Overrides:
createSessionin classApplication- Returns:
- the ShSession for this application
-
createSession
- Overrides:
createSessionin classApplication
-
setTimeout
public void setTimeout(long msec) Sets the maximum number of millisecons to wait for an answer from the HSS. The default timeout is the request timeout value from the general Diameter configuration (30 seconds).- Parameters:
msec- the request timeout in milliseconds
-
getTimeout
public long getTimeout()Returns the current request timeout.- Returns:
- the request timeout in milliseconds, or -1 if the default request timeout should be used
-
rcvRequest
Called by the container when a new Sh request has been received. This request must be PNR since we are Sh client only.- Overrides:
rcvRequestin classApplication- Parameters:
req- the Sh PNR requests- Throws:
DiameterException- if an error occurred while processingIOException- if an I/O error occurred
-
rcvPush
Called whenever a new PNR message has been received. This method should be overridden to provide handling of Push-Notification-Requests from the HSS.- Parameters:
key- the AccessKey for the user datadoc- the updated user data
-