@Test(expected = InvalidParameterValueException.class) public void testVerifyTemplateIdOfSystemTemplate() { templateManager.verifyTemplateId(1L); }
void verifyTemplateId(final Long id) { if (id.equals(Long.valueOf(1))) { final InvalidParameterValueException ex = new InvalidParameterValueException("Unable to update template/iso of specified id"); ex.addProxyObject(String.valueOf(id), "templateId"); throw ex; } }
TemplateManagerImpl extends ManagerBase implements TemplateManager, TemplateApiService, Configurable { void verifyTemplateId(final Long id) { if (id.equals(Long.valueOf(1))) { final InvalidParameterValueException ex = new InvalidParameterValueException("Unable to update template/iso of specified id"); ex.addProxyObject(String.valueOf(id), "templateId"); throw ex; } } }
TemplateManagerImpl extends ManagerBase implements TemplateManager, TemplateApiService, Configurable { void verifyTemplateId(final Long id) { if (id.equals(Long.valueOf(1))) { final InvalidParameterValueException ex = new InvalidParameterValueException("Unable to update template/iso of specified id"); ex.addProxyObject(String.valueOf(id), "templateId"); throw ex; } } protected  TemplateManagerImpl(); }
TemplateManagerImpl extends ManagerBase implements TemplateManager, TemplateApiService, Configurable { void verifyTemplateId(final Long id) { if (id.equals(Long.valueOf(1))) { final InvalidParameterValueException ex = new InvalidParameterValueException("Unable to update template/iso of specified id"); ex.addProxyObject(String.valueOf(id), "templateId"); throw ex; } } protected  TemplateManagerImpl(); @Override @ActionEvent(eventType = EventTypes.EVENT_TEMPLATE_CREATE, eventDescription = "creating template") VirtualMachineTemplate registerTemplate(final RegisterTemplateCmd cmd); @Override @ActionEvent(eventType = EventTypes.EVENT_TEMPLATE_CREATE, eventDescription = "creating post upload template") GetUploadParamsResponse registerTemplateForPostUpload(final GetUploadParamsForTemplateCmd cmd); @Override @ActionEvent(eventType = EventTypes.EVENT_ISO_CREATE, eventDescription = "creating iso") VirtualMachineTemplate registerIso(final RegisterIsoCmd cmd); @Override @ActionEvent(eventType = EventTypes.EVENT_TEMPLATE_COPY, eventDescription = "copying template", async = true) VirtualMachineTemplate copyTemplate(final CopyTemplateCmd cmd); @Override VirtualMachineTemplate prepareTemplate(final long templateId, final long zoneId, final Long storageId); void prepareTemplateInAllStoragePools(final VMTemplateVO template, final long zoneId); @Override @DB VMTemplateStoragePoolVO prepareTemplateForCreate(final VMTemplateVO templ, final StoragePool pool); @Override @DB boolean resetTemplateDownloadStateOnPool(final long templateStoragePoolRefId); @Override @DB boolean copy(final long userId, final VMTemplateVO template, final DataStore srcSecStore, final DataCenterVO dstZone); @Override boolean delete(final long userId, final long templateId, final Long zoneId); @Override List<VMTemplateStoragePoolVO> getUnusedTemplatesInPool(final StoragePoolVO pool); @Override @DB void evictTemplateFromStoragePool(final VMTemplateStoragePoolVO templatePoolVO); @Override boolean templateIsDeleteable(final VMTemplateHostVO templateHostRef); @Override boolean templateIsDeleteable(final long templateId); @Override Pair<String, String> getAbsoluteIsoPath(final long templateId, final long dataCenterId); @Override String getSecondaryStorageURL(final long zoneId); @Override DataStore getImageStore(final long zoneId, final long tmpltId); @Override DataStore getImageStore(final long tmpltId); @Override Long getTemplateSize(final long templateId, final long zoneId); @Override DataStore getImageStore(final String storeUuid, final Long zoneId); @Override String getChecksum(final DataStore store, final String templatePath); @Override List<DataStore> getImageStoreByTemplate(final long templateId, final Long zoneId); @Override TemplateInfo prepareIso(final long isoId, final long dcId); @Override void prepareIsoForVmProfile(final VirtualMachineProfile profile); @Override @ActionEvent(eventType = EventTypes.EVENT_ISO_DETACH, eventDescription = "detaching ISO", async = true) boolean detachIso(final long vmId); @Override @ActionEvent(eventType = EventTypes.EVENT_ISO_ATTACH, eventDescription = "attaching ISO", async = true) boolean attachIso(final long isoId, final long vmId); @Override @ActionEvent(eventType = EventTypes.EVENT_TEMPLATE_DELETE, eventDescription = "deleting template", async = true) boolean deleteTemplate(final DeleteTemplateCmd cmd); @Override @ActionEvent(eventType = EventTypes.EVENT_ISO_DELETE, eventDescription = "deleting iso", async = true) boolean deleteIso(final DeleteIsoCmd cmd); @Override @ActionEvent(eventType = EventTypes.EVENT_ISO_EXTRACT, eventDescription = "extracting ISO", async = true) String extract(final ExtractIsoCmd cmd); @Override @ActionEvent(eventType = EventTypes.EVENT_TEMPLATE_EXTRACT, eventDescription = "extracting template", async = true) String extract(final ExtractTemplateCmd cmd); @Override List<String> listTemplatePermissions(final BaseListTemplateOrIsoPermissionsCmd cmd); @DB @Override boolean updateTemplateOrIsoPermissions(final BaseUpdateTemplateOrIsoPermissionsCmd cmd); @Override @ActionEvent(eventType = EventTypes.EVENT_TEMPLATE_CREATE, eventDescription = "creating template", create = true) VMTemplateVO createPrivateTemplateRecord(final CreateTemplateCmd cmd, final Account templateOwner); @Override @DB @ActionEvent(eventType = EventTypes.EVENT_TEMPLATE_CREATE, eventDescription = "creating template", async = true) VirtualMachineTemplate createPrivateTemplate(final CreateTemplateCmd command); @Override VMTemplateVO updateTemplate(final UpdateIsoCmd cmd); @Override VMTemplateVO updateTemplate(final UpdateTemplateCmd cmd); @Override boolean configure(final String name, final Map<String, Object> params); @Override boolean start(); @Override boolean stop(); @Override String getConfigComponentName(); @Override ConfigKey<?>[] getConfigKeys(); @Inject void setTemplateAdapters(final List<TemplateAdapter> adapters); }
TemplateManagerImpl extends ManagerBase implements TemplateManager, TemplateApiService, Configurable { void verifyTemplateId(final Long id) { if (id.equals(Long.valueOf(1))) { final InvalidParameterValueException ex = new InvalidParameterValueException("Unable to update template/iso of specified id"); ex.addProxyObject(String.valueOf(id), "templateId"); throw ex; } } protected  TemplateManagerImpl(); @Override @ActionEvent(eventType = EventTypes.EVENT_TEMPLATE_CREATE, eventDescription = "creating template") VirtualMachineTemplate registerTemplate(final RegisterTemplateCmd cmd); @Override @ActionEvent(eventType = EventTypes.EVENT_TEMPLATE_CREATE, eventDescription = "creating post upload template") GetUploadParamsResponse registerTemplateForPostUpload(final GetUploadParamsForTemplateCmd cmd); @Override @ActionEvent(eventType = EventTypes.EVENT_ISO_CREATE, eventDescription = "creating iso") VirtualMachineTemplate registerIso(final RegisterIsoCmd cmd); @Override @ActionEvent(eventType = EventTypes.EVENT_TEMPLATE_COPY, eventDescription = "copying template", async = true) VirtualMachineTemplate copyTemplate(final CopyTemplateCmd cmd); @Override VirtualMachineTemplate prepareTemplate(final long templateId, final long zoneId, final Long storageId); void prepareTemplateInAllStoragePools(final VMTemplateVO template, final long zoneId); @Override @DB VMTemplateStoragePoolVO prepareTemplateForCreate(final VMTemplateVO templ, final StoragePool pool); @Override @DB boolean resetTemplateDownloadStateOnPool(final long templateStoragePoolRefId); @Override @DB boolean copy(final long userId, final VMTemplateVO template, final DataStore srcSecStore, final DataCenterVO dstZone); @Override boolean delete(final long userId, final long templateId, final Long zoneId); @Override List<VMTemplateStoragePoolVO> getUnusedTemplatesInPool(final StoragePoolVO pool); @Override @DB void evictTemplateFromStoragePool(final VMTemplateStoragePoolVO templatePoolVO); @Override boolean templateIsDeleteable(final VMTemplateHostVO templateHostRef); @Override boolean templateIsDeleteable(final long templateId); @Override Pair<String, String> getAbsoluteIsoPath(final long templateId, final long dataCenterId); @Override String getSecondaryStorageURL(final long zoneId); @Override DataStore getImageStore(final long zoneId, final long tmpltId); @Override DataStore getImageStore(final long tmpltId); @Override Long getTemplateSize(final long templateId, final long zoneId); @Override DataStore getImageStore(final String storeUuid, final Long zoneId); @Override String getChecksum(final DataStore store, final String templatePath); @Override List<DataStore> getImageStoreByTemplate(final long templateId, final Long zoneId); @Override TemplateInfo prepareIso(final long isoId, final long dcId); @Override void prepareIsoForVmProfile(final VirtualMachineProfile profile); @Override @ActionEvent(eventType = EventTypes.EVENT_ISO_DETACH, eventDescription = "detaching ISO", async = true) boolean detachIso(final long vmId); @Override @ActionEvent(eventType = EventTypes.EVENT_ISO_ATTACH, eventDescription = "attaching ISO", async = true) boolean attachIso(final long isoId, final long vmId); @Override @ActionEvent(eventType = EventTypes.EVENT_TEMPLATE_DELETE, eventDescription = "deleting template", async = true) boolean deleteTemplate(final DeleteTemplateCmd cmd); @Override @ActionEvent(eventType = EventTypes.EVENT_ISO_DELETE, eventDescription = "deleting iso", async = true) boolean deleteIso(final DeleteIsoCmd cmd); @Override @ActionEvent(eventType = EventTypes.EVENT_ISO_EXTRACT, eventDescription = "extracting ISO", async = true) String extract(final ExtractIsoCmd cmd); @Override @ActionEvent(eventType = EventTypes.EVENT_TEMPLATE_EXTRACT, eventDescription = "extracting template", async = true) String extract(final ExtractTemplateCmd cmd); @Override List<String> listTemplatePermissions(final BaseListTemplateOrIsoPermissionsCmd cmd); @DB @Override boolean updateTemplateOrIsoPermissions(final BaseUpdateTemplateOrIsoPermissionsCmd cmd); @Override @ActionEvent(eventType = EventTypes.EVENT_TEMPLATE_CREATE, eventDescription = "creating template", create = true) VMTemplateVO createPrivateTemplateRecord(final CreateTemplateCmd cmd, final Account templateOwner); @Override @DB @ActionEvent(eventType = EventTypes.EVENT_TEMPLATE_CREATE, eventDescription = "creating template", async = true) VirtualMachineTemplate createPrivateTemplate(final CreateTemplateCmd command); @Override VMTemplateVO updateTemplate(final UpdateIsoCmd cmd); @Override VMTemplateVO updateTemplate(final UpdateTemplateCmd cmd); @Override boolean configure(final String name, final Map<String, Object> params); @Override boolean start(); @Override boolean stop(); @Override String getConfigComponentName(); @Override ConfigKey<?>[] getConfigKeys(); @Inject void setTemplateAdapters(final List<TemplateAdapter> adapters);  }