Package net.yacy.upnp.messages

Examples of net.yacy.upnp.messages.ActionMessage.service()


    UPNPMessageFactory tmp = UPNPMessageFactory.getNewInstance( srv );
   
    ActionMessage msg = tmp.getMessage( "GetExternalIPAddress" );
    String ipToParse = null;
    try {
      ipToParse = msg.service().getOutActionArgumentValue( "NewExternalIPAddress" );
    } catch ( UPNPResponseException ex ) {
      // ok probably not the IP interface
    } catch ( IOException ex ) {
      // not really normal
      log.warn( "IOException occured during device detection", ex );
View Full Code Here


   * @throws UPNPResponseException if the devices returns an error code
   * @throws IOException if some error occurs during communication with the device
   */
  public String getExternalIPAddress() throws UPNPResponseException, IOException {
    ActionMessage msg = msgFactory.getMessage( "GetExternalIPAddress" );
    return msg.service().getOutActionArgumentValue( "NewExternalIPAddress" );
  }

  /**
   * Retreives a generic port mapping entry.
   * @param newPortMappingIndex the index to lookup in the nat table of the upnp device
View Full Code Here

    ActionMessage msg = msgFactory.getMessage( "GetGenericPortMappingEntry" );
    msg.setInputParameter( "NewPortMappingIndex", newPortMappingIndex );

    try {
      return msg.service();
    } catch ( UPNPResponseException ex ) {
      if ( ex.getDetailErrorCode() == 714 ) {
        return null;
      }
      throw ex;
View Full Code Here

    msg.setInputParameter( "NewRemoteHost", remoteHost )
       .setInputParameter( "NewExternalPort", externalPort )
       .setInputParameter( "NewProtocol", protocol );

    try {
      return msg.service();
    } catch ( UPNPResponseException ex ) {
      if ( ex.getDetailErrorCode() == 714 ) {
        return null;
      }
      throw ex;
View Full Code Here

       .setInputParameter( "NewInternalClient", internalClient )
       .setInputParameter( "NewEnabled", true )
       .setInputParameter( "NewPortMappingDescription", description )
       .setInputParameter( "NewLeaseDuration", leaseDuration );
    try {
      msg.service();
      return true;
    } catch ( UPNPResponseException ex ) {
      if ( ex.getDetailErrorCode() == 718 ) {
        return false;
      }
View Full Code Here

    ActionMessage msg = msgFactory.getMessage( "DeletePortMapping" );
    msg.setInputParameter( "NewRemoteHost", remoteHost )
       .setInputParameter( "NewExternalPort", externalPort )
       .setInputParameter( "NewProtocol", protocol );
    try {
      msg.service();
      return true;
    } catch ( UPNPResponseException ex ) {
      if ( ex.getDetailErrorCode() == 714 ) {
        return false;
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.