Handles the response when the change of availability has been accepted or scheduled, e.g. not rejected.

@param chargingStationId The charging station identifier.
@param domainService The domain service.
@param addOnIdentity The AddOn identity.
507211
private void handleAcceptedOrScheduledChangeAvailabilityResponse(ChargingStationId chargingStationId, DomainService domainService, AddOnIdentity addOnIdentity) {
        if (Changeavailability.Type.INOPERATIVE.equals(availabilityType)) {
            if (evseId.getNumberedId() == 0) {
                domainService.changeChargingStationAvailabilityToInoperative(chargingStationId, getCorrelationToken(), addOnIdentity);
            } else {
                domainService.changeComponentAvailabilityToInoperative(chargingStationId, evseId, ChargingStationComponent.EVSE, getCorrelationToken(), addOnIdentity);
            }
        } else {
            if (evseId.getNumberedId() == 0) {
                domainService.changeChargingStationAvailabilityToOperative(chargingStationId, getCorrelationToken(), addOnIdentity);
            } else {
                domainService.changeComponentAvailabilityToOperative(chargingStationId, evseId, ChargingStationComponent.EVSE, getCorrelationToken(), addOnIdentity);
            }
        }
    }
819231
public void setDomain(Annotation v) {
    if (OntRelationMention_Type.featOkTst && ((OntRelationMention_Type)jcasType).casFeat_domain == null)
      jcasType.jcas.throwFeatMissing("domain", "de.julielab.jules.types.OntRelationMention");
    jcasType.ll_cas.ll_setRefValue(addr, ((OntRelationMention_Type)jcasType).casFeatCode_domain, jcasType.ll_cas.ll_getFSRef(v));}
1320637
public AddonChange addAddon(String appName, String addonName) {
        return connection.execute(new AddonInstall(appName, addonName), apiKey);
    }
66496
private RpcBatch.Callback<Change> createChangeRequestCallback(
      final String zoneName,
      final DnsBatchResult<ChangeRequest> result,
      final boolean nullForNotFound,
      final boolean idempotent) {
    return new RpcBatch.Callback<Change>() {
      @Override
      public void onSuccess(Change response) {
        result.success(
            response == null
                ? null
                : ChangeRequest.fromPb(options.getService(), zoneName, response));
      }

      @Override
      public void onFailure(GoogleJsonError googleJsonError) {
        DnsException serviceException = new DnsException(googleJsonError, idempotent);
        if (serviceException.getCode() == HTTP_NOT_FOUND) {
          if ("entity.parameters.changeId".equals(serviceException.getLocation())
              || (serviceException.getMessage() != null
                  && serviceException.getMessage().contains("parameters.changeId"))) {
            // the change id was not found, but the zone exists
            result.success(null);
            return;
          }
          // the zone does not exist, so throw an exception
        }
        result.error(serviceException);
      }
    };
  }
53470
public boolean addRoleForUserInDomain(String user, String role, String domain) {
        return addGroupingPolicy(user, role, domain);
    }
1209131
public static boolean validateServiceName(Configuration conf,
      String nameServiceId) {
    Collection<String> nameserviceIds = DFSUtil.getNameServiceIds(conf);
    if (nameserviceIds != null && !nameserviceIds.isEmpty()) {
      if (nameServiceId == null) {
        System.err.println("Need to input a nameservice id");
        return false;
      } else if (!nameserviceIds.contains(nameServiceId)) {
        System.err.println("An invalid nameservice id: " + nameServiceId);
        return false;
      }
    } else if (nameServiceId != null) {
      System.err.println("An invalid nameservice id: " + nameServiceId);
      return false;
    }
    return true;
  }
652682
public ChargePointService createChargingStationService(String chargingStationAddress) {
        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.setServiceClass(ChargePointService.class);

        factory.setAddress(chargingStationAddress);

        SoapBindingConfiguration conf = new SoapBindingConfiguration();
        conf.setVersion(Soap12.getInstance());
        factory.setBindingConfig(conf);
        factory.getFeatures().add(new WSAddressingFeature());
        ChargePointService chargePointService = (ChargePointService) factory.create();

        //Force the use of the Async transport, even for synchronous calls
        ((BindingProvider) chargePointService).getRequestContext().put("use.async.http.conduit", Boolean.TRUE);

        return chargePointService;
    }
588375
@EventHandler
    public void handle(ComponentAvailabilityChangedToInoperativeEvent event) {
        updateComponentAvailability(event.getChargingStationId(), event.getComponentId(), event.getComponent(), Availability.INOPERATIVE);
    }
764881
public static void validateServiceInstanceID(String id) throws ServiceException {
        if (!validateRequiredField(id, idRegEx)) {
            throw new ServiceException(
                    ErrorCode.SERVICE_INSTANCE_ID_FORMAT_ERROR);
        }
    }
373971
private void updateDomain(Long domainId, String name, String authorityType, String ttl, boolean reverse) throws GloboDnsException {
		if (domainId == null) {
			throw new GloboDnsException("Domain id cannot be null");
		}
		
		Domain domain = new Domain();
		if (name != null)
			domain.getDomainAttributes().setName(name);
		if (authorityType != null)
			domain.getDomainAttributes().setAuthorityType(authorityType);
		if (ttl != null)
			domain.getDomainAttributes().setTTL(ttl);
		
		GloboDnsRoot<Domain> globoDnsRoot = this.put("/domains/" + domainId + ".json" + (reverse ? "?reverse=true" : ""), domain, false);
		if (globoDnsRoot == null) {
			throw new GloboDnsException("Invalid response");
		}
		return;
	}
1185853
void launchAddServiceProviderDialog(final String federation) {
        ComboBoxItem securityDomains = new ComboBoxItem("security-domain", "Security Domain");
        securityDomains.setRequired(true);
        securityDomains.setValueMap(this.securityDomains);

        DefaultWindow dialog = new DefaultWindow(Console.MESSAGES.newTitle("Service Provider"));
        ResourceDescription resourceDescription = descriptionRegistry.lookup(SERVICE_PROVIDER_TEMPLATE);
        //noinspection Duplicates
        AddResourceDialog addDialog = new AddResourceDialog(securityContext, resourceDescription,
                new AddResourceDialog.Callback() {
                    @Override
                    public void onAdd(ModelNode payload) {
                        dialog.hide();

                        String name = payload.get("name").asString();
                        ResourceAddress address = SERVICE_PROVIDER_TEMPLATE.resolve(statementContext, federation, name);
                        payload.get(OP).set(ADD);
                        payload.get(ADDRESS).set(address);
                        dispatcher.execute(new DMRAction(payload), new SimpleCallback<DMRResponse>() {
                            @Override
                            public void onFailure(Throwable caught) {
                                super.onFailure(caught);
                                readServiceProvider(federation);
                            }

                            @Override
                            public void onSuccess(DMRResponse dmrResponse) {
                                Console.info(Console.MESSAGES.successfullyAdded((name)));
                                readServiceProvider(federation);
                            }
                        });
                    }

                    @Override
                    public void onCancel() {
                        dialog.hide();
                    }
                })
                .addFactory("security-domain", attributeDescription -> securityDomains)
                .include();

        dialog.setWidth(640);
        dialog.setHeight(480);
        dialog.setWidget(addDialog);
        dialog.setGlassEnabled(true);
        dialog.center();
    }
812950
protected void verifyRegisteredService(final RequestContext requestContext, final RegisteredService registeredService) {
        if (registeredService == null || !registeredService.getAccessStrategy().isServiceAccessAllowed()) {
            LOGGER.debug("Service [{}] is not recognized/allowed by the CAS service registry", registeredService);
            if (registeredService != null) {
                WebUtils.putUnauthorizedRedirectUrlIntoFlowScope(requestContext, registeredService.getAccessStrategy().getUnauthorizedRedirectUrl());
            }
            throw new UnauthorizedServiceException(UnauthorizedServiceException.CODE_UNAUTHZ_SERVICE, StringUtils.EMPTY);
        }
    }
173536
@EventHandler
    public void handle(AuthorizationListVersionReceivedEvent event) {
        ChargingStation chargingStation = repository.findOne(event.getChargingStationId().getId());

        if (chargingStation != null) {
            chargingStation.setLocalAuthorizationListVersion(event.getVersion());
            repository.createOrUpdate(chargingStation);
        }
    }
897533
@EventHandler
    public void handle(ChargingStationCreatedEvent event) {
        for (UserIdentity userIdentity : event.getUserIdentitiesWithAllPermissions()) {
            commandAuthorizationRepository.createOrUpdate(event.getChargingStationId().getId(), userIdentity.getId(), AllPermissions.class);
        }
    }
982051
public void createService(String domainProviderName, boolean force, Map<String, String> attributes) {
        // check if a domain has been chosen
        if (domainProviderName == null || domainProviderName.isEmpty()) {
            domainProviderName = selectDomainProvider();
        }

        // get domain provider Id
        String domainProviderId = "";
        List<DomainProvider> domainProvider = getDomainProvider();
        for (DomainProvider provider : domainProvider) {
            if (provider.getName().getString(Locale.getDefault()).equals(domainProviderName)) {
                domainProviderId = provider.getId();
            }
        }
        // get the connector which should be created
        ConnectorProvider connectorProvider =
            getConnectorToCreate(domainProviderId, attributes.get(ServiceCommands.CONNECTOR_TYPE));

        String id;
        if (attributes.isEmpty() || !attributes.containsKey(org.osgi.framework.Constants.SERVICE_PID)) {
            OutputStreamFormater.printValue("Please enter an ID");
            id = readUserInput();
        } else {
            id = attributes.get(org.osgi.framework.Constants.SERVICE_PID);
        }

        ServiceDescriptor descriptor = connectorProvider.getDescriptor();
        OutputStreamFormater.printValue(String.format("Please enter the attributes for %s, keep empty for default",
            descriptor.getName().getString(Locale.getDefault())));

        // get attributes for connector
        Map<String, String> attributeMap = getConnectorAttributes(descriptor.getAttributes(), attributes);
        Map<String, Object> properties = new HashMap<String, Object>();

        ConnectorDescription connectorDescription =
            new ConnectorDescription(domainProviderId, connectorProvider.getId(), attributeMap, properties);
        if (force) {
            if (id != null && !id.isEmpty()) {
                serviceManager.forceCreateWithId(id, connectorDescription);
            } else {
                serviceManager.forceCreate(connectorDescription);
            }
            OutputStreamFormater.printValue("Connector successfully created");
        } else {
            OutputStreamFormater.printValue("Do you want to create the connector with the following attributes:", "");
            OutputStreamFormater.printValue("Connector ID", id);
            for (String key : attributeMap.keySet()) {
                OutputStreamFormater.printValue(key, attributeMap.get(key));
            }
            OutputStreamFormater.printValue("Create connector: (Y/n)");
            if (!readUserInput().equalsIgnoreCase("n")) {
                try {
                    if (id != null && !id.isEmpty()) {
                        serviceManager.createWithId(id, connectorDescription);
                    } else {
                        serviceManager.create(connectorDescription);
                    }
                    OutputStreamFormater.printValue("Connector successfully created");
                } catch (RuntimeException e) {
                    e.printStackTrace();
                    OutputStreamFormater.printValue("Connector validation failed, creation aborted");
                }
            } else {
                OutputStreamFormater.printValue("Creation aborted");
            }
        }
    }
864368
public void registerTimerService(String id, TimerService timerService) {   
        if (timerService instanceof GlobalTimerService) {
            ((GlobalTimerService) timerService).setTimerServiceId(id);
        }
        this.registeredServices.put(id, timerService);
    }
1017759
@Override
  public final void setItsId(final SeServicePlaceId pItsId) {
    this.itsId = pItsId;
    if (this.itsId != null) {
      this.pickUpPlace = this.itsId.getPickUpPlace();
      this.item = this.itsId.getItem();
    } else {
      this.pickUpPlace = null;
      this.item = null;
    }
  }