1. /*
  2. * Copyright 2001-2002,2004 The Apache Software Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *
  16. */
  17. package org.apache.tools.ant.taskdefs.optional.sitraka;
  18. /**
  19. * Define a host and port to connect to if you want to do remote viewing.
  20. * <tt><socket/></tt> defaults to host 127.0.0.1 and port 4444
  21. *
  22. * Otherwise it requires the host and port attributes to be set:
  23. * <tt>
  24. * <socket host="e;175.30.12.1"e; port="e;4567"e;/>
  25. * </tt>
  26. */
  27. public class Socket {
  28. /** default to localhost */
  29. private String host = "127.0.0.1";
  30. /** default to 4444 */
  31. private int port = 4444;
  32. /**
  33. * the host name/ip of the machine on which the Viewer is running;
  34. * defaults to localhost.
  35. */
  36. public void setHost(String value) {
  37. host = value;
  38. }
  39. /**
  40. * Optional port number for the viewer; default is 4444
  41. */
  42. public void setPort(Integer value) {
  43. port = value.intValue();
  44. }
  45. /** if no host is set, returning ':<port>', will take localhost */
  46. public String toString() {
  47. return host + ":" + port;
  48. }
  49. }