|
SAP CC 1.0
API 4.2 (Core) |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.highdeal.cnd.message.StatelessServiceClient
public class StatelessServiceClient
This class allows a user to send some stateless rating and pre-rating event to SAP Convergent Charging 1.0 Rating Instances
by using an efficient message protocol based on TCP/IP.
When a timeout is associated to a given message client, it must be performed during this limited time.
If this limited time is exceeded, the operation is rolled back but client timeout does not guarantee that related
operations successfully ended (see Technical Reference Guide).
| Field Summary | |
|---|---|
static int |
POST_RATE_CANCELLATION
|
static int |
POST_RATE_CONFIRMATION
|
| Constructor Summary | |
|---|---|
StatelessServiceClient()
Creates a non-initialized stateless service client. |
|
StatelessServiceClient(java.lang.String hostName,
int port)
Creates a stateless service client and connect it to a server. |
|
StatelessServiceClient(java.lang.String hostName,
int port,
FoundLostRatingListener ratingListener)
Creates a stateless service client and connect it to a server. |
|
StatelessServiceClient(java.lang.String hostName,
int port,
FoundLostRatingListener ratingListener,
int timeout)
Creates a stateless service client and connect it to a server. |
|
StatelessServiceClient(java.lang.String hostName,
int port,
int timeout)
Creates a stateless service client and connect it to a server. |
|
StatelessServiceClient(java.lang.String hostName,
int port,
java.lang.String bindAddress,
FoundLostRatingListener ratingListener,
int timeout)
Creates a stateless service client and connect it to a server. |
|
| Method Summary | |
|---|---|
protected boolean |
checkDB()
This method is for internal use only. |
void |
close()
Closes the connection. |
void |
connect(InstanceMap imap,
java.lang.String bindAddress,
FoundLostRatingListener ratingListener,
int timeout,
ServiceClientTuning config)
|
void |
connect(java.lang.String hostName,
int port)
Connect this stateless service client using the round robin with the server. |
void |
connect(java.lang.String hostName,
int port,
FoundLostRatingListener ratingListener)
Connect this stateless service client using the round robin with the server. |
void |
connect(java.lang.String hostName,
int port,
int timeout)
Connect this stateless service client using the round robin with the server. |
void |
connect(java.lang.String hostName,
int port,
java.lang.String bindAddress,
FoundLostRatingListener ratingListener,
int timeout)
Connect this stateless service client using the round robin with the server. |
void |
connect(java.lang.String hostName,
int port,
java.lang.String bindAddress,
FoundLostRatingListener ratingListener,
int timeout,
ServiceClientTuning config)
Connect this stateless service client using the round robin with the server. |
protected int |
currentQueueSize()
This method is for internal use only. |
BootMode |
getBootMode()
Returns which API is used to retrieve from the remote instances, the Instance Map needed for the connection. |
java.lang.String |
getClusterName()
Gets the name of the cluster. |
FoundLostRatingListener |
getFoundLostRatingListener()
Returns the FoundLostRatingListener previously set. |
int |
getTimeout()
Returns the timeout in milliseconds for each request (or -1 to wait indefinitively) |
boolean |
isConnected()
Gets the connected status. |
void |
setBootMode(BootMode mode)
Defines which API will be used to retrieve from the remote instances, the Instance Map needed for the connection. |
void |
setClusterName(java.lang.String clusterName)
Sets cluster name. |
void |
setFoundLostRatingListener(FoundLostRatingListener ratingListener)
Sets the FoundLostRatingListener that will be notified each time a Rating Instance will be
found or lost. |
StatelessPostRateResult |
statelessPostRate(long reservationUID,
StatelessPreRatingContext preRatingContext,
int resolution,
boolean withDetails,
ChargeableItem newCi)
This method is dedicated to the stateless post-rating. |
StatelessPostRateResult |
statelessPostRate(long reservationUID,
StatelessPreRatingContext preRatingContext,
int resolution,
java.lang.String[] retainedDetails,
ChargeableItem newCi)
Similar to statelessPostRate(long, StatelessPreRatingContext, int, boolean, ChargeableItem),
but with finest selection of resulting transaction details. |
StatelessPreRateResult |
statelessPreRate(StatelessRatingEvent ratingEvent,
java.lang.String chargeCode,
StatelessPreRatingContext preRatingContext,
java.util.Date ratingDate,
long reservationUID,
long postrateDeadline,
boolean withDetails,
boolean checkDates)
This method is dedicated to the stateless pre-rating. |
StatelessPreRateResult |
statelessPreRate(StatelessRatingEvent ratingEvent,
java.lang.String chargeCode,
StatelessPreRatingContext preRatingContext,
java.util.Date ratingDate,
long reservationUID,
long postrateDeadline,
java.lang.String[] retainedDetails,
boolean checkDates)
Similar to statelessPreRate(StatelessRatingEvent, String, StatelessPreRatingContext, Date, long, long, boolean, boolean),
but with finest selection of resulting transaction details. |
StatelessRateResult |
statelessRate(java.lang.String chargeCode,
java.util.Date ratingDate,
StatelessRatingEvent event,
StatelessRatingContext context,
boolean withDetails,
boolean checkDates)
This method is dedicated to the stateless rating. |
StatelessRateResult |
statelessRate(java.lang.String chargeCode,
java.util.Date ratingDate,
StatelessRatingEvent event,
StatelessRatingContext context,
java.lang.String[] retainedDetails,
boolean checkDates)
Similar to statelessRate(String, Date, StatelessRatingEvent, StatelessRatingContext, boolean, boolean),
but with finest selection of resulting transaction details. |
java.lang.Object[] |
translate(java.lang.String tableCode,
int operator,
java.util.Date date,
java.util.Date referenceDate,
java.lang.String[] inValues)
Translates some values by using a translation table. |
java.lang.Object[] |
translate(java.lang.String tableCode,
int operator,
java.util.Date date,
java.lang.String[] inValues)
Translates some values by using a translation table. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int POST_RATE_CONFIRMATION
public static final int POST_RATE_CANCELLATION
| Constructor Detail |
|---|
public StatelessServiceClient()
throws java.io.IOException
One of the methods connect() must then be used to connect it to a server.
java.io.IOException - if an error occurred reading the currency resources.
public StatelessServiceClient(java.lang.String hostName,
int port)
throws java.io.IOException
hostName - the host name of the server.port - the port on which the server waits for request.
java.io.IOException - if the client cannot connect to the server (if server is not running, for instance)
or if an error occurred reading the currency resources.
public StatelessServiceClient(java.lang.String hostName,
int port,
int timeout)
throws java.io.IOException
hostName - the host name of the server.port - the port on which the server waits for request.timeout - the timeout for the client's requests.
java.io.IOException - if the client cannot connect to the server (if server is not running, for instance)
or if an error occurred reading the currency resources.
public StatelessServiceClient(java.lang.String hostName,
int port,
FoundLostRatingListener ratingListener)
throws java.io.IOException
hostName - the host name of the server.port - the port on which the server waits for request.ratingListener - the listener informed when rating is found or lost.
java.io.IOException - if the client cannot connect to the server (if server is not running, for instance)
or if an error occurred reading the currency resources.
public StatelessServiceClient(java.lang.String hostName,
int port,
FoundLostRatingListener ratingListener,
int timeout)
throws java.io.IOException
hostName - the host name of the server.port - the port on which the server waits for request.ratingListener - the listener informed when rating is found or lost.timeout - the timeout for the client request.
java.io.IOException - if the client cannot connect to the server (if server is not running, for instance)
or if an error occurred reading the currency resources.
public StatelessServiceClient(java.lang.String hostName,
int port,
java.lang.String bindAddress,
FoundLostRatingListener ratingListener,
int timeout)
throws java.io.IOException
hostName - the host name of the server.port - the port on which the server waits for request.bindAddress - address to bind description.ratingListener - the listener informed when rating is found or lost.timeout - the timeout for the client request.
java.io.IOException - if the client cannot connect to the server (if server is not running, for instance)
or if an error occurred reading the currency resources.| Method Detail |
|---|
public void setBootMode(BootMode mode)
mode - is MESSAGE_BOOT_MODE to use the Message Api or is HTTP_BOOT_MODE to use the Http api.public BootMode getBootMode()
MESSAGE_BOOT_MODE if the Message Api is used or HTTP_BOOT_MODE if the Http api is used.public int getTimeout()
public void setClusterName(java.lang.String clusterName)
clusterName - the name of the cluster.public java.lang.String getClusterName()
public void setFoundLostRatingListener(FoundLostRatingListener ratingListener)
FoundLostRatingListener that will be notified each time a Rating Instance will be
found or lost.
public FoundLostRatingListener getFoundLostRatingListener()
FoundLostRatingListener previously set.
setFoundLostRatingListener(FoundLostRatingListener)
public void connect(java.lang.String hostName,
int port)
throws java.io.IOException
hostName - the host name of the server.port - the port on which the server waits for request.
java.io.IOException - if the client cannot connect to the server (if
server is not running, for instance).
public void connect(java.lang.String hostName,
int port,
int timeout)
throws java.io.IOException
hostName - the host name of the server.port - the port on which the server waits for request.timeout - the timeout for the client's requests.
java.io.IOException - if the client cannot connect to the server (if server is not running, for instance).
public void connect(java.lang.String hostName,
int port,
FoundLostRatingListener ratingListener)
throws java.io.IOException
hostName - the host name of the server.port - the port on which the server waits for request.ratingListener - the FoundLostRatingListener that will be notified
each time a Rating Instance will be found or lost.
java.io.IOException - if the client cannot connect to the server (if server is not running, for instance).
public void connect(java.lang.String hostName,
int port,
java.lang.String bindAddress,
FoundLostRatingListener ratingListener,
int timeout)
throws java.io.IOException
hostName - the host name of the server.port - the port on which the server waits for request.bindAddress - the address to bind description.ratingListener - the FoundLostRatingListener that will be notified
each time a Rating Instance will be found or lost.timeout - the timeout for the clients request.
java.io.IOException - if the client cannot connect to the server (if server is not running, for instance).
public void connect(java.lang.String hostName,
int port,
java.lang.String bindAddress,
FoundLostRatingListener ratingListener,
int timeout,
ServiceClientTuning config)
throws java.io.IOException
hostName - the host name of the server.port - the port on which the server waits for request.bindAddress - the address to bind description.ratingListener - the FoundLostRatingListener that will be notified
each time a Rating Instance will be found or lost.timeout - the timeout for the clients request.config - a tuned configuration for this client, can be null.
java.io.IOException - if the client cannot connect to the server (if server is not running, for instance).
public void connect(InstanceMap imap,
java.lang.String bindAddress,
FoundLostRatingListener ratingListener,
int timeout,
ServiceClientTuning config)
throws java.io.IOException
java.io.IOException
public StatelessRateResult statelessRate(java.lang.String chargeCode,
java.util.Date ratingDate,
StatelessRatingEvent event,
StatelessRatingContext context,
boolean withDetails,
boolean checkDates)
throws StatelessRateException,
InvalidItemException,
ForbiddenChargeException,
CommunicationFailureException,
ServerFailureException
This method should not be used on a StatelessRatingContext
which is embeded into a StatelessPreRatingContext.
See StatelessPreRatingContext documentation.
chargeCode - The code of the charge.ratingDate - The date of the rating.event - The event to rate.context - The context of the rating.withDetails - With all or main details in results.checkDates - Check date chronology.
StatelessRateException - when the rate stateless fails.
InvalidItemException - when the item is invalid.
ForbiddenChargeException - when the charge process is forbidden (no access, agreement is not valid any longer, the price plan forbids charging or when arguments are not correct).
CommunicationFailureException - if all the raters are unavailable.
ServerFailureException - if a failure occurred on server side.
public StatelessRateResult statelessRate(java.lang.String chargeCode,
java.util.Date ratingDate,
StatelessRatingEvent event,
StatelessRatingContext context,
java.lang.String[] retainedDetails,
boolean checkDates)
throws StatelessRateException,
InvalidItemException,
ForbiddenChargeException,
CommunicationFailureException,
ServerFailureException
statelessRate(String, Date, StatelessRatingEvent, StatelessRatingContext, boolean, boolean),
but with finest selection of resulting transaction details.
Indeed, the retainedDetails parameter enables to list the
transaction details to retain in the resulting transaction(s).
When retainedDetails is null, this is
equivalent to
statelessRate(chargeCode, ratingDate, event, context, false, checkDates).
Main details that are present in this case are always present, whatever
the content of retainedDetails is.
chargeCode - The code of the charge.ratingDate - The date of the rating.event - The event to rate.context - The context of the rating.retainedDetails - list of names of transaction details to retain in
resulting transaction(s).checkDates - Check date chronology.
StatelessRateException - when the rate stateless fails.
InvalidItemException - when the item is invalid.
ForbiddenChargeException - when the charge process is forbidden (no access, agreement is not valid any longer, the price plan forbids charging or when arguments are not correct).
CommunicationFailureException - if all the raters are unavailable.
ServerFailureException - if a failure occurred on server side.statelessRate(String, Date, StatelessRatingEvent, StatelessRatingContext, boolean, boolean)
public java.lang.Object[] translate(java.lang.String tableCode,
int operator,
java.util.Date date,
java.lang.String[] inValues)
throws DoesNotExistException,
CommunicationFailureException,
ServerFailureException
tableCode - the code of the translation table which must be used.operator - the comparison operatordate - the version date of the translation tableinValues - an array of String which represents the input values
Object
DoesNotExistException - thrown if the translation table does
not exist
CommunicationFailureException - if all the raters are unavailable.
ServerFailureException - if a failure occurred on server side.TranslateValueOp
public java.lang.Object[] translate(java.lang.String tableCode,
int operator,
java.util.Date date,
java.util.Date referenceDate,
java.lang.String[] inValues)
throws DoesNotExistException,
CommunicationFailureException,
ServerFailureException
tableCode - the code of the translation table which must be used.operator - the comparison operatordate - the version date of the translation tablereferenceDate - the reference date used to check column "start date" and column "end date"inValues - an array of String which represents the input values
Object
DoesNotExistException - thrown if the translation table does
not exist
CommunicationFailureException - if all the raters are unavailable.
ServerFailureException - if a failure occurred on server side.TranslateValueOp
public StatelessPreRateResult statelessPreRate(StatelessRatingEvent ratingEvent,
java.lang.String chargeCode,
StatelessPreRatingContext preRatingContext,
java.util.Date ratingDate,
long reservationUID,
long postrateDeadline,
boolean withDetails,
boolean checkDates)
throws StatelessPreRatingException,
StatelessRateException,
InvalidItemException,
ForbiddenChargeException,
CommunicationFailureException,
ServerFailureException
After a call to this method, the passed StatelessPreRatingContext
is not modified. It must be updated (if needed) explicitly calling
the StatelessPreRateResult.update(StatelessPreRatingContext)
method of the result.
The underlying rating is done using the StatelessRatingContext
associated with the charge code in the
given StatelessPreRatingContext.
If no such StatelessRatingContext exists, it's created
(it will be then really added in the StatelessPreRatingContext
by the further call to
StatelessPreRateResult.update(StatelessPreRatingContext)).
See also StatelessPreRatingContext documentation for limitation
and constraints to follow.
ratingEvent - the event to rate.chargeCode - the code of the charge.preRatingContext - the context of the stateless pre-rating.ratingDate - a date based on which the chargeable item is rated.reservationUID - the unique identifier of the reservation.postrateDeadline - the delay after which the availability of pending
pre-rating is no longer guarantied in case of post-rate call using
the related reservationUID. A value <= 0 means the pre-rating is
'auto-confirmed' and not available for post-rate.withDetails - with all or main details in results.checkDates - check date chronology.
StatelessPreRatingException - when the pre rate stateless fails.
StatelessRateException - when the rate stateless fails.
InvalidItemException - when the item is invalid.
ForbiddenChargeException - when the charge process is forbidden (no access, agreement is not valid any longer, the price plan forbids charging or when arguments are not correct).
CommunicationFailureException - if all the raters are unavailable.
ServerFailureException - if a failure occurred on server side.
public StatelessPreRateResult statelessPreRate(StatelessRatingEvent ratingEvent,
java.lang.String chargeCode,
StatelessPreRatingContext preRatingContext,
java.util.Date ratingDate,
long reservationUID,
long postrateDeadline,
java.lang.String[] retainedDetails,
boolean checkDates)
throws StatelessPreRatingException,
StatelessRateException,
InvalidItemException,
ForbiddenChargeException,
CommunicationFailureException,
ServerFailureException
statelessPreRate(StatelessRatingEvent, String, StatelessPreRatingContext, Date, long, long, boolean, boolean),
but with finest selection of resulting transaction details.
Indeed, the retainedDetails parameter enables to list the
transaction details to retain in the resulting transaction(s).
When retainedDetails is null, this is
equivalent to
statelessRate(chargeCode, ratingDate, event, context, false, checkDates).
Main details that are present in this case are always present, whatever
the content of retainedDetails is.
ratingEvent - the event to rate.chargeCode - the code of the charge.preRatingContext - the context of the stateless pre-rating.ratingDate - a date based on which the chargeable item is rated.reservationUID - the unique identifier of the reservation.postrateDeadline - the delay after which the availability of pending
pre-rating is no longer guarantied in case of post-rate call using
the related reservationUID. A value <= 0 means the pre-rating is
'auto-confirmed' and not available for post-rate.retainedDetails - list of names of transaction details to retain in
resulting transaction(s).checkDates - check date chronology.
StatelessPreRatingException - when the pre rate stateless fails.
StatelessRateException - when the rate stateless fails.
InvalidItemException - when the item is invalid.
ForbiddenChargeException - when the charge process is forbidden (no access, agreement is not valid any longer, the price plan forbids charging or when arguments are not correct).
CommunicationFailureException - if all the raters are unavailable.
ServerFailureException - if a failure occurred on server side.statelessPreRate(StatelessRatingEvent, String, StatelessPreRatingContext, Date, long, long, boolean, boolean)
public StatelessPostRateResult statelessPostRate(long reservationUID,
StatelessPreRatingContext preRatingContext,
int resolution,
boolean withDetails,
ChargeableItem newCi)
throws StatelessPreRatingException,
StatelessRateException,
InvalidItemException,
ForbiddenChargeException,
CommunicationFailureException,
ServerFailureException
After a call to this method, the passed StatelessPreRatingContext
is not modified. It must be updated (if needed) explicitly calling
the StatelessPostRateResult.update(StatelessPreRatingContext)
method of the result.
reservationUID - the unique identifier of the reservation.preRatingContext - the context of the stateless pre-rating.resolution - the resolution (one of POST_RATE_CONFIRMATION
or POST_RATE_CONFIRMATION).withDetails - with all or main details in results.newCi - the new chargeable item, in case of confirmation with new CI.
StatelessPreRatingException - when the pre rate stateless fails.
StatelessRateException - when the rate stateless fails.
InvalidItemException - when the item is invalid.
ForbiddenChargeException - when the charge process is forbidden (no access, agreement is not valid any longer, the price plan forbids charging or when arguments are not correct).
CommunicationFailureException - if all the raters are unavailable.
ServerFailureException - if a failure occurred on server side.
public StatelessPostRateResult statelessPostRate(long reservationUID,
StatelessPreRatingContext preRatingContext,
int resolution,
java.lang.String[] retainedDetails,
ChargeableItem newCi)
throws StatelessPreRatingException,
StatelessRateException,
InvalidItemException,
ForbiddenChargeException,
CommunicationFailureException,
ServerFailureException
statelessPostRate(long, StatelessPreRatingContext, int, boolean, ChargeableItem),
but with finest selection of resulting transaction details.
Indeed, the retainedDetails parameter enables to list the
transaction details to retain in the resulting transaction(s).
When retainedDetails is null, this is
equivalent to
statelessRate(chargeCode, ratingDate, event, context, false, checkDates).
Main details that are present in this case are always present, whatever
the content of retainedDetails is.
reservationUID - the unique identifier of the reservation.preRatingContext - the context of the stateless pre-rating.resolution - the resolution (one of POST_RATE_CONFIRMATION
or POST_RATE_CONFIRMATION).retainedDetails - list of names of transaction details to retain in
resulting transaction(s).newCi - the new chargeable item, in case of confirmation with new CI.
StatelessPreRatingException - when the pre rate stateless fails.
StatelessRateException - when the rate stateless fails.
InvalidItemException - when the item is invalid.
ForbiddenChargeException - when the charge process is forbidden (no access, agreement is not valid any longer, the price plan forbids charging or when arguments are not correct).
CommunicationFailureException - if all the raters are unavailable.
ServerFailureException - if a failure occurred on server side.statelessPostRate(long, StatelessPreRatingContext, int, boolean, ChargeableItem)public boolean isConnected()
public void close()
protected int currentQueueSize()
throws CommunicationFailureException
CommunicationFailureException
protected boolean checkDB()
throws CommunicationFailureException
CommunicationFailureException
|
SAP CC 1.0
API 4.2 (Core) |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
SAP Convergent Charging 1.0 (build R4.2.1.35.0.0)
CONVERGENT CHARGING 4.2
(c) Copyright 2009 SAP AG. All rights reserved.