com.openshift.restclient.IResourceFactory Maven / Gradle / Ivy
The newest version!
/*******************************************************************************
* Copyright (c) 2015 Red Hat, Inc. Distributed under license by Red Hat, Inc.
* All rights reserved. This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: Red Hat, Inc.
******************************************************************************/
package com.openshift.restclient;
import java.io.InputStream;
import java.util.List;
import com.openshift.restclient.api.ITypeFactory;
import com.openshift.restclient.model.IResource;
/**
* Factory class for creating resources from a response string
*
*/
public interface IResourceFactory extends ITypeFactory {
/**
* Create a list of resources of the given kind from a response string
*
* @throws ResourceFactoryException
* if it is unable to create resources
*/
List createList(String json, String kind);
/**
* Create a resource from a response string
*
* @param response
* @return
* @throws ResourceFactoryException
* if it is unable to create resources
*/
T create(String response);
/**
* Create a resource from a response string
*
* @param input
* Read the given input stream which assumes the input is parsable
* JSON representing a valid resource
* @return
* @throws ResourceFactoryException
* if it is unable to create resources
*/
T create(InputStream input);
/**
* Create(or stub) a resource for a given version and kind
*
* @param version
* @param kind
* @return
*/
T create(String version, String kind);
/**
* Create(or stub) a resource for a given version and kind and name
*
* @param version
* @param kind
* @param name
*
* @return
*/
T create(String version, String kind, String name);
/**
* Stub out the given resource kind using a version determined by the factory
*
* @param kind
* @param name
* @return
*/
T stub(String kind, String name);
/**
* Stub out the given resource kind using a version determined by the factory
*
* @param kind
* @param name
* @param namespace
* @return
*/
T stub(String kind, String name, String namespace);
/**
* The client given to resources when they are created
*
*/
void setClient(IClient client);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy