1 package tableappclient.business; 2 3 import tableappclient.spec.AccessData; 4 import tableapp.spec.Access; 5 import tableappclient.business.axis.*; 6 7 15 16 public class AccessDataImpl 17 implements AccessData { 18 private Access access; 19 20 public AccessDataImpl(String hostName, String portNum) { 21 this.access = getAccess(hostName, portNum); 22 } 23 24 private Access getAccess(String hostName, String portNum) { 25 try { 26 WelcomePresentationService service = new 27 WelcomePresentationServiceLocator(); 28 WelcomePresentation welcome; 29 welcome = service.gettableApp(new java.net.URL ("http://"+hostName+":"+portNum+"/tableApp/tableApp")); 30 Access access = welcome.returnAccess(); 31 return access; 32 } 33 catch (Exception exception) { 34 exception.printStackTrace(); 35 return null; 36 } 37 } 38 39 public int getNoAccesses() { 40 return access.getNoAccesses(); 41 } 42 43 public String getAccessTime() { 44 return access.getDate(); 45 } 46 } | Popular Tags |