本文整理汇总了Java中org.openbaton.catalogue.mano.common.Security类的典型用法代码示例。如果您正苦于以下问题:Java Security类的具体用法?Java Security怎么用?Java Security使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Security类属于org.openbaton.catalogue.mano.common包,在下文中一共展示了Security类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSecurity
import org.openbaton.catalogue.mano.common.Security; //导入依赖的package包/类
/**
* Returns the Security into a NSD with id
*
* @param id : The id of NSD
* @return Security: The Security of PhysicalNetworkFunctionDescriptor into NSD @
*/
@ApiOperation(value = "", notes = "", hidden = true)
@RequestMapping(
value = "{id}/security",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE
)
@ResponseStatus(HttpStatus.OK)
public Security getSecurity(
@PathVariable("id") String id, @RequestHeader(value = "project-id") String projectId)
throws NotFoundException {
NetworkServiceDescriptor nsd = networkServiceDescriptorManagement.query(id, projectId);
if (nsd == null)
throw new NotFoundException("Did not find a Network Service Descriptor with ID " + id);
return nsd.getNsd_security();
}
示例2: postSecurity
import org.openbaton.catalogue.mano.common.Security; //导入依赖的package包/类
/**
* Stores the Security into NSD
*
* @param security : The Security to be stored
* @param id : The id of NSD
* @return Security: The Security stored @
*/
@ApiOperation(value = "", notes = "", hidden = true)
@RequestMapping(
value = "{id}/security/",
method = RequestMethod.POST,
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE
)
@ResponseStatus(HttpStatus.CREATED)
public Security postSecurity(
@RequestBody @Valid Security security,
@PathVariable("id") String id,
@RequestHeader(value = "project-id") String projectId)
throws NotFoundException {
return networkServiceDescriptorManagement.addSecurity(id, security, projectId);
}
示例3: init
import org.openbaton.catalogue.mano.common.Security; //导入依赖的package包/类
@Before
public void init() {
MockitoAnnotations.initMocks(this);
networkServiceDescriptor = new NetworkServiceDescriptor();
networkServiceDescriptor.setVendor("Fokus");
VirtualNetworkFunctionDescriptor virtualNetworkFunctionDescriptor =
new VirtualNetworkFunctionDescriptor();
virtualNetworkFunctionDescriptor.setVendor("Fokus");
networkServiceDescriptor.getVnfd().add(virtualNetworkFunctionDescriptor);
VNFDependency vnfdependency = new VNFDependency();
networkServiceDescriptor.getVnf_dependency().add(vnfdependency);
PhysicalNetworkFunctionDescriptor pDescriptor = new PhysicalNetworkFunctionDescriptor();
networkServiceDescriptor.getPnfd().add(pDescriptor);
Security security = new Security();
networkServiceDescriptor.setNsd_security(security);
}
示例4: updateSecurity
import org.openbaton.catalogue.mano.common.Security; //导入依赖的package包/类
@Test
public void updateSecurity() {
when(nsdManagement.query(anyString(), anyString())).thenReturn(networkServiceDescriptor);
Security security = new Security();
Security security_toUp = networkServiceDescriptor.getNsd_security();
log.info("" + security_toUp);
security_toUp = security;
networkServiceDescriptor.setNsd_security(security_toUp);
log.info("" + security);
exception.expect(UnsupportedOperationException.class);
assertEquals(
security,
restNetworkService.updateSecurity(
security, networkServiceDescriptor.getId(), security_toUp.getId(), "pi"));
}
示例5: updateSecurity
import org.openbaton.catalogue.mano.common.Security; //导入依赖的package包/类
@ApiOperation(value = "", notes = "", hidden = true)
@RequestMapping(
value = "{id}/security/{id_s}",
method = RequestMethod.PUT,
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE
)
@ResponseStatus(HttpStatus.ACCEPTED)
public Security updateSecurity(
@RequestBody @Valid Security security,
@PathVariable("id") String id,
@PathVariable("id_s") String id_s,
@RequestHeader(value = "project-id") String projectId) {
throw new UnsupportedOperationException();
}
示例6: postSecurity
import org.openbaton.catalogue.mano.common.Security; //导入依赖的package包/类
@Test
public void postSecurity() throws NotFoundException {
Security security = new Security();
when(nsdManagement.addSecurity(anyString(), any(security.getClass()), anyString()))
.thenReturn(security);
Security security1 =
restNetworkService.postSecurity(security, networkServiceDescriptor.getId(), "pi");
assertEquals(security, security1);
}
示例7: getSecurity
import org.openbaton.catalogue.mano.common.Security; //导入依赖的package包/类
@Test
public void getSecurity() {
when(nsdManagement.query(anyString(), anyString())).thenReturn(networkServiceDescriptor);
Security security = networkServiceDescriptor.getNsd_security();
/*assertEquals(security, restNetworkService.getSecurity(
networkServiceDescriptor.getId(), networkServiceDescriptor
.getNsd_security().getId()));*/
}
示例8: deleteSecurity
import org.openbaton.catalogue.mano.common.Security; //导入依赖的package包/类
@Test
public void deleteSecurity() throws NotFoundException {
when(nsdManagement.query(anyString(), anyString())).thenReturn(networkServiceDescriptor);
Security security = networkServiceDescriptor.getNsd_security();
restNetworkService.deleteSecurity(networkServiceDescriptor.getId(), security.getId(), "pi");
log.info("" + networkServiceDescriptor);
}
示例9: addSecurity
import org.openbaton.catalogue.mano.common.Security; //导入依赖的package包/类
@Override
@Transactional
public Security addSecurity(String id, Security security) {
security = securityRepository.save(security);
SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd 'at' HH:mm:ss z");
NetworkServiceDescriptor nsd = networkServiceDescriptorRepository.findFirstById(id);
nsd.setUpdatedAt(format.format(new Date()));
nsd.setNsd_security(security);
return security;
}
示例10: deleteSecurity
import org.openbaton.catalogue.mano.common.Security; //导入依赖的package包/类
@Override
@Transactional
public void deleteSecurity(String id, String idS) {
Security s = networkServiceDescriptorRepository.findFirstById(id).getNsd_security();
if (s.getId().equals(securityRepository.findOne(idS).getId())) {
SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd 'at' HH:mm:ss z");
NetworkServiceDescriptor nsd = networkServiceDescriptorRepository.findFirstById(id);
nsd.setUpdatedAt(format.format(new Date()));
nsd.setNsd_security(null);
securityRepository.delete(idS);
}
}
示例11: addSecurity
import org.openbaton.catalogue.mano.common.Security; //导入依赖的package包/类
/**
* Adds or Updates the Security into NSD
*
* @return Security
*/
@Override
public Security addSecurity(String id, Security security, String projectId)
throws NotFoundException {
if (nsdRepository.findFirstByIdAndProjectId(id, projectId) == null)
throw new NotFoundException("No NSD found with ID " + id);
return nsdRepository.addSecurity(id, security);
}
示例12: createVirtualLinkDescriptor
import org.openbaton.catalogue.mano.common.Security; //导入依赖的package包/类
private VirtualLinkDescriptor createVirtualLinkDescriptor() {
VirtualLinkDescriptor virtualLinkDescriptor = new VirtualLinkDescriptor();
virtualLinkDescriptor.setConnection(
new HashSet<String>() {
{
add("connection1");
}
});
virtualLinkDescriptor.setDescriptor_version("desc_version");
virtualLinkDescriptor.setRoot_requirement("root_req");
virtualLinkDescriptor.setNumber_of_endpoints(3);
virtualLinkDescriptor.setVendor("vendor");
virtualLinkDescriptor.setVld_security(new Security());
virtualLinkDescriptor.setConnectivity_type("type");
virtualLinkDescriptor.setLeaf_requirement("leaf_req");
virtualLinkDescriptor.setQos(
new HashSet<String>() {
{
add("qos");
}
});
virtualLinkDescriptor.setTest_access(
new HashSet<String>() {
{
add("test_access");
}
});
return virtualLinkDescriptor;
}
示例13: getPnfd_security
import org.openbaton.catalogue.mano.common.Security; //导入依赖的package包/类
public Security getPnfd_security() {
return pnfd_security;
}
示例14: setPnfd_security
import org.openbaton.catalogue.mano.common.Security; //导入依赖的package包/类
public void setPnfd_security(Security pnfd_security) {
this.pnfd_security = pnfd_security;
}
示例15: getManifest_file_security
import org.openbaton.catalogue.mano.common.Security; //导入依赖的package包/类
public Set<Security> getManifest_file_security() {
return manifest_file_security;
}