|
Cisco Systems Inc. Confidential | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.pcube.management.api.QuotaManagerApi
public class QuotaManagerApi
The Quota Manager API is a blocking API .Every method returns after its operation has been performed.
The purpose of this API is to be used by user interface systems to view & edit subscriber Quota data on Quota Manager.
Usage examples: TBD
For Support TBD
| Field Summary | |
|---|---|
static int |
ADD_OPERATION
|
static int |
REPLENISH_OPERATION
|
static int |
SET_OPERATION
|
| Fields inherited from interface com.pcube.management.framework.rpc.ErrorCodes |
|---|
ERROR_CODE_API_NOT_CONNECTED, ERROR_CODE_ARRAY_ACCESS, ERROR_CODE_ATTRIBUTE_NOT_FOUND, ERROR_CODE_BAD_SUBSCRIBER_MAPPING, ERROR_CODE_BAD_VPN_MAPPING, ERROR_CODE_CASCADE_OPERATION_VIOLATION, ERROR_CODE_CLASS_CAST, ERROR_CODE_CLASS_NOT_FOUND, ERROR_CODE_DATABASE_EXCEPTION, ERROR_CODE_DOMAIN_NOT_FOUND, ERROR_CODE_FATAL_EXCEPTION, ERROR_CODE_ILLEGAL_ARGUMENT, ERROR_CODE_ILLEGAL_STATE, ERROR_CODE_ILLEGAL_SUBSCRIBER_NAME, ERROR_CODE_INTERRUPTED_EXCEPTION, ERROR_CODE_INVALID_ATTRIBUTE_VALUE, ERROR_CODE_INVALID_BUCKETID, ERROR_CODE_INVALID_BUCKETSIZE, ERROR_CODE_INVALID_PARAMETER, ERROR_CODE_MALFORMED_OBJECT_NAME, ERROR_CODE_N0_QUOTA_INFO_FOR_SUBSCRIBER, ERROR_CODE_NATIVE_METHOD_ARG_ERROR, ERROR_CODE_NATIVE_METHOD_FAILED, ERROR_CODE_NO_APPLICATION_INSTALLED, ERROR_CODE_NO_SUCH_METHOD, ERROR_CODE_NOT_A_SUSBCRIBER_DOMAIN, ERROR_CODE_NULL_POINTER, ERROR_CODE_NUMBER_FORMAT, ERROR_CODE_OBJECT_EXISTS, ERROR_CODE_OBJECT_INTROSPECTION, ERROR_CODE_OBJECT_NOT_COMPLIANT, ERROR_CODE_OBJECT_NOT_FOUND, ERROR_CODE_OBJECT_REGISTRATION, ERROR_CODE_OPERATION_ABORTED, ERROR_CODE_OPERATION_NOT_FOUND, ERROR_CODE_OUT_OF_MEMORY, ERROR_CODE_REPLENISH_FAILED, ERROR_CODE_RESOURCE_SHORTAGE, ERROR_CODE_RUNTIME, ERROR_CODE_SE_ERROR, ERROR_CODE_SUBCRIBER_NOT_ASSIGNED_PROFILE, ERROR_CODE_SUBSCRIBER_DOES_NOT_EXIST, ERROR_CODE_SUBSCRIBER_DOMAIN_ASSOCIATION, ERROR_CODE_SUBSCRIBER_MAPPING_CONGESTION, ERROR_CODE_SUSBSCRIBER_ALREADY_EXISTS, ERROR_CODE_UNKNOWN, ERROR_CODE_VALUE_DOES_NOT_MEET_CONSTRAINTS, ERROR_CODE_VPN_ALREADY_EXISTS, ERROR_CODE_VPN_DOES_NOT_EXIST |
| Constructor Summary | |
|---|---|
QuotaManagerApi()
No Argument Constructor. |
|
QuotaManagerApi(java.lang.String applicationName)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addSubscriberQuota(java.lang.String subscriberName,
int bucketId,
long bucketSize)
Adds quota to specific quota buckets of a subscriber without starting a new aggregation period. |
void |
connect(java.lang.String hostname)
connect to the subscriber manager using the default port. |
void |
connect(java.lang.String hostname,
int port)
connect to the subscriber manager to a user specified port. |
void |
disconnect()
disconnects from the susbcriber manager. |
java.lang.String[] |
getBreachedSubscriberNames(java.lang.String lastBulkEnd,
int numOfSubscribers)
Provides the list of subscribers in breached state. |
java.lang.String |
getClientVersion()
provides the rpc-client version with which this Java QuotaManager API was compiled. |
java.lang.String[] |
getPenaltySubscriberNames(java.lang.String lastBulkEnd,
int numOfSubscribers)
Provides the list of subscribers in penalty state. |
java.lang.String |
getSMVersion()
gets the (peer) SM version |
java.lang.Object[] |
getSubscriberQuotaInformation(java.lang.String subscriberName)
This method is used to get the quota information of the specified subscriber. |
int |
getSubscriberQuotaProfileId(java.lang.String subscriberName)
This method is used to get the subscriber profileId. |
void |
init(java.util.Properties properties)
Initiates some configuration parameters of the client. |
boolean |
isConnected()
tests whether the client is connected |
void |
replenishSubscriberQuota(java.lang.String subscriberName)
Replenish all quota buckets for a subscriber without starting a new aggregation period. |
void |
setDisconnectListener(DisconnectListener disconnectListener)
Sets a disconnect listener. |
void |
setReplyTimeout(long _timeout)
sets a timeout, after which the methods of this API will return (with an exception) if the result has not yet arrived. |
void |
setSubscriberQuota(java.lang.String subscriberName,
int bucketId,
long bucketSize)
Sets quota buckets of a subscriber to new values without starting a new aggregation period. |
java.lang.String |
toString()
Automatically generated method: toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int ADD_OPERATION
public static final int SET_OPERATION
public static final int REPLENISH_OPERATION
| Constructor Detail |
|---|
public QuotaManagerApi()
public QuotaManagerApi(java.lang.String applicationName)
Note:: The application name will be appended with the following suffix: .B.QM-API.J
For example
If the applicationName is 'my-QuotaManager-Application' then the actual applicationName sent at the greeting to the RPC server is 'my-QuotaManager-Application.B.QM-API.J'
applicationName - the name describing this application for failover,
to enable several API instances to work from several
hosts, it is recommended to include the hostname as part of the application name.| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic void init(java.util.Properties properties)
properties - To find out which properties are configurable using this API
please address Cisco's support.
public void connect(java.lang.String hostname)
throws java.lang.Exception
hostname - a host running the SM software
java.lang.Exception
public void connect(java.lang.String hostname,
int port)
throws java.lang.Exception
hostname - a host running the SM softwareport - the port number on which the SM's rpc server listens
java.lang.Exceptionpublic void disconnect()
public boolean isConnected()
public java.lang.String getClientVersion()
public java.lang.String getSMVersion()
public void setDisconnectListener(DisconnectListener disconnectListener)
Sets a disconnect listener.
The API supports only a single disconnect listener. The listener is notified when the API looses connection with the SM.
Important Note:The disconnect listener should not perform long operations from the calling thread. Performing long operations due to a disconnection event should be done in a separate thread. Not following this (strong) recommendation might result in resource leakage on the client side.
disconnectListener - public final void setReplyTimeout(long _timeout)
sets a timeout, after which the methods of this API will return (with an exception) if the result has not yet arrived. The default timeout is to wait for ever.
The timeout can be set again and again before each method call.
_timeout - either a positive number which is the number of milliseconds to wait or zero - wait forever
public void addSubscriberQuota(java.lang.String subscriberName,
int bucketId,
long bucketSize)
throws java.lang.InterruptedException,
OperationTimeoutException,
RpcErrorException
subscriberName - name of the subscriber for whom the quota need to be addedbucketId - the bucketId to which the quota to be addedbucketSize - the size of the bucket
java.lang.InterruptedException - if another thread has interrupted the current thread.
The interrupted status of the current thread is cleared when this exception is thrown.
OperationTimeoutException - if the reply does not return within the timeout period
set by the caller using setReplyTimeout method.
RpcErrorException - this provides all of the functional errors of the SM Java API.
public void replenishSubscriberQuota(java.lang.String subscriberName)
throws java.lang.InterruptedException,
OperationTimeoutException,
RpcErrorException
subscriberName - name of the subscriber for whom the quota need to be replenished
java.lang.InterruptedException - if another thread has interrupted the current thread.
The interrupted status of the current thread is cleared when this exception is thrown.
OperationTimeoutException - if the reply does not return within the timeout period
set by the caller using setReplyTimeout method.
RpcErrorException - this provides all of the functional errors of the SM Java API.
public void setSubscriberQuota(java.lang.String subscriberName,
int bucketId,
long bucketSize)
throws java.lang.InterruptedException,
OperationTimeoutException,
RpcErrorException
subscriberName - name of the subscriber for whom the quota need to be setbucketId - the bucketId to which the quota to be setbucketSize - the size of the bucket
java.lang.InterruptedException - if another thread has interrupted the current thread.
The interrupted status of the current thread is cleared when this exception is thrown.
OperationTimeoutException - if the reply does not return within the timeout period
set by the caller using setReplyTimeout method.
RpcErrorException - this provides all of the functional errors of the SM Java API.
public java.lang.String[] getBreachedSubscriberNames(java.lang.String lastBulkEnd,
int numOfSubscribers)
throws java.lang.InterruptedException,
OperationTimeoutException,
RpcErrorException
lastBulkEnd - lastBulkEnd—Last subscriber name from last bulk.
Use NULL to start with the first (alphabetic) subscriber.numOfSubscribers - Limit on number of subscribers that will be returned.
If this value is higher than the SM limit (1000), the SM limit will be used.
java.lang.InterruptedException - if another thread has interrupted the current thread.
The interrupted status of the current thread is cleared when this exception is thrown.
OperationTimeoutException - if the reply does not return within the timeout period
set by the caller using setReplyTimeout method.
RpcErrorException - this provides all of the functional errors of the SM Java API.
public java.lang.String[] getPenaltySubscriberNames(java.lang.String lastBulkEnd,
int numOfSubscribers)
throws java.lang.InterruptedException,
OperationTimeoutException,
RpcErrorException
lastBulkEnd - lastBulkEnd—Last subscriber name from last bulk.
Use NULL to start with the first (alphabetic) subscriber.numOfSubscribers - Limit on number of subscribers that will be returned.
If this value is higher than the SM limit (1000), the SM limit will be used.
java.lang.InterruptedException - if another thread has interrupted the current thread.
The interrupted status of the current thread is cleared when this exception is thrown.
OperationTimeoutException - if the reply does not return within the timeout period
set by the caller using setReplyTimeout method.
RpcErrorException - this provides all of the functional errors of the SM Java API.
public java.lang.Object[] getSubscriberQuotaInformation(java.lang.String subscriberName)
throws java.lang.InterruptedException,
OperationTimeoutException,
RpcErrorException
subscriberName - name of the subscriber for whom the quota information is to be retrieved.
java.lang.InterruptedException - if another thread has interrupted the current thread.
The interrupted status of the current thread is cleared when this exception is thrown.
OperationTimeoutException - if the reply does not return within the timeout period
set by the caller using setReplyTimeout method.
RpcErrorException - this provides all of the functional errors of the SM Java API.
public int getSubscriberQuotaProfileId(java.lang.String subscriberName)
throws java.lang.InterruptedException,
OperationTimeoutException,
RpcErrorException
subscriberName - name of the subscriber for whose profileId is to be retrieved.
java.lang.InterruptedException - if another thread has interrupted the current thread.
The interrupted status of the current thread is cleared when this exception is thrown.
OperationTimeoutException - if the reply does not return within the timeout period
set by the caller using setReplyTimeout method.
RpcErrorException - this provides all of the functional errors of the SM Java API.
|
Cisco Systems Inc. Confidential | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||