org.opendaylight.controller.sal.utils.Status.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(94)

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

Status.<init>介绍

[英]Generates an instance of the Status class based on the passed StatusCode only. The description field of the Status object will be inferred by the status code.
[中]仅基于传递的StatusCode生成Status类的实例。状态对象的描述字段将由状态代码推断。

代码示例

代码示例来源:origin: org.opendaylight.controller/protocol_plugins.stub

/**
 * Asynchronously add a flow to the network node
 *
 * @param node
 * @param flow
 * @param rid
 */
public Status addFlowAsync(Node node, Flow flow, long rid){
  return new Status(StatusCode.SUCCESS);
}

代码示例来源:origin: org.opendaylight.controller/switchmanager.implementation

@Override
public Status removeNodeAllProps(Node node) {
  this.nodeProps.remove(node);
  return new Status(StatusCode.SUCCESS);
}

代码示例来源:origin: org.opendaylight.controller/switchmanager.implementation

/**
 * {@inheritDoc}
 */
@Override
public Status setControllerProperty(Property property) {
  if (property != null) {
    this.controllerGlobalProperties.put(property.getName(), property);
    return new Status(StatusCode.SUCCESS);
  }
  return new Status(StatusCode.BADREQUEST, "Invalid property provided when setting property");
}

代码示例来源:origin: org.opendaylight.controller/switchmanager.implementation

@Override
public Status setControllerProperty(Property property) {
  if (property != null) {
    this.controllerProps.put(property.getName(), property);
    return new Status(StatusCode.SUCCESS);
  }
  return new Status(StatusCode.BADREQUEST, "Invalid property provided when setting property");
}

代码示例来源:origin: org.opendaylight.controller/switchmanager.implementation

@Override
public Status removeSubnet(String name) {
  if (name.equalsIgnoreCase(DEFAULT_SUBNET_NAME)) {
    return new Status(StatusCode.NOTALLOWED, "The specified subnet gateway cannot be removed");
  }
  SubnetConfig conf = subnetsConfigList.get(name);
  if (conf == null) {
    return new Status(StatusCode.SUCCESS, "Subnet not present");
  }
  return this.addRemoveSubnet(conf, false);
}

代码示例来源:origin: org.opendaylight.controller/usermanager.implementation

@Override
public Status removeLocalUser(String userName) {
  if (userName == null || userName.trim().isEmpty()) {
    return new Status(StatusCode.BADREQUEST, "Invalid user name");
  }
  if (!localUserConfigList.containsKey(userName)) {
    return new Status(StatusCode.NOTFOUND, "User does not exist");
  }
  return changeLocalUser(localUserConfigList.get(userName), Command.REMOVE);
}

代码示例来源:origin: org.opendaylight.controller/appauth

protected Status assignResourceGroupToRoleInternal(String group, Privilege privilege, String role) {
  Set<ResourceGroup> roleGroups = groupsAuthorizations.get(role);
  roleGroups.add(new ResourceGroup(group, privilege));
  // Update cluster
  groupsAuthorizations.put(role, roleGroups);
  return new Status(StatusCode.SUCCESS);
}

代码示例来源:origin: org.opendaylight.controller/switchmanager.implementation

private Status updateConfig(SubnetConfig conf, boolean add) {
  if (add) {
    if(subnetsConfigList.putIfAbsent(conf.getName(), conf) != null) {
      String msg = "Cluster conflict: Subnet with name " + conf.getName() + "already exists.";
      return new Status(StatusCode.CONFLICT, msg);
    }
  } else {
    subnetsConfigList.remove(conf.getName());
  }
  return new Status(StatusCode.SUCCESS);
}

代码示例来源:origin: org.opendaylight.controller/sal.networkconfiguration.implementation

@Override
public Status addBridgeDomainConfig(Node node, String bridgeIdentifier, Map<ConfigConstants, Object> params) {
  if (pluginService != null) {
    IPluginInBridgeDomainConfigService plugin = this.pluginService.get(node.getType());
    if (plugin != null) {
      return plugin.addBridgeDomainConfig(node, bridgeIdentifier, params);
    }
  }
  return new Status(StatusCode.NOSERVICE, "Requested Plugin Service Not available");
}

代码示例来源:origin: org.opendaylight.controller/sal.networkconfiguration.implementation

@Override
public Status removePortConfig(Node node, String bridgeIdentifier, String portIdentifier,
    Map<ConfigConstants, Object> params) {
  if (pluginService != null) {
    IPluginInBridgeDomainConfigService plugin = this.pluginService.get(node.getType());
    if (plugin != null) {
      return plugin.removePortConfig(node, bridgeIdentifier, portIdentifier, params);
    }
  }
  return new Status(StatusCode.NOSERVICE, "Requested Plugin Service Not available");
}

代码示例来源:origin: org.opendaylight.controller/topologymanager

public Status saveConfigInternal() {
  Status saveStatus = configurationService.persistConfiguration(
      new ArrayList<ConfigurationObject>(userLinksDB.values()), USER_LINKS_FILE_NAME);
  if (!saveStatus.isSuccess()) {
    return new Status(StatusCode.INTERNALERROR, "Topology save failed: " + saveStatus.getDescription());
  }
  return saveStatus;
}

代码示例来源:origin: org.opendaylight.controller/topology.web

@Override
public Status saveConfiguration() {
  ObjectWriter objWriter = new ObjectWriter();
  objWriter.write(metaCache, topologyWebFileName);
  return new Status(StatusCode.SUCCESS, null);
}

代码示例来源:origin: org.opendaylight.controller/sal.implementation

@Override
public Status addFlow(Node node, Flow flow) {
  if (pluginFlowProgrammer != null) {
    ProtocolService<IPluginInFlowProgrammerService> service =
      this.pluginFlowProgrammer.get(node.getType());
    if (service != null) {
      return service.getService().addFlow(node, flow);
    }
  }
  return new Status(StatusCode.NOSERVICE, "Plugin unuvailable");
}

代码示例来源:origin: org.opendaylight.controller/sal.implementation

@Override
public Status modifyFlow(Node node, Flow oldFlow, Flow newFlow) {
  if (pluginFlowProgrammer != null) {
    ProtocolService<IPluginInFlowProgrammerService> service =
      this.pluginFlowProgrammer.get(node.getType());
    if (service != null) {
      return service.getService().modifyFlow(node, oldFlow, newFlow);
    }
  }
  return new Status(StatusCode.NOSERVICE, "Plugin unuvailable");
}

代码示例来源:origin: org.opendaylight.controller/sal.implementation

@Override
  public Status asyncSendBarrierMessage(Node node) {
    if (this.pluginFlowProgrammer != null) {
      ProtocolService<IPluginInFlowProgrammerService> service =
        this.pluginFlowProgrammer.get(node.getType());
      if (service != null) {
        return service.getService().asyncSendBarrierMessage(node);
      }
    }
    return new Status(StatusCode.NOSERVICE, "Plugin unuvailable");
  }
}

代码示例来源:origin: org.opendaylight.controller/sal.implementation

@Override
public Status removeFlow(Node node, Flow flow) {
  if (pluginFlowProgrammer != null) {
    ProtocolService<IPluginInFlowProgrammerService> service =
      this.pluginFlowProgrammer.get(node.getType());
    if (service != null) {
      return service.getService().removeFlow(node, flow);
    }
  }
  return new Status(StatusCode.NOSERVICE, "Plugin unuvailable");
}

代码示例来源:origin: org.opendaylight.controller/sal.implementation

@Override
public Status removeAllFlows(Node node) {
  if (pluginFlowProgrammer != null) {
    ProtocolService<IPluginInFlowProgrammerService> service =
      this.pluginFlowProgrammer.get(node.getType());
    if (service != null) {
      return service.getService().removeAllFlows(node);
    }
  }
  return new Status(StatusCode.NOSERVICE, "Plugin unuvailable");
}

代码示例来源:origin: org.opendaylight.controller/sal.implementation

@Override
public Status syncSendBarrierMessage(Node node) {
  if (this.pluginFlowProgrammer != null) {
    ProtocolService<IPluginInFlowProgrammerService> service =
      this.pluginFlowProgrammer.get(node.getType());
    if (service != null) {
      return service.getService().syncSendBarrierMessage(node);
    }
  }
  return new Status(StatusCode.NOSERVICE, "Plugin unuvailable");
}

代码示例来源:origin: org.opendaylight.controller/switchmanager.implementation

@Override
public Status removeSpanConfig(SpanConfig conf) {
  removeSpanPorts(conf.getNode(), conf.getPortArrayList());
  // Update configuration
  spanConfigList.remove(conf);
  return new Status(StatusCode.SUCCESS);
}

代码示例来源:origin: org.opendaylight.ovsdb/ovsdb-plugin-compatibility-layer

public static Status convertOvsdbStatusToSalStatus(org.opendaylight.ovsdb.plugin.api.Status status){
  if(status.getRequestId() != 0){
    return new org.opendaylight.controller.sal.utils.Status(convertOvsdbStatusCodeToSalStatusCode(status.getCode()),status.getRequestId());
  }else{
    return new org.opendaylight.controller.sal.utils.Status(convertOvsdbStatusCodeToSalStatusCode(status.getCode()),status.getDescription());
  }
}

相关文章