Package net.floodlightcontroller.core.module

Examples of net.floodlightcontroller.core.module.ApplicationLoader$Application


     * @return the <code>UnitActionPackage</code>
     * @throws XmlException if an error ocurrs.
     */
    public static UnitActionPackage parseWADL(final String wadl) throws XmlException {
        ApplicationDocument applicationDocument = ApplicationDocument.Factory.parse(wadl);
        Application application = applicationDocument.getApplication();
        return Converter.convertWADLtoUnitActionPackage(application);
    }
View Full Code Here


public class WADLGenerator {   
    public static String generateWADLForMashupRESTService(String myCocktailPath, int mashupId) throws DAOException, IOException {
        Mashup mashup = getMashup(mashupId);
       
        ApplicationDocument applicationDocument = ApplicationDocument.Factory.newInstance();
        Application application = applicationDocument.addNewApplication();
        Resources resources = application.addNewResources();
        resources.setBase(myCocktailPath);
       
        Resource resource = resources.addNewResource();
        resource.setPath("RESTService/mashupId="+mashupId);
       
View Full Code Here

   
    public static String generateWADLForMashupRESTServiceJSON(String myCocktailPath, int mashupId) throws DAOException, IOException {
        Mashup mashup = getMashup(mashupId);
       
        ApplicationDocument applicationDocument = ApplicationDocument.Factory.newInstance();
        Application application = applicationDocument.addNewApplication();
        Resources resources = application.addNewResources();
        resources.setBase(myCocktailPath);
       
        Resource resource = resources.addNewResource();
        resource.setPath("RESTService/mashupId="+mashupId);
       
View Full Code Here

                if (authentication instanceof PreAuthenticatedAuthenticationToken) {
                    PreAuthenticatedAuthenticationToken authToken = (PreAuthenticatedAuthenticationToken) authentication;
                    final Object credentials = authToken.getCredentials();
                    if (credentials instanceof AuthorizationToken) {
                        AuthorizationToken token = (AuthorizationToken) credentials;
                        final Application applicationForToken = oAuth2MgmtService.getApplicationForToken(token);
                        String addConnectorCallbackURL = applicationForToken.addConnectorCallbackURL;
                        if (addConnectorCallbackURL !=null) {
                            String connectorName = location.substring(location.lastIndexOf("/")+1);
                            addConnectorCallbackURL += addConnectorCallbackURL.indexOf("?")==-1
                                                     ? "?connectorName=" + connectorName
View Full Code Here

    EntityManager em;

    @Override
    @Transactional(readOnly=false)
    public void createApplication(final long guestId, String organization, final String name, final String description, final String website) {
        Application app = new Application(guestId, organization, name, description, website);
        em.persist(app);
    }
View Full Code Here

    }

    @Override
    @Transactional(readOnly=false)
    public void deleteApplication(final long guestId, final String uid) {
        final Application app = getApplication(guestId, uid);
        if (app!=null)
            em.remove(app);
    }
View Full Code Here

    @Override
    public Application getApplication(long guestId, String uid) {
        final TypedQuery<Application> query = em.createQuery("SELECT app FROM Application app WHERE app.uid=?", Application.class);
        query.setParameter(1, uid);
        if (query.getResultList().size()>0) {
            final Application app = query.getResultList().get(0);
            if (app.guestId!=guestId)
                throw new RuntimeException("Could not delete app: guestIds don't match");
            return app;
        }
        return null;
View Full Code Here

    @Override
    public Application getApplication(String appSecret) {
        final TypedQuery<Application> query = em.createQuery("SELECT app FROM Application app WHERE app.sharedSecret=?", Application.class);
        query.setParameter(1, appSecret);
        if (query.getResultList().size()>0) {
            final Application app = query.getResultList().get(0);
            return app;
        }
        return null;
    }
View Full Code Here

    }

    @Override
    @Transactional(readOnly=false)
    public void updateApplication(final long guestId, final String organization, final String uid, final String name, final String description, final String website) {
        final Application app = getApplication(guestId, uid);
        if (app!=null) {
            app.name = name;
            app.organization = organization;
            app.description = description;
            app.website = website;
View Full Code Here

        query.setParameter(1, guestId);
        final List<AuthorizationToken> resultList = query.getResultList();
        final List<AuthorizationTokenModel> tokenModels = new ArrayList<AuthorizationTokenModel>();
        for (AuthorizationToken authorizationToken : resultList) {
            AuthorizationCode authCode = em.find(AuthorizationCode.class, authorizationToken.authorizationCodeId);
            Application application = em.find(Application.class, authCode.applicationId);
            AuthorizationTokenModel tokenModel = new AuthorizationTokenModel(authorizationToken.accessToken,
                    application.name, application.organization, application.website, authCode.creationTime);
            tokenModels.add(tokenModel);
        }
        return tokenModels;
View Full Code Here

TOP

Related Classes of net.floodlightcontroller.core.module.ApplicationLoader$Application

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.