Package org.nimbustools.ctxbroker.generated.gt4_0.description

Examples of org.nimbustools.ctxbroker.generated.gt4_0.description.IdentityProvides_Type


        final MessageElement elem = resp.get_any()[0];
        if (elem == null) {
            throw new ExecutionProblem("No message in query response");
        }

        final ContextualizationContext context;
        try {
            context = (ContextualizationContext)
                    ObjectDeserializer.toObject(elem,
                                                ContextualizationContext.class);
        } catch (DeserializationException e) {
View Full Code Here


            logger.error("Problem: returning null contextualization context " +
                    "RP for '" + this.resourceID + "': " + e.getMessage());
            return null;
        }

        final ContextualizationContext context = new ContextualizationContext();

        context.setNoMoreInjections(noMoreInjections);

        context.setAllOK(status.isAllOk());
        context.setErrorPresent(status.isErrorOccurred());

        context.setComplete(status.isComplete());

        return context;
    }
View Full Code Here

            }

            return; // *** EARLY RETURN ***
        }

        ContextualizationContext contextRP;
        try {

            while (true) {
                try {
                    contextRP = this.rpQuery.query();
                    if (this.analyzeResult(contextRP)) {
                        break;
                    }
                    Thread.sleep(this.pollDelayMs);
                } catch (InterruptedException e) {
                    // ignore
                }
            }

            final String msg = "Querying ended via analyzeResult";
            if (this.pr.useThis()) {
                this.pr.debugln(msg);
            } else {
                logger.debug(msg);
            }

        } catch (BaseFaultType e) {
            final String err =
                    CommonStrings.faultStringOrCommonCause(e, "context");
            throw new ExecutionProblem(err, e);
        }

        if (contextRP.isErrorPresent()) {

            if (this.pr.enabled()) {
                final String msg =
                        "Problem with " + this.nameToPrint + " context";
                if (this.pr.useThis()) {
                    this.pr.infoln(PrCodes.CTXMONITOR__ONE_ERROR, msg);
                } else if (this.pr.useLogging()) {
                    logger.info(msg);
                }
            }

        } else if (contextRP.isAllOK()) {

            if (this.pr.enabled()) {
                final String msg = this.nameToPrint + ": contextualized";
                if (this.pr.useThis()) {
                    this.pr.infoln(PrCodes.CTXMONITOR__ALL_OK, "  - " + msg);
                } else if (this.pr.useLogging()) {
                    logger.info(msg);
                }
            }

        } else {
            throw new ExecutionProblem("Incorrect analysis of ctx query?");
        }

        // both oneErrorExists and allOK trigger report(s) if path is configured
        if (this.args.reportDir != null) {
            try {
                this.writeSummary(contextRP);
            } catch (Exception e) {
                final String err = CommonUtil.genericExceptionMessageWrapper(e);
                throw new ExecutionProblem(
                        "Problem writing ctx summary: " + err, e);
            }
        }

        // in all cases get the full node report
        Node_Type[] nodes = null;
        try {
            this.identitiesQuery.setQueryAll(true);
            nodes = this.identitiesQuery.identities();
        } catch (NimbusContextualizationFault e) {
            final String err = CommonUtil.genericExceptionMessageWrapper(e);
            if (this.pr.enabled()) {
                final String errMsg = "Problem querying ctx nodes: " + err;
                if (this.pr.useThis()) {
                    this.pr.errln(errMsg);
                } else if (this.pr.useLogging()) {
                    logger.error(errMsg);
                }
            }
        }

        // both oneErrorExists and allOK trigger report(s) if path is configured
        if (nodes != null && this.args.reportDir != null) {
            try {
                this.writeReports(nodes);
            } catch (Exception e) {
                final String err = CommonUtil.genericExceptionMessageWrapper(e);
                throw new ExecutionProblem(
                        "Problem writing ctx summary: " + err, e);
            }
        }

        if (contextRP.isErrorPresent()) {
            throw new ExitNow(1);
        }
       
        if (nodes != null && this.adjustSshKnownHosts) {
            try {
View Full Code Here

            // note to object extenders
            throw new IllegalArgumentException("getCreateArguments may " +
                    "not return null");
        }

        final CreateContextResponse_Type resp;
        try {
            resp =
                ((NimbusContextBrokerPortType) this.portType).create(t_create);

            if (resp == null ||
                    resp.getContextEPR() == null ||
                        resp.getContact() == null ||
                        resp.getContact().getBrokerURL() == null ||
                        resp.getContact().getContextID() == null ||
                        resp.getContact().getSecret() == null) {
               
                throw new ExecutionProblem("did not receive a valid result " +
                        "from context create operation (?)");
            }
        } catch (NimbusContextualizationFault e) {
View Full Code Here

        try {
            final EndpointReferenceType ref =
                    this.home.createNewResource(caller, expectInjections);
            final String id = this.home.getResourceKey(ref).toString();

            final CreateContextResponse_Type resp =
                    new CreateContextResponse_Type();
            resp.setContextEPR(ref);
            resp.setContact(
                    new BrokerContactType(this.home.getBrokerURL(), id,
                                          this.home.getContextSecret(ref)));

            return resp;
           
View Full Code Here

            }

            return; // *** EARLY RETURN ***
        }

        CreateContextResponse_Type resp;
        try {
            resp = this.ctx_create.create();
        } catch (NimbusContextualizationFault e) {
            final String err =
                    CommonStrings.faultStringOrCommonCause(e, "context broker");
            throw new ExecutionProblem(err, e);
        }

        this.writeContextEprPossibly(resp.getContextEPR());
        this.writeBrokerContactPossibly(resp.getContact());
    }
View Full Code Here

    protected Object action() throws Exception {
        return this.create();
    }

    protected CreateContext_Type getCreateArguments() {
        final CreateContext_Type t_create = new CreateContext_Type();
        t_create.setExpectInjections(false);
        return t_create;
    }
View Full Code Here

            throws ParameterProblem, ExecutionProblem,
                   NimbusContextualizationFault {

        this.validateAll();

        final CreateContext_Type t_create = this.getCreateArguments();
        if (t_create == null) {
            // note to object extenders
            throw new IllegalArgumentException("getCreateArguments may " +
                    "not return null");
        }
View Full Code Here

    // -------------------------------------------------------------------------
    // extends
    // -------------------------------------------------------------------------

    protected CreateContext_Type getCreateArguments() {
        final CreateContext_Type t_create = new CreateContext_Type();
        t_create.setExpectInjections(true);
        return t_create;
    }
View Full Code Here

            buf.append("sent envelope is null");
        }
        buf.append(")");
        logger.info(buf.toString());

        final IdentitiesResponse_Type response = new IdentitiesResponse_Type();
        try {
            if (all) {
                response.setNode(resource.identityQueryAll());
            } else if (host != null) {
                response.setNode(resource.identityQueryHost(host));
            } else if (ip != null) {
                response.setNode(resource.identityQueryIP(ip));
            } else {
                throw ContextFault.makeCtxFault("nothing queried?", null);
            }
        } catch (ContextBrokerException e) {
            if (logger.isDebugEnabled()) {
View Full Code Here

TOP

Related Classes of org.nimbustools.ctxbroker.generated.gt4_0.description.IdentityProvides_Type

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.