org.snmp4j.smi.OID.equals()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中org.snmp4j.smi.OID.equals()方法的一些代码示例,展示了OID.equals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OID.equals()方法的具体详情如下:
包路径:org.snmp4j.smi.OID
类名称:OID
方法名:equals

OID.equals介绍

暂无

代码示例

代码示例来源:origin: org.snmp4j/snmp4j-agent

public boolean equals(Object obj) {
 if (obj instanceof MOInfo) {
  MOInfo o = (MOInfo)obj;
  return o.oid.equals(oid) && ((version == null) || (o.version == null) ||
                 version.equals(o.version));
 }
 return false;
}

代码示例来源:origin: org.kaazing/snmp4j-agent

public boolean equals(Object obj) {
 if (obj instanceof MOInfo) {
  MOInfo o = (MOInfo)obj;
  return o.oid.equals(oid) && ((version == null) || (o.version == null) ||
                 version.equals(o.version));
 }
 return false;
}

代码示例来源:origin: org.kaazing/snmp4j

public Row getRow(OID index) {
  for (ListIterator it = rowCache.listIterator(rowCache.size() + 1);
     it.hasPrevious(); ) {
   Row r = (Row) it.previous();
   if (index.equals(r.getRowIndex())) {
    return r;
   }
  }
  return null;
 }
}

代码示例来源:origin: org.snmp4j/snmp4j

public Row getRow(OID index) {
    for (ListIterator<Row> it = rowCache.listIterator(rowCache.size() + 1);
       it.hasPrevious(); ) {
      Row r = it.previous();
      if (index.equals(r.getRowIndex())) {
        return r;
      }
    }
    return null;
  }
}

代码示例来源:origin: com.github.kaitoy.sneo/sneo-core

@Override
public boolean equals(Object obj) {
 if (obj == this) { return true; }
 if (!this.getClass().isInstance(obj)) { return false; }
 OidWithContext other = (OidWithContext)obj;
 return    oid.equals(other.getOid())
     && context.equals(other.getContext());
}

代码示例来源:origin: org.kaazing/snmp4j-agent

public Variable getValue(OID instanceOID) {
 if (getOid().equals(instanceOID)) {
  return getValue();
 }
 return null;
}

代码示例来源:origin: org.snmp4j/snmp4j-agent

public Variable getValue(OID instanceOID) {
  if (getOid().equals(instanceOID)) {
    return getValue();
  }
  return null;
}

代码示例来源:origin: org.kaazing/snmp4j-agent

public boolean equals(Object obj) {
 if (obj instanceof MOScope) {
  MOScope other = (MOScope)obj;
  return (lowerBound.equals(other.getLowerBound()) &&
      (((upperBound == null) && (other.getUpperBound() == null)) ||
       (upperBound.equals(other.getUpperBound()))) &&
      (lowerIncluded == other.isLowerIncluded()) &&
      (upperIncluded == other.isUpperIncluded()));
 }
 return false;
}

代码示例来源:origin: org.snmp4j/snmp4j-agent

private static boolean isInSubtree(OID oid, OID subtree, OctetString mask) {
 OID maskedSubtree = subtree.mask(mask);
 OID maskedOID = oid.mask(mask);
 if (maskedOID.equals(maskedSubtree)) {
  return true;
 }
 return maskedOID.startsWith(maskedSubtree);
}

代码示例来源:origin: org.snmp4j/snmp4j

public boolean equals(Object o) {
 if (o instanceof VariableBinding) {
  VariableBinding other = (VariableBinding)o;
  return oid.equals(other.getOid()) &&
    variable.equals(other.getVariable());
 }
 return false;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

public boolean equals(Object o) {
 if (o instanceof VariableBinding) {
  VariableBinding other = (VariableBinding)o;
  return oid.equals(other.getOid()) &&
    variable.equals(other.getVariable());
 }
 return false;
}

代码示例来源:origin: org.kaazing/snmp4j-agent

public void prepareRow(SubRequest subRequest, MOTableRow changeSet) {
 if (PRIMARY_INDEX.equals(changeSet.getIndex())) {
  if (snmp4jCfgStorageEntryModel.getRow(PRIMARY_INDEX) == null) {
   subRequest.getRequest().setErrorStatus(PDU.noCreation);
  }
 }
}

代码示例来源:origin: org.snmp4j/snmp4j-agent

@SuppressWarnings("unchecked")
public boolean setValue(VariableBinding newValueAndInstancceOID) {
  if (getOid().equals(newValueAndInstancceOID.getOid())) {
    return (setValue((V) newValueAndInstancceOID.getVariable()) ==
        SnmpConstants.SNMP_ERROR_SUCCESS);
  }
  return false;
}

代码示例来源:origin: org.kaazing/snmp4j-agent

public boolean covers(OID oid) {
 if (oid == null) {
  return false;
 }
 return (((getLowerBound().compareTo(oid) < 0) ||
      (isLowerIncluded() && getLowerBound().equals(oid))) &&
     ((getUpperBound() == null) ||
      (getUpperBound().compareTo(oid) > 0) ||
      (isUpperIncluded() && getUpperBound().equals(oid))));
}

代码示例来源:origin: org.snmp4j/snmp4j-agent

public boolean covers(OID oid) {
 if (oid == null) {
  return false;
 }
 return (((getLowerBound().compareTo(oid) < 0) ||
      (isLowerIncluded() && getLowerBound().equals(oid))) &&
     ((getUpperBound() == null) ||
      (getUpperBound().compareTo(oid) > 0) ||
      (isUpperIncluded() && getUpperBound().equals(oid))));
}

代码示例来源:origin: org.kaazing/snmp4j-agent

public boolean isSearchQuery() {
 MOContextScope scope = getScope();
 return ((!scope.isLowerIncluded()) &&
     ((scope.getUpperBound() == null) ||
      (!scope.getUpperBound().equals(scope.getLowerBound()))));
}

代码示例来源:origin: org.kaazing/snmp4j-agent

public void incrementCounter(CounterEvent event) {
 if (event.getOid().equals(snmpUnavailableContexts.getOid())) {
  ((Counter32) snmpUnavailableContexts.getValue()).increment();
  event.setCurrentValue(snmpUnavailableContexts.getValue());
 }
 else if (event.getOid().equals(snmpUnknownContexts.getOid())) {
  ((Counter32) snmpUnknownContexts.getValue()).increment();
  event.setCurrentValue(snmpUnknownContexts.getValue());
 }
}

代码示例来源:origin: org.snmp4j/snmp4j-agent

public void incrementCounter(CounterEvent event) {
 if (event.getOid().equals(snmpUnavailableContexts.getOid())) {
  ((Counter32) snmpUnavailableContexts.getValue()).increment();
  event.setCurrentValue(snmpUnavailableContexts.getValue());
 }
 else if (event.getOid().equals(snmpUnknownContexts.getOid())) {
  ((Counter32) snmpUnknownContexts.getValue()).increment();
  event.setCurrentValue(snmpUnknownContexts.getValue());
 }
}

代码示例来源:origin: org.snmp4j/snmp4j-agent

public void prepare(SubRequest subRequest, MOTableRow row,
          MOTableRow changeSet, int column) {
 super.prepare(subRequest, row, changeSet, column);
 if (!subRequest.hasError()) {
  OID rowPointer = (OID) subRequest.getVariableBinding().getVariable();
  MOTableCellInfo cell = getTargetTable().getCellInfo(rowPointer);
  if (cell.getIndex().equals(row.getIndex())) {
   // cannot clone from self
   subRequest.getStatus().setErrorStatus(PDU.inconsistentValue);
  }
 }
}

代码示例来源:origin: org.kaazing/snmp4j-agent

public void prepare(SubRequest subRequest, MOTableRow row,
          MOTableRow changeSet, int column) {
 super.prepare(subRequest, row, changeSet, column);
 if (!subRequest.hasError()) {
  OID rowPointer = (OID) subRequest.getVariableBinding().getVariable();
  MOTableCellInfo cell = getTargetTable().getCellInfo(rowPointer);
  if (cell.getIndex().equals(row.getIndex())) {
   // cannot clone from self
   subRequest.getStatus().setErrorStatus(PDU.inconsistentValue);
  }
 }
}

相关文章