use of org.omg.CORBA.BAD_PARAM in project ACS by ACS-Community.
the class ManagerProxyImpl method get_container_info.
/**
* Get all the information that the Manager has about its known Containers.
* To invoke this method, the caller must have INTROSPECT_MANAGER access rights, or it must be the object whose info it is requesting.
* Calling this function does not affect the internal state of the Manager.
*
* @param id Identification of the caller.
* @param h Handles of the containers whose information is requested. If this is an empty sequence, the name_wc parameter is used.
* @param name_wc Wildcard that the container's name must match in order for its information to be returned.
* @return A sequence of ContainerInfo structures containing the entire Manager's knowledge about the containers.
* If access is denied to a subset of objects, the handles to those objects are set to 0.
*/
public ContainerInfo[] get_container_info(int id, int[] h, String name_wc) throws NoPermissionEx {
pendingRequests.incrementAndGet();
try {
// invalid info (replacement for null)
final ContainerInfo invalidInfo = new ContainerInfo("<invalid>", 0, null, new int[0]);
// returned value
ContainerInfo[] retVal = null;
// transform to CORBA specific
com.cosylab.acs.maci.ContainerInfo[] infos = manager.getContainerInfo(id, h, name_wc);
if (infos != null) {
retVal = new ContainerInfo[infos.length];
for (int i = 0; i < infos.length; i++) if (infos[i] == null)
retVal[i] = invalidInfo;
else
retVal[i] = new ContainerInfo(infos[i].getName(), infos[i].getHandle(), (Container) ((ContainerProxy) infos[i].getContainer()).getClient(), infos[i].getComponents().toArray());
} else
retVal = new ContainerInfo[0];
return retVal;
} catch (BadParametersException bpe) {
BadParametersException hbpe = new BadParametersException(bpe.getMessage(), bpe);
reportException(hbpe);
// rethrow CORBA specific
throw new BAD_PARAM(bpe.getMessage());
} catch (NoResourcesException nre) {
NoResourcesException hnre = new NoResourcesException(nre.getMessage(), nre);
reportException(hnre);
// rethrow CORBA specific
throw new NO_RESOURCES(nre.getMessage());
} catch (AcsJNoPermissionEx npe) {
// rethrow CORBA specific
throw npe.toNoPermissionEx();
} catch (Throwable ex) {
CoreException hce = new CoreException(ex.getMessage(), ex);
reportException(hce);
// rethrow CORBA specific
throw new UNKNOWN(ex.getMessage());
} finally {
pendingRequests.decrementAndGet();
}
}
use of org.omg.CORBA.BAD_PARAM in project ACS by ACS-Community.
the class ManagerProxyImpl method restart_component.
/**
* Restarts an component.
* @param id identification of the caller. Called has to be an owner of the component.
* @param component_url CURL of the component to be restarted.
* @return CORBA reference of the restarted component, <code>null</code> if it fails.
*/
public Object restart_component(int id, String component_url) throws NoPermissionEx {
pendingRequests.incrementAndGet();
try {
// returned value
Object retVal = null;
// transform to CORBA specific
URI uri = null;
if (component_url != null)
uri = CURLHelper.createURI(component_url);
Component component = manager.restartComponent(id, uri);
// extract component CORBA reference
if (component != null)
retVal = (Object) component.getObject();
return retVal;
} catch (URISyntaxException usi) {
BadParametersException hbpe = new BadParametersException(usi.getMessage(), usi);
reportException(hbpe);
// rethrow CORBA specific
throw new BAD_PARAM(usi.getMessage());
} catch (BadParametersException bpe) {
BadParametersException hbpe = new BadParametersException(bpe.getMessage(), bpe);
reportException(hbpe);
// rethrow CORBA specific
throw new BAD_PARAM(bpe.getMessage());
} catch (NoResourcesException nre) {
NoResourcesException hnre = new NoResourcesException(nre.getMessage(), nre);
reportException(hnre);
// rethrow CORBA specific
throw new NO_RESOURCES(nre.getMessage());
} catch (AcsJBadParameterEx bpe) {
reportException(bpe);
//throw bpe.toBadParameterEx();
throw new BAD_PARAM(bpe.getMessage());
} catch (AcsJNoPermissionEx npe) {
// rethrow CORBA specific
throw npe.toNoPermissionEx();
} catch (Throwable ex) {
CoreException hce = new CoreException(ex.getMessage(), ex);
reportException(hce);
// rethrow CORBA specific
throw new UNKNOWN(ex.getMessage());
} finally {
pendingRequests.decrementAndGet();
}
}
use of org.omg.CORBA.BAD_PARAM in project wildfly by wildfly.
the class ElytronSASClientInterceptor method receive_exception.
@Override
public void receive_exception(ClientRequestInfo ri) throws ForwardRequest {
try {
ServiceContext sc = ri.get_reply_service_context(SAS_CONTEXT_ID);
Any msg = codec.decode_value(sc.context_data, SASContextBodyHelper.type());
SASContextBody contextBody = SASContextBodyHelper.extract(msg);
// At this point contextBody may contain either a CompleteEstablishContext message or a ContextError message.
// Neither message requires any treatment. We decoded the context body just to check that it contains
// a well-formed message.
IIOPLogger.ROOT_LOGGER.tracef("receive_exception: got SAS reply, type %d", contextBody.discriminator());
} catch (BAD_PARAM e) {
// no service context with sasContextId: do nothing.
} catch (FormatMismatch | TypeMismatch e) {
throw IIOPLogger.ROOT_LOGGER.errorParsingSASReply(e, 0, CompletionStatus.COMPLETED_MAYBE);
}
}
use of org.omg.CORBA.BAD_PARAM in project wildfly by wildfly.
the class ElytronSASClientInterceptor method receive_reply.
@Override
public void receive_reply(ClientRequestInfo ri) {
try {
ServiceContext sc = ri.get_reply_service_context(SAS_CONTEXT_ID);
Any msg = codec.decode_value(sc.context_data, SASContextBodyHelper.type());
SASContextBody contextBody = SASContextBodyHelper.extract(msg);
// At this point contextBody should contain a CompleteEstablishContext message, which does not require any
// treatment. ContextError messages should arrive via receive_exception().
IIOPLogger.ROOT_LOGGER.tracef("receive_reply: got SAS reply, type %d", contextBody.discriminator());
if (contextBody.discriminator() == MTContextError.value) {
// should not happen.
throw IIOPLogger.ROOT_LOGGER.unexpectedContextErrorInSASReply(0, CompletionStatus.COMPLETED_YES);
}
} catch (BAD_PARAM e) {
// no service context with sasContextId: do nothing
} catch (FormatMismatch | TypeMismatch e) {
throw IIOPLogger.ROOT_LOGGER.errorParsingSASReply(e, 0, CompletionStatus.COMPLETED_YES);
}
}
use of org.omg.CORBA.BAD_PARAM in project wildfly by wildfly.
the class SASClientIdentityInterceptor method receive_reply.
@Override
public void receive_reply(ClientRequestInfo ri) {
try {
ServiceContext sc = ri.get_reply_service_context(sasContextId);
Any msg = codec.decode_value(sc.context_data, SASContextBodyHelper.type());
SASContextBody contextBody = SASContextBodyHelper.extract(msg);
// At this point contextBody should contain a CompleteEstablishContext message, which does not require any
// treatment. ContextError messages should arrive via receive_exception().
IIOPLogger.ROOT_LOGGER.tracef("receive_reply: got SAS reply, type %d", contextBody.discriminator());
if (contextBody.discriminator() == MTContextError.value) {
// should not happen.
throw IIOPLogger.ROOT_LOGGER.unexpectedContextErrorInSASReply(0, CompletionStatus.COMPLETED_YES);
}
} catch (BAD_PARAM e) {
// no service context with sasContextId: do nothing.
} catch (FormatMismatch e) {
throw IIOPLogger.ROOT_LOGGER.errorParsingSASReply(e, 0, CompletionStatus.COMPLETED_YES);
} catch (TypeMismatch e) {
throw IIOPLogger.ROOT_LOGGER.errorParsingSASReply(e, 0, CompletionStatus.COMPLETED_YES);
}
}
Aggregations