All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.soulwing.snmp.SnmpTargetBase Maven / Gradle / Ivy

Go to download

A simplified SNMP API for Java, inspired by Jürgen Schönwälder's Tnm extension for Tcl.

There is a newer version: 1.2.0
Show newest version
/*
 * tnm4j - Simplified SNMP API for Java
 * Copyright (C) 2012 Carl Harris, Jr
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see .
 */
package org.soulwing.snmp;

import java.util.HashMap;
import java.util.Map;

/**
 * An abstract base for {@link SnmpTarget} implementations.
 *
 * @author Carl Harris
 */
public abstract class SnmpTargetBase implements SnmpTarget {

  private String address;
  private int port = SnmpDefaults.AGENT_PORT;
  private Map properties = new HashMap();

  /**
   * {@inheritDoc}
   */
  @Override
  public String getAddress() {
    return address;
  }

  /**
   * Sets the {@code address} property.
   * @param address the value to set
   */
  public void setAddress(String address) {
    this.address = address;
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public int getPort() {
    return port;
  }

  /**
   * Sets the {@code port} property.
   * @param port the value to set
   */
  public void setPort(int port) {
    this.port = port;
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public Map getProperties() {
    return properties;
  }

  /**
   * Sets the {@code properties} property.
   * @param properties the value to set
   */
  public void setProperties(Map properties) {
    this.properties = properties;
  }

  @Override
  public String toString() {
    return String.format("%s/%d", address, port);
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy