Class CGAgentUtils


  • public class CGAgentUtils
    extends Object
    • Method Detail

      • getSessionCookie

        public static String getSessionCookie​(String serverUrl,
                                              String userName,
                                              String password,
                                              String domainName,
                                              String hostName)
                                       throws SocketException,
                                              RemoteException,
                                              org.wso2.carbon.authenticator.stub.LoginAuthenticationExceptionException
        Returns the session cookie given the admin credentials
        Parameters:
        serverUrl - the server url
        userName - user name
        password - password
        domainName - Domain Name
        hostName - host name of the remote server
        Returns:
        the session cookie
        Throws:
        SocketException - throws in case of a socket exception
        org.wso2.carbon.authenticator.stub.LoginAuthenticationExceptionException - throws in case of a authentication failure
        RemoteException - throws in case of a connection failure
      • getCGServerBean

        public static org.wso2.carbon.cloud.gateway.common.CGServerBean getCGServerBean​(org.wso2.carbon.registry.api.Resource resource)
                                                                                 throws org.wso2.carbon.cloud.gateway.common.CGException
        Create the CGServerBean from the registry resource
        Parameters:
        resource - the csg server meta information collection
        Returns:
        the CSGServer bean created from the meta information
        Throws:
        org.wso2.carbon.cloud.gateway.common.CGException - throws in case of an error
      • persistServer

        public static void persistServer​(org.wso2.carbon.registry.core.Registry registry,
                                         org.wso2.carbon.cloud.gateway.common.CGServerBean csgServer)
                                  throws org.wso2.carbon.cloud.gateway.common.CGException
        Persist the server into registry
        Parameters:
        registry - registry instance
        csgServer - csg server instance
        Throws:
        org.wso2.carbon.cloud.gateway.common.CGException - throws in case of an error
      • isClientAxis2XMLExists

        public static boolean isClientAxis2XMLExists()
        Check if we have a client axis2.xml ( for example in ESB)
        Returns:
        true if we have client axis2.xml, false otherwise
      • getOMElementFromURI

        public static org.apache.axiom.om.OMNode getOMElementFromURI​(String wsdlURI)
                                                              throws org.wso2.carbon.cloud.gateway.common.CGException
        Throws:
        org.wso2.carbon.cloud.gateway.common.CGException
      • getWSDLElement

        public static org.apache.axiom.om.OMElement getWSDLElement​(String wsdlLocation)
                                                            throws org.wso2.carbon.cloud.gateway.common.CGException
        Throws:
        org.wso2.carbon.cloud.gateway.common.CGException