/** * Return an object identified by its name. * * @param opName The name of the object. * @return The found operation or null. */ public COMObject getObjectByName(final Identifier opName) { return objectsByName.get(opName.getValue()); }
protected static boolean createRoutingKeyIdentifier(StringBuilder buf, String propertyId, Identifier id) { if ((null != id) && (null != id.getValue()) && (!"*".equals(id.getValue()))) { buf.append(propertyId); buf.append(" = '"); buf.append(id.getValue()); buf.append('\''); return true; } return false; }
/** * Checks if the domain contains a wildcard in any of the parts * * @param receivedDomain Domain * @return Name of the COM object */ public static Boolean domainContainsWildcard(final IdentifierList receivedDomain) { // Do we have the '*' on any part of the domain? if (receivedDomain == null) { return true; } for (Identifier part : receivedDomain) { if ("*".equals(part.getValue())) { return true; } } return false; }
/** * Encode an identifier */ @Override public void encodeIdentifier(final Identifier value) throws MALException { encodeString(value.getValue()); }
@Override public UInteger actionArrived(Identifier name, AttributeValueList attributeValues, Long actionInstanceObjId, boolean reportProgress, MALInteraction interaction) { // Just an example if ("Go".equals(name.getValue())) { // action1 was called? return null; } return new UInteger(1); // Action service not integrated }
@Override public void removeSubscriptions(final IdentifierList subscriptions) { if (null != subscriptions) { for (Identifier sub : subscriptions) { details.remove(sub.getValue()); } updateIds(); } else { // remove all details.clear(); required.clear(); } }
/** * Adds a COM object to this service specification. * * @param object The new object to add. * @throws java.lang.IllegalArgumentException If the argument is null. */ @Proposed public void addCOMObject(COMObject object) throws java.lang.IllegalArgumentException { objectsByNumber.put(object.getObjectType().getNumber().getValue(), object); objectsByName.put(object.getObjectName().getValue(), object); }
@Override public void addSubscription(final MALMessageHeader srcHdr, final Subscription subscription) { final String subId = subscription.getSubscriptionId().getValue(); SimpleSubscriptionDetails sub = details.get(subId); if (null == sub) { sub = new SimpleSubscriptionDetails(subId); details.put(subId, sub); } sub.setIds(srcHdr, subscription.getEntities()); updateIds(); }
/** * Constructor. * * @param hdr Source message. */ public AddressKey(final MALMessageHeader hdr) { this.uri = hdr.getURITo().getValue(); this.domain = hdr.getDomain(); this.networkZone = hdr.getNetworkZone().getValue(); this.session = hdr.getSession().getOrdinal(); this.sessionName = hdr.getSessionName().getValue(); }
@Override public void encodeNullableIdentifier(final Identifier value) throws MALException { try { if ((null != value) && (null != value.getValue())) { encodeIdentifier(value); } else { outputStream.addBytes((byte[]) null); } } catch (IOException ex) { throw new MALException(ENCODING_EXCEPTION_STR, ex); } }
/** * Checks if the archiveDetails structure contains a null value in any of * the following fields: network, timestamp or provider * * @param archiveDetails The archive details object to be checked. * @return The boolean value of the comparison */ public static Boolean archiveDetailsContainsNull(ArchiveDetails archiveDetails) { // Check if null return archiveDetails.getNetwork().getValue() == null || archiveDetails.getTimestamp() == null || archiveDetails.getProvider().getValue() == null; }
/** * Constructor. * @param hdr Source message. */ public BrokerKey(final MALMessageHeader hdr) { this.uri = hdr.getURITo().getValue(); this.session = hdr.getSession().getOrdinal(); this.sessionName = hdr.getSessionName().getValue(); }
@Override public void encodeNullableIdentifier(final Identifier value) throws MALException { try { if ((null != value) && (null != value.getValue())) { outputStream.addNotNull(); encodeIdentifier(value); } else { outputStream.addIsNull(); } } catch (IOException ex) { throw new MALException(ENCODING_EXCEPTION_STR, ex); } }
@Override public void encodeNullableIdentifier(final Identifier value) throws MALException { try { if ((null != value) && (null != value.getValue())) { outputStream.addNotNull(); encodeIdentifier(value); } else { outputStream.addIsNull(); } } catch (IOException ex) { throw new MALException(ENCODING_EXCEPTION_STR, ex); } }
public ArchivePersistenceObject(final ObjectType objectType, final IdentifierList domain, final Long objId, final ArchiveDetails archiveDetails, final Object object) { this.objectType = objectType; this.domainId = domain; this.objId = objId; this.providerURI = archiveDetails.getProvider().getValue(); this.network = archiveDetails.getNetwork().getValue(); this.timestampArchiveDetails = archiveDetails.getTimestamp().getValue(); this.sourceLink = archiveDetails.getDetails().getSource(); this.relatedLink = archiveDetails.getDetails().getRelated(); // this.obj = (Element) HelperAttributes.javaType2Attribute(object); this.object = object; }