Class CGUtils
- java.lang.Object
-
- org.wso2.carbon.cloud.gateway.common.CGUtils
-
public class CGUtils extends Object
-
-
Method Summary
-
-
-
Method Detail
-
getCGThriftClient
public static CloudGatewayService.Client getCGThriftClient(String hostName, int port, int timeOut, String trustStorePath, String trustStorePassWord)
Returns an instance of CG_TRANSPORT_NAME thrift client- Parameters:
hostName
- thrift server host nameport
- thrift server port client should connect totimeOut
- the thrift client timeouttrustStorePath
- the trust store to use for this clienttrustStorePassWord
- the password of the trust store- Returns:
- a CG_TRANSPORT_NAME thrift client
-
moveElements
public static void moveElements(BlockingQueue<Message> src, List<Message> dest, int blockSize) throws org.apache.axis2.AxisFault
Move elements between buffers. No need of additional synchronization locks, BlockingQueue#drainTo is thread safe, but not atomic, which is not a problem. SeeBlockingQueue.drainTo(java.util.Collection, int)
- Parameters:
src
- source bufferdest
- destination bufferblockSize
- blockSize of message bulk that need to move- Throws:
org.apache.axis2.AxisFault
- in case of drains fails
-
getKeyStoreFilePath
public static String getKeyStoreFilePath()
-
getWSO2KeyStoreFilePath
public static String getWSO2KeyStoreFilePath()
-
getTrustStoreFilePath
public static String getTrustStoreFilePath()
-
getWSO2TrustStoreFilePath
public static String getWSO2TrustStoreFilePath()
-
getKeyStorePassWord
public static String getKeyStorePassWord()
-
getWSO2KeyStorePassword
public static String getWSO2KeyStorePassword()
-
getTrustStorePassWord
public static String getTrustStorePassWord()
-
getWSO2TrustStorePassword
public static String getWSO2TrustStorePassword()
-
getIntProperty
public static int getIntProperty(String name, int def)
-
getLongProperty
public static long getLongProperty(String name, long def)
-
getDoubleProperty
public static double getDoubleProperty(String name, double def)
-
getCGThriftServerHostName
public static String getCGThriftServerHostName() throws SocketException
- Throws:
SocketException
-
getCGThriftServerPort
public static int getCGThriftServerPort()
-
getUserNameFromTenantUserName
public static String getUserNameFromTenantUserName(String tenantUserName)
-
getDomainNameFromTenantUserName
public static String getDomainNameFromTenantUserName(String tenantUserName)
-
getPlainToken
public static String getPlainToken(String encryptedToken) throws org.wso2.carbon.core.util.CryptoException
- Throws:
org.wso2.carbon.core.util.CryptoException
-
isServerAlive
public static boolean isServerAlive(String host, int port)
-
getPermissionsList
public static String[] getPermissionsList()
-
dumpBytesAsString
public static void dumpBytesAsString(ByteArrayOutputStream baos)
-
dumpInputStreamAsString
public static void dumpInputStreamAsString(InputStream is) throws IOException
- Throws:
IOException
-
-