public InternalComponentGroup onlyInternals() { final ArrayList<InternalComponent> selected = new ArrayList<InternalComponent>(); for(Component component: this) { if (component.isInternal()) { selected.add((InternalComponent) component); } } return new InternalComponentGroup(selected); }
private InternalComponent findClient(Deployment container) throws IllegalStateException { final InternalComponent client = container.getComponents().onlyInternals().firstNamed(clientName); if (client == null) { final String error = String.format("type '%s' not found",clientName); throw new IllegalStateException(formatError(error)); } return client; }
public void internalComponentsToPOJO(List<net.cloudml.core.InternalComponent> components) { int counter = 0; for (net.cloudml.core.InternalComponent c: components) { internalComponentToPOJO(c); counter++; } assert counter == model.getComponents().onlyInternals().size(); assert counter == internalComponents.size(); }
public net.cloudml.core.CloudMLModel toKMF(Deployment deploy) { kDeploy.setName(deploy.getName()); convertProperties(deploy,kDeploy,factory); providersToKmf(deploy.getProviders().toList()); externalComponentToKmf(deploy.getComponents().onlyExternals().toList()); internalComponentsToKmf(deploy.getComponents().onlyInternals().toList()); externalComponentInstanceToKmf(deploy.getComponentInstances().onlyExternals().toList()); internalComponentInstancesToKmf(deploy.getComponentInstances().onlyInternals().toList()); executesToKmf(deploy.getExecuteInstances().toList()); relationshipsToKmf(deploy.getRelationships()); relationshipInstancesToKmf(deploy.getRelationshipInstances().toList()); return kDeploy; }
private InternalComponent findType(Deployment container) throws IllegalStateException { final InternalComponent type = container.getComponents().onlyInternals().firstNamed(getTypeName()); if (type == null) { final String error = String.format("Unable to find an internal component type named '%s'", getTypeName()); throw new IllegalStateException(error); } return type; } }