Ok thanks!
I was using this to make the ce connection that standard way which filenet provides to checkin the document. Not able to find any api to get connection object in custom plugin which can be passed to custom application to create filenet connection.
con = Factory.Connection.getConnection(uri);
Subject sub = UserContext.createSubject(con, userName, password, null);
uc.pushSubject(sub);
dom = fetchDomain();
domainName = dom.get_Name();
#IBMContentNavigator(ICN)#Support#SupportMigration