/* Simple class to store code and message returned by POST/GET to an Ansible Server */
public class AnsibleResult{
- private int StatusCode;
- private String StatusMessage;
- private String Results;
+ private int statusCode;
+ private String statusMessage;
+ private String results;
public AnsibleResult(){
- StatusCode = -1;
- StatusMessage = "UNKNOWN";
- Results = "UNKNOWN";
+ statusCode = -1;
+ statusMessage = "UNKNOWN";
+ results = "UNKNOWN";
}
// constructor
public AnsibleResult(int code, String message, String result){
- StatusCode = code;
- StatusMessage = message;
- Results = result;
+ statusCode = code;
+ statusMessage = message;
+ results = result;
}
//*************************************************
// Various set methods
public void setStatusCode(int code){
- this.StatusCode = code;
+ this.statusCode = code;
}
public void setStatusMessage(String message){
- this.StatusMessage = message;
+ this.statusMessage = message;
}
public void setResults(String results){
- this.Results = results;
+ this.results = results;
}
void set(int code, String message, String results){
- this.StatusCode = code;
- this.StatusMessage = message;
- this.Results = results;
+ this.statusCode = code;
+ this.statusMessage = message;
+ this.results = results;
}
//*********************************************
// Various get methods
public int getStatusCode(){
- return this.StatusCode;
+ return this.statusCode;
}
public String getStatusMessage(){
- return this.StatusMessage;
+ return this.statusMessage;
}
public String getResults(){
- return this.Results;
+ return this.results;
}
INITRESPONSE(0),
FINALRESPONSE(1);
- private final Set<Integer> InitCodes = new HashSet<Integer>(Arrays.asList(100, 101));
- private final Set<Integer> FinalCodes = new HashSet<Integer>(Arrays.asList(200, 500));
- private final ArrayList<Set<Integer>>CodeSets = new ArrayList<Set<Integer>>(Arrays.asList(InitCodes, FinalCodes));
+ private final Set<Integer> initCodes = new HashSet<Integer>(Arrays.asList(100, 101));
+ private final Set<Integer> finalCodes = new HashSet<Integer>(Arrays.asList(200, 500));
+ private final ArrayList<Set<Integer>>codeSets = new ArrayList<Set<Integer>>(Arrays.asList(initCodes, finalCodes));
private final Set<String> MessageSet = new HashSet<String>(Arrays.asList("PENDING", "FINISHED", "TERMINATED"));
public boolean checkValidCode(int Type, int Code){
- Set<Integer>CodeSet = CodeSets.get(Type);
+ Set<Integer>CodeSet = codeSets.get(Type);
if (CodeSet.contains(Code)){
return true;
}
public String getValidCodes(int Type){
- Set<Integer>CodeSet = CodeSets.get(Type);
+ Set<Integer>CodeSet = codeSets.get(Type);
Iterator iter = CodeSet.iterator();
String ValidCodes = "[ ";
import java.util.*;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
-import com.google.common.base.Strings;
import org.json.JSONObject;
-import org.json.JSONArray;
import org.json.JSONException;
-import org.onap.appc.exceptions.APPCException;
import org.onap.appc.adapter.ansible.model.AnsibleResult;
public class AnsibleServerEmulator {
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import org.onap.appc.Constants;
import org.onap.appc.configuration.Configuration;
import org.onap.appc.configuration.ConfigurationFactory;
import com.att.cdp.zones.Provider;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
-import com.woorea.openstack.connector.JaxRs20Connector;
// import com.sun.jersey.api.client.ClientHandlerException;
-import com.woorea.openstack.keystone.model.Access.Service.Endpoint;
/**
* This class maintains a cache of tenants within a specific provider.
package org.onap.appc.adapter.openstack.heat;
-import org.onap.appc.adapter.openstack.heat.model.CreateSnapshotParams;
-import org.onap.appc.adapter.openstack.heat.model.Snapshot;
-import com.woorea.openstack.base.client.Entity;
import com.woorea.openstack.base.client.HttpMethod;
import com.woorea.openstack.base.client.OpenStackClient;
import com.woorea.openstack.base.client.OpenStackRequest;
package org.onap.appc.client.lcm.impl.business;
-import org.onap.appc.client.impl.core.CoreException;
import org.onap.appc.client.impl.core.ICoreAsyncResponseHandler;
import org.onap.appc.client.lcm.api.ResponseHandler;
import org.onap.appc.client.lcm.exceptions.AppcClientException;
package org.onap.appc.client.impl.protocol;
import org.onap.appc.client.impl.core.MessageContext;
-import com.fasterxml.jackson.databind.JsonNode;
public interface MessageWriter {
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import java.util.StringTokenizer;
import java.util.NoSuchElementException;
-import java.io.StringReader;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.onap.ccsdk.sli.core.sli.SvcLogicAdaptor;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.core.util.Base64;
-import org.jdom.input.SAXBuilder;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
import java.util.LinkedList;
import java.util.List;
-import java.util.Properties;
import org.onap.appc.encryptiontool.wrapper.EncryptionToolDGWrapper;
import org.osgi.framework.BundleActivator;
import org.slf4j.LoggerFactory;
import org.onap.ccsdk.sli.core.dblib.DBResourceManager;
-import org.onap.ccsdk.sli.core.dblib.DbLibService;
public class DbServiceUtil
{
package org.onap.appc.domainmodel.lcm;
import java.time.Instant;
-import java.util.Date;
public class RuntimeContext {
import com.att.eelf.configuration.EELFManager;
import org.onap.appc.configuration.Configuration;
import org.onap.appc.configuration.ConfigurationFactory;
-import org.onap.appc.executionqueue.impl.QueueManager;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
package org.onap.appc.artifact.handler;
-import java.util.HashMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
-import org.json.JSONArray;
-import org.json.JSONObject;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
-import org.onap.appc.artifact.handler.node.ArtifactHandlerNode;
import org.onap.appc.artifact.handler.utils.ArtifactHandlerProviderUtil;
import org.onap.appc.artifact.handler.utils.SdcArtifactHandlerConstants;
-import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
package org.onap.appc.design.data;
-import java.io.File;
-import java.net.URL;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import javax.sql.rowset.CachedRowSet;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.annotation.JsonProperty;
-import org.onap.appc.design.services.util.DesignServiceConstants;
-import org.onap.ccsdk.sli.core.dblib.DBResourceManager;
-import org.onap.ccsdk.sli.core.dblib.DbLibService;
-
public class DesignRequest{
package org.onap.appc.design.dbervices;
import java.sql.ResultSet;
-import java.sql.SQLException;
import java.util.ArrayList;
-import java.util.Properties;
-import java.util.UUID;
import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService;
import org.onap.ccsdk.sli.core.dblib.DBResourceManager;
package org.onap.appc.design.dbervices;
import java.io.IOException;
-import java.security.SecureRandom;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
public class DesignDBService {
package org.onap.appc.design.dbervices;
-import org.onap.appc.design.services.util.ArtifactHandlerClient;
import org.onap.appc.design.services.util.DesignServiceConstants;
import com.att.eelf.configuration.EELFLogger;
package org.onap.appc.design.services;
-import java.util.concurrent.Future;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
import org.opendaylight.yang.gen.v1.org.onap.appc.rev170627.DesignServicesService;
-import org.opendaylight.yangtools.yang.common.RpcResult;
import org.onap.appc.design.services.impl.DesignServicesImpl;
import com.att.eelf.configuration.EELFLogger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.collect.Lists;
import com.google.common.util.concurrent.Futures;
public class DesignServicesImpl implements DesignServicesService {
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
-import java.nio.charset.Charset;
import java.security.SecureRandom;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.Properties;
import javax.ws.rs.HttpMethod;
import javax.ws.rs.core.MediaType;
-import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
package org.onap.appc.design.validator;
-import org.onap.appc.design.services.impl.DesignServicesImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
package org.onap.appc.design.validator;
import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
-import java.io.StringWriter;
-import java.nio.charset.StandardCharsets;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.validation.Validator;
import org.apache.velocity.Template;
-import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.Velocity;
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.exception.MethodInvocationException;
import org.onap.appc.design.services.util.DesignServiceConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
package org.onap.appc.design.xinterface;
-import java.io.File;
-import java.io.IOException;
-
-import com.google.common.base.Charsets;
-import com.google.common.io.Files;
-
public class XResponseProcessor {
public String parseResponse(Object execute, String action) {