idx int64 0 41.2k | question stringlengths 74 4.04k | target stringlengths 7 750 |
|---|---|---|
22,100 | @ Help ( help = "Get the PhysicalNetworkFunctionDescriptor with specific id of a NetworkServiceDescriptor with specific id" ) public PhysicalNetworkFunctionDescriptor getPhysicalNetworkFunctionDescriptor ( final String idNsd , final String idPnf ) throws SDKException { String url = idNsd + "/pnfdescriptors" + "/" + idP... | Returns a specific PhysicalNetworkFunctionDescriptor that is contained in a particular NetworkServiceDescriptor . |
22,101 | @ Help ( help = "Delete the PhysicalNetworkFunctionDescriptor of a NetworkServiceDescriptor with specific id" ) public void deletePhysicalNetworkFunctionDescriptor ( final String idNsd , final String idPnf ) throws SDKException { String url = idNsd + "/pnfdescriptors" + "/" + idPnf ; requestDelete ( url ) ; } | Delete a specific PhysicalNetworkFunctionDescriptor which is contained in a particular NetworkServiceDescriptor . |
22,102 | @ Help ( help = "Create the PhysicalNetworkFunctionDescriptor of a NetworkServiceDescriptor with specific id" ) public PhysicalNetworkFunctionDescriptor createPhysicalNetworkFunctionDescriptor ( final String idNsd , final PhysicalNetworkFunctionDescriptor physicalNetworkFunctionDescriptor ) throws SDKException { String... | Create a new PhysicalNetworkFunctionDescriptor in a NetworkServiceDescriptor |
22,103 | @ Help ( help = "Update the PhysicalNetworkFunctionDescriptor of a NetworkServiceDescriptor with specific id" ) public PhysicalNetworkFunctionDescriptor updatePNFD ( final String idNsd , final String idPnf , final PhysicalNetworkFunctionDescriptor physicalNetworkFunctionDescriptor ) throws SDKException { String url = i... | Update a PhysicalNetworkFunctionDescriptor . |
22,104 | @ Help ( help = "Get all the Security of a NetworkServiceDescriptor with specific id" ) public Security getSecurities ( final String idNsd ) throws SDKException { String url = idNsd + "/security" ; return ( ( Security ) requestGet ( url , Security . class ) ) ; } | Returns a List of all Security objects that are contained in a specific NetworkServiceDescriptor . |
22,105 | @ Help ( help = "Delete the Security of a NetworkServiceDescriptor with specific id" ) public void deleteSecurity ( final String idNsd , final String idSecurity ) throws SDKException { String url = idNsd + "/security" + "/" + idSecurity ; requestDelete ( url ) ; } | Delete a Security object . |
22,106 | @ Help ( help = "Create the Security of a NetworkServiceDescriptor with specific id" ) public Security createSecurity ( final String idNSD , final Security security ) throws SDKException { String url = idNSD + "/security" + "/" ; return ( Security ) requestPost ( url , security ) ; } | Add a new Security object to a NetworkServiceDescriptor . |
22,107 | @ Help ( help = "Update the Security of a NetworkServiceDescriptor with specific id" ) public Security updateSecurity ( final String idNSD , final String idSecurity , final Security updatedSecurity ) throws SDKException { String url = idNSD + "/security" + "/" + idSecurity ; return ( Security ) requestPut ( url , updat... | Update a Security object of a specific NetworkServiceDescriptor . |
22,108 | private static SAXParser getSAXParser ( ) { SoftReference < SAXParser > ref = PARSER . get ( ) ; SAXParser result = ref . get ( ) ; if ( result == null ) { Exception thrown ; try { result = SAX_FACTORY . newSAXParser ( ) ; ref = new SoftReference < SAXParser > ( result ) ; PARSER . set ( ref ) ; return result ; } catch... | Gets a SAXParser for use in parsing incoming messages . |
22,109 | protected String resolveResourceContextPath ( HttpServletRequest request , String resource ) { final String resourceContextPath = this . getResourceServerContextPath ( ) ; this . logger . debug ( "Attempting to locate resource serving webapp with context path: {}" , resourceContextPath ) ; final ServletContext resource... | If the resource serving servlet context is available and the resource is available in the context create a URL to the resource in that context . If not create a local URL for the requested resource . |
22,110 | protected String getResourceServerContextPath ( ) { final String resourceContextPath = this . servletContext . getInitParameter ( RESOURCE_CONTEXT_INIT_PARAM ) ; if ( resourceContextPath == null ) { return DEFAULT_RESOURCE_CONTEXT ; } if ( ! resourceContextPath . startsWith ( "/" ) ) { return "/" . concat ( resourceCon... | Determine the context name of the resource serving webapp |
22,111 | private static TerminalBindingCondition create ( final String condition , final String message ) { return createWithCode ( condition , message , null ) ; } | Helper method to call the helper method to add entries . |
22,112 | private static TerminalBindingCondition createWithCode ( final String condition , final String message , final Integer code ) { if ( condition == null ) { throw ( new IllegalArgumentException ( "condition may not be null" ) ) ; } if ( message == null ) { throw ( new IllegalArgumentException ( "message may not be null" ... | Helper method to add entries . |
22,113 | @ Help ( help = "Creates a new service" ) public String create ( String serviceName , List < String > roles ) throws SDKException { HashMap < String , Object > requestBody = new HashMap < > ( ) ; requestBody . put ( "name" , serviceName ) ; requestBody . put ( "roles" , roles ) ; return new String ( ( byte [ ] ) reques... | Creates a new service . |
22,114 | public static String getVersion ( String path , Class < ? > klass ) { try { final InputStream in = klass . getClassLoader ( ) . getResourceAsStream ( path ) ; if ( in != null ) { try { final BufferedReader reader = new BufferedReader ( new InputStreamReader ( in ) ) ; String line = reader . readLine ( ) ; while ( line ... | Attempts to get a version property from a specified resource |
22,115 | public static BodyQName create ( final String uri , final String local ) { return createWithPrefix ( uri , local , null ) ; } | Creates a new qualified name using a namespace URI and local name . |
22,116 | public static BodyQName createWithPrefix ( final String uri , final String local , final String prefix ) { if ( uri == null || uri . length ( ) == 0 ) { throw ( new IllegalArgumentException ( "URI is required and may not be null/empty" ) ) ; } if ( local == null || local . length ( ) == 0 ) { throw ( new IllegalArgumen... | Creates a new qualified name using a namespace URI and local name along with an optional prefix . |
22,117 | public static boolean methodsAreEqual ( Method m1 , Method m2 ) { if ( ! m1 . getName ( ) . equals ( m2 . getName ( ) ) ) return false ; if ( ! m1 . getReturnType ( ) . equals ( m2 . getReturnType ( ) ) ) return false ; if ( ! Objects . deepEquals ( m1 . getParameterTypes ( ) , m2 . getParameterTypes ( ) ) ) return fal... | Returns true if the two passed methods are equal . Methods are in this case regarded as equal if they take the same parameter types return the same return type and share the same name . |
22,118 | @ Help ( help = "Create the object of type {#}" ) public T create ( final T object ) throws SDKException { return ( T ) requestPost ( object ) ; } | Sends a request for creating an instance of type T to the NFVO API . |
22,119 | @ Help ( help = "Find all the objects of type {#}" ) public List < T > findAll ( ) throws SDKException { return Arrays . asList ( ( T [ ] ) requestGet ( null , clazz ) ) ; } | Sends a request for finding all instances of type T to the NFVO API . |
22,120 | @ Help ( help = "Find the object of type {#} through the id" ) public T findById ( final String id ) throws SDKException { return ( T ) requestGet ( id , clazz ) ; } | Sends a request to the NFVO API for finding an instance of type T specified by it s ID . |
22,121 | @ Help ( help = "Update the object of type {#} passing the new object and the id of the old object" ) public T update ( final T object , final String id ) throws SDKException { return ( T ) requestPut ( id , object ) ; } | Sends a request to the NFVO API for updating an instance of type T specified by its ID . |
22,122 | public String requestPost ( final String id ) throws SDKException { CloseableHttpResponse response = null ; HttpPost httpPost = null ; checkToken ( ) ; try { log . debug ( "pathUrl: " + pathUrl ) ; log . debug ( "id: " + pathUrl + "/" + id ) ; log . debug ( "Executing post on: " + this . pathUrl + "/" + id ) ; httpPost... | Does the POST Request |
22,123 | private void preparePostHeader ( HttpPost httpPost , String acceptMimeType , String contentMimeType ) { if ( acceptMimeType != null && ! acceptMimeType . equals ( "" ) ) { httpPost . setHeader ( new BasicHeader ( "accept" , acceptMimeType ) ) ; } if ( contentMimeType != null && ! contentMimeType . equals ( "" ) ) { htt... | Add accept content - type projectId and token headers to an HttpPost object . |
22,124 | public VNFPackage requestPostPackage ( final File f ) throws SDKException { CloseableHttpResponse response = null ; HttpPost httpPost = null ; checkToken ( ) ; try { log . debug ( "Executing post on " + pathUrl ) ; httpPost = new HttpPost ( this . pathUrl ) ; preparePostHeader ( httpPost , "application/json" , null ) ;... | Used to upload tar files to the NFVO for creating VNFPackages . |
22,125 | public void requestDelete ( final String id ) throws SDKException { CloseableHttpResponse response = null ; HttpDelete httpDelete = null ; checkToken ( ) ; try { log . debug ( "pathUrl: " + pathUrl ) ; log . debug ( "id: " + pathUrl + "/" + id ) ; log . info ( "Executing delete on: " + this . pathUrl + "/" + id ) ; htt... | Executes a http delete with to a given id |
22,126 | public Object requestGet ( final String id , Class type ) throws SDKException { String url = this . pathUrl ; if ( id != null ) { url += "/" + id ; return requestGetWithStatus ( url , null , type ) ; } else { return requestGetAll ( url , type , null ) ; } } | Executes a http get with to a given id |
22,127 | public Serializable requestPut ( final String id , final Serializable object ) throws SDKException { CloseableHttpResponse response = null ; HttpPut httpPut = null ; checkToken ( ) ; try { log . trace ( "Object is: " + object ) ; String fileJSONNode = mapper . toJson ( object ) ; log . debug ( "Executing put on: " + th... | Executes a http put with to a given id while serializing the object content as json and returning the response |
22,128 | static BOSHClientConnEvent createConnectionClosedOnErrorEvent ( final BOSHClient source , final List < ComposableBody > outstanding , final Throwable cause ) { return new BOSHClientConnEvent ( source , false , outstanding , cause ) ; } | Creates a connection closed on error event . This represents an unexpected termination of the client session . |
22,129 | boolean isAccepted ( final String name ) { for ( String str : charsets ) { if ( str . equalsIgnoreCase ( name ) ) { return true ; } } return false ; } | Determines whether or not the specified charset is supported . |
22,130 | private static XmlPullParser getXmlPullParser ( ) { SoftReference < XmlPullParser > ref = XPP_PARSER . get ( ) ; XmlPullParser result = ref . get ( ) ; if ( result == null ) { Exception thrown ; try { XmlPullParserFactory factory = XmlPullParserFactory . newInstance ( ) ; factory . setNamespaceAware ( true ) ; factory ... | Gets a XmlPullParser for use in parsing incoming messages . |
22,131 | public static StaticBody fromStream ( final InputStream inStream ) throws BOSHException { ByteArrayOutputStream byteOut = new ByteArrayOutputStream ( ) ; try { byte [ ] buffer = new byte [ BUFFER_SIZE ] ; int read ; do { read = inStream . read ( buffer ) ; if ( read > 0 ) { byteOut . write ( buffer , 0 , read ) ; } } w... | Creates an instance which is initialized by reading a body message from the provided stream . |
22,132 | public static StaticBody fromString ( final String rawXML ) throws BOSHException { BodyParserResults results = PARSER . parse ( rawXML ) ; return new StaticBody ( results . getAttributes ( ) , rawXML ) ; } | Creates an instance which is initialized by reading a body message from the provided raw XML string . |
22,133 | @ Help ( help = "Create a VNFPackage by uploading a tar file" ) public VNFPackage create ( String filePath ) throws SDKException { log . debug ( "Start uploading a VNFPackage using the tar at path " + filePath ) ; File f = new File ( filePath ) ; if ( f == null || ! f . exists ( ) ) { log . error ( "No package: " + f .... | Uploads a VNFPackage to the NFVO . |
22,134 | @ Help ( help = "Find a User by his name" ) public User findByName ( String name ) throws SDKException { return ( User ) requestGet ( name , User . class ) ; } | Returns a User specified by his username . |
22,135 | @ Help ( help = "Change a user's password" ) public void changePassword ( String oldPassword , String newPassword ) throws SDKException { HashMap < String , String > requestBody = new HashMap < > ( ) ; requestBody . put ( "old_pwd" , oldPassword ) ; requestBody . put ( "new_pwd" , newPassword ) ; requestPut ( "changepw... | Changes a User s password . |
22,136 | @ Help ( help = "Generate a new Key in the NFVO" ) public String generateKey ( String name ) throws SDKException { return ( String ) requestPost ( "generate" , name ) ; } | Generate a new Key in the NFVO . |
22,137 | @ Help ( help = "Import a Key into the NFVO by providing name and public key" ) public Key importKey ( String name , String publicKey ) throws SDKException { Key key = new Key ( ) ; key . setName ( name ) ; key . setPublicKey ( publicKey ) ; return ( Key ) requestPost ( key ) ; } | Import a Key into the NFVO by providing name and public key . |
22,138 | private String computeXML ( ) { BodyQName bodyName = getBodyQName ( ) ; StringBuilder builder = new StringBuilder ( ) ; builder . append ( "<" ) ; builder . append ( bodyName . getLocalPart ( ) ) ; for ( Map . Entry < BodyQName , String > entry : attrs . entrySet ( ) ) { builder . append ( " " ) ; BodyQName name = entr... | Generate a String representation of the message body . |
22,139 | protected File findFile ( final List < File > sourceDirectories , String resourceFileName ) throws IOException { for ( final File sourceDirectory : sourceDirectories ) { final File resourceFile = new File ( sourceDirectory , resourceFileName ) ; if ( resourceFile . exists ( ) ) { return resourceFile ; } } throw new IOE... | Find the File for the resource file in the various source directories . |
22,140 | protected void logAggregation ( final Deque < ? extends BasicInclude > elements , final String fileName ) { if ( this . logger . isDebugEnabled ( ) ) { final StringBuilder msg = new StringBuilder ( "Aggregated " ) . append ( fileName ) . append ( " from " ) . append ( generatePathList ( elements ) ) ; this . logger . d... | Log the result of an aggregation |
22,141 | public AbstractBody getBody ( ) throws InterruptedException , BOSHException { if ( toThrow != null ) { throw ( toThrow ) ; } lock . lock ( ) ; try { if ( ! sent ) { awaitResponse ( ) ; } } finally { lock . unlock ( ) ; } return body ; } | Wait for and then return the response body . |
22,142 | public int getHTTPStatus ( ) throws InterruptedException , BOSHException { if ( toThrow != null ) { throw ( toThrow ) ; } lock . lock ( ) ; try { if ( ! sent ) { awaitResponse ( ) ; } } finally { lock . unlock ( ) ; } return statusCode ; } | Wait for and then return the response HTTP status code . |
22,143 | private synchronized void awaitResponse ( ) throws BOSHException { HttpEntity entity = null ; try { HttpResponse httpResp = client . execute ( post , context ) ; entity = httpResp . getEntity ( ) ; byte [ ] data = EntityUtils . toByteArray ( entity ) ; String encoding = entity . getContentEncoding ( ) != null ? entity ... | Await the response storing the result in the instance variables of this class when they arrive . |
22,144 | public void addBOSHClientConnListener ( final BOSHClientConnListener listener ) { if ( listener == null ) { throw ( new IllegalArgumentException ( NULL_LISTENER ) ) ; } connListeners . add ( listener ) ; } | Adds a connection listener to the session . |
22,145 | public void removeBOSHClientConnListener ( final BOSHClientConnListener listener ) { if ( listener == null ) { throw ( new IllegalArgumentException ( NULL_LISTENER ) ) ; } connListeners . remove ( listener ) ; } | Removes a connection listener from the session . |
22,146 | public void addBOSHClientRequestListener ( final BOSHClientRequestListener listener ) { if ( listener == null ) { throw ( new IllegalArgumentException ( NULL_LISTENER ) ) ; } requestListeners . add ( listener ) ; } | Adds a request message listener to the session . |
22,147 | public void removeBOSHClientRequestListener ( final BOSHClientRequestListener listener ) { if ( listener == null ) { throw ( new IllegalArgumentException ( NULL_LISTENER ) ) ; } requestListeners . remove ( listener ) ; } | Removes a request message listener from the session if previously added . |
22,148 | public void addBOSHClientResponseListener ( final BOSHClientResponseListener listener ) { if ( listener == null ) { throw ( new IllegalArgumentException ( NULL_LISTENER ) ) ; } responseListeners . add ( listener ) ; } | Adds a response message listener to the session . |
22,149 | public void removeBOSHClientResponseListener ( final BOSHClientResponseListener listener ) { if ( listener == null ) { throw ( new IllegalArgumentException ( NULL_LISTENER ) ) ; } responseListeners . remove ( listener ) ; } | Removes a response message listener from the session if previously added . |
22,150 | public void disconnect ( final ComposableBody msg ) throws BOSHException { if ( msg == null ) { throw ( new IllegalArgumentException ( "Message body may not be null" ) ) ; } Builder builder = msg . rebuild ( ) ; builder . setAttribute ( Attributes . TYPE , TERMINATE ) ; send ( builder . build ( ) ) ; } | End the BOSH session by disconnecting from the remote BOSH connection manager sending the provided content in the final connection termination message . |
22,151 | void drain ( ) { lock . lock ( ) ; try { LOG . finest ( "Waiting while draining..." ) ; while ( isWorking ( ) && ( emptyRequestFuture == null || emptyRequestFuture . isDone ( ) ) ) { try { drained . await ( ) ; } catch ( InterruptedException intx ) { LOG . log ( Level . FINEST , INTERRUPTED , intx ) ; } } LOG . finest ... | Wait until no more messages are waiting to be processed . |
22,152 | private void init ( ) { assertUnlocked ( ) ; lock . lock ( ) ; try { httpSender . init ( cfg ) ; LOG . info ( "Starting with " + DEFAULT_REQ_PROC_COUNT + " request processors" ) ; procThreads = new RequestProcessor [ DEFAULT_REQ_PROC_COUNT ] ; for ( int i = 0 ; i < procThreads . length ; i ++ ) { procThreads [ i ] = ne... | Initialize the session . This initializes the underlying HTTP transport implementation and starts the receive thread . |
22,153 | private void dispose ( final Throwable cause ) { assertUnlocked ( ) ; lock . lock ( ) ; try { if ( procThreads == null ) { return ; } for ( RequestProcessor processor : procThreads ) { processor . dispose ( ) ; } procThreads = null ; } finally { lock . unlock ( ) ; } if ( cause == null ) { fireConnectionClosed ( ) ; } ... | Destroy this session . |
22,154 | private TerminalBindingCondition getTerminalBindingCondition ( final int respCode , final AbstractBody respBody ) { assertLocked ( ) ; if ( isTermination ( respBody ) ) { String str = respBody . getAttribute ( Attributes . CONDITION ) ; return TerminalBindingCondition . forString ( str ) ; } if ( cmParams != null && cm... | Evaluates the HTTP response code and response message and returns the terminal binding condition that it describes if any . |
22,155 | private boolean isImmediatelySendable ( final AbstractBody msg ) { assertLocked ( ) ; if ( cmParams == null ) { return exchanges . isEmpty ( ) ; } AttrRequests requests = cmParams . getRequests ( ) ; if ( requests == null ) { return true ; } int maxRequests = requests . intValue ( ) ; if ( exchanges . size ( ) < maxReq... | Determines if the message specified is immediately sendable or if it needs to block until the session state changes . |
22,156 | private void blockUntilSendable ( final AbstractBody msg ) { assertLocked ( ) ; while ( isWorking ( ) && ! isImmediatelySendable ( msg ) ) { try { notFull . await ( ) ; } catch ( InterruptedException intx ) { LOG . log ( Level . FINEST , INTERRUPTED , intx ) ; } } } | Blocks until either the message provided becomes immediately sendable or until the session is terminated . |
22,157 | private ComposableBody applySessionCreationRequest ( final long rid , final ComposableBody orig ) throws BOSHException { assertLocked ( ) ; Builder builder = orig . rebuild ( ) ; builder . setAttribute ( Attributes . TO , cfg . getTo ( ) ) ; builder . setAttribute ( Attributes . XML_LANG , cfg . getLang ( ) ) ; builder... | Modifies the specified body message such that it becomes a new BOSH session creation request . |
22,158 | private void applyRoute ( final Builder builder ) { assertLocked ( ) ; String route = cfg . getRoute ( ) ; if ( route != null ) { builder . setAttribute ( Attributes . ROUTE , route ) ; } } | Applies routing information to the request message who s builder has been provided . |
22,159 | private void applyFrom ( final Builder builder ) { assertLocked ( ) ; String from = cfg . getFrom ( ) ; if ( from != null ) { builder . setAttribute ( Attributes . FROM , from ) ; } } | Applies the local station ID information to the request message who s builder has been provided . |
22,160 | private ComposableBody applySessionData ( final long rid , final ComposableBody orig ) throws BOSHException { assertLocked ( ) ; Builder builder = orig . rebuild ( ) ; builder . setAttribute ( Attributes . SID , cmParams . getSessionID ( ) . toString ( ) ) ; builder . setAttribute ( Attributes . RID , Long . toString (... | Applies existing session data to the outbound request returning the modified request . |
22,161 | private void applyResponseAcknowledgement ( final Builder builder , final long rid ) { assertLocked ( ) ; if ( responseAck . equals ( Long . valueOf ( - 1L ) ) ) { return ; } Long prevRID = Long . valueOf ( rid - 1L ) ; if ( responseAck . equals ( prevRID ) ) { return ; } builder . setAttribute ( Attributes . ACK , res... | Sets the ack attribute of the request to the value of the highest rid of a request for which it has already received a response in the case where it has also received all responses associated with lower rid values . The only exception is that after its session creation request the client SHOULD NOT include an ack attri... |
22,162 | private void processMessages ( int idx ) { LOG . finest ( "Processing thread " + idx + " starting..." ) ; try { HTTPExchange exch ; do { exch = nextExchange ( idx ) ; if ( exch == null ) { break ; } ExchangeInterceptor interceptor = exchInterceptor . get ( ) ; if ( interceptor != null ) { HTTPExchange newExch = interce... | While we are connected process received responses . |
22,163 | private HTTPExchange nextExchange ( int idx ) { assertUnlocked ( ) ; final Thread thread = Thread . currentThread ( ) ; HTTPExchange exch = null ; lock . lock ( ) ; try { do { if ( procThreads == null || ! thread . equals ( procThreads [ idx ] . procThread ) ) { break ; } exch = claimExchange ( idx ) ; if ( exch == nul... | Get the next message exchange to process blocking until one becomes available if nothing is already waiting for processing . |
22,164 | private HTTPExchange claimExchange ( int idx ) { assertLocked ( ) ; HTTPExchange exch = null ; for ( HTTPExchange toClaim : exchanges ) { if ( findProcessorForExchange ( toClaim ) == null ) { exch = toClaim ; break ; } } if ( exch != null ) { procThreads [ idx ] . procExchange = exch ; if ( LOG . isLoggable ( Level . F... | Finds and claims the exchange that has not been taken by other request processor . |
22,165 | private void adjustRequestProcessorsPool ( ) { assertLocked ( ) ; AttrRequests attrRequests = cmParams . getRequests ( ) ; int requests = attrRequests != null ? attrRequests . intValue ( ) : 2 ; if ( requests <= 1 && "1" . equals ( String . valueOf ( cmParams . getHold ( ) ) ) ) { LOG . warning ( "CM supports only 1 re... | Checks the value of REQ attribute received from the CM and adjusts the size of the request processors pool . |
22,166 | private void scheduleEmptyRequest ( long delay ) { assertLocked ( ) ; if ( delay < 0L ) { throw ( new IllegalArgumentException ( "Empty request delay must be >= 0 (was: " + delay + ")" ) ) ; } clearEmptyRequest ( ) ; if ( ! isWorking ( ) ) { return ; } if ( LOG . isLoggable ( Level . FINER ) ) { LOG . finer ( "Scheduli... | Schedule an empty request to be sent if no other requests are sent in a reasonable amount of time . |
22,167 | private void sendEmptyRequest ( ) { assertUnlocked ( ) ; LOG . finest ( "Sending empty request" ) ; try { send ( ComposableBody . builder ( ) . build ( ) ) ; } catch ( BOSHException boshx ) { dispose ( boshx ) ; } } | Sends an empty request to maintain session requirements . If a request is sent within a reasonable time window the empty request transmission will be cancelled . |
22,168 | private long processPauseRequest ( final AbstractBody req ) { assertLocked ( ) ; if ( cmParams != null && cmParams . getMaxPause ( ) != null ) { try { AttrPause pause = AttrPause . createFromString ( req . getAttribute ( Attributes . PAUSE ) ) ; if ( pause != null ) { long delay = pause . getInMilliseconds ( ) - PAUSE_... | Process the request to determine if the empty request delay can be determined by looking to see if the request is a pause request . If it can the request s delay is returned otherwise the default delay is returned . |
22,169 | private void processRequestAcknowledgements ( final AbstractBody req , final AbstractBody resp ) { assertLocked ( ) ; if ( ! cmParams . isAckingRequests ( ) ) { return ; } if ( resp . getAttribute ( Attributes . REPORT ) != null ) { return ; } String acked = resp . getAttribute ( Attributes . ACK ) ; Long ackUpTo ; if ... | Check the response for request acknowledgements and take appropriate action . |
22,170 | private void processResponseAcknowledgementData ( final AbstractBody req ) { assertLocked ( ) ; Long rid = Long . parseLong ( req . getAttribute ( Attributes . RID ) ) ; if ( responseAck . equals ( Long . valueOf ( - 1L ) ) ) { responseAck = rid ; } else { pendingResponseAcks . add ( rid ) ; Long whileVal = Long . valu... | Process the response in order to update the response acknowlegement data . |
22,171 | private HTTPExchange processResponseAcknowledgementReport ( final AbstractBody resp ) throws BOSHException { assertLocked ( ) ; String reportStr = resp . getAttribute ( Attributes . REPORT ) ; if ( reportStr == null ) { return null ; } Long report = Long . parseLong ( reportStr ) ; Long time = Long . parseLong ( resp .... | Process the response in order to check for and respond to any potential ack reports . |
22,172 | private void fireRequestSent ( final AbstractBody request ) { assertUnlocked ( ) ; BOSHMessageEvent event = null ; for ( BOSHClientRequestListener listener : requestListeners ) { if ( event == null ) { event = BOSHMessageEvent . createRequestSentEvent ( this , request ) ; } try { listener . requestSent ( event ) ; } ca... | Notifies all request listeners that the specified request is being sent . |
22,173 | private void fireResponseReceived ( final AbstractBody response ) { assertUnlocked ( ) ; BOSHMessageEvent event = null ; for ( BOSHClientResponseListener listener : responseListeners ) { if ( event == null ) { event = BOSHMessageEvent . createResponseReceivedEvent ( this , response ) ; } try { listener . responseReceiv... | Notifies all response listeners that the specified response has been received . |
22,174 | private void fireConnectionEstablished ( ) { final boolean hadLock = lock . isHeldByCurrentThread ( ) ; if ( hadLock ) { lock . unlock ( ) ; } try { BOSHClientConnEvent event = null ; for ( BOSHClientConnListener listener : connListeners ) { if ( event == null ) { event = BOSHClientConnEvent . createConnectionEstablish... | Notifies all connection listeners that the session has been successfully established . |
22,175 | private void fireConnectionClosed ( ) { assertUnlocked ( ) ; BOSHClientConnEvent event = null ; for ( BOSHClientConnListener listener : connListeners ) { if ( event == null ) { event = BOSHClientConnEvent . createConnectionClosedEvent ( this ) ; } try { listener . connectionEvent ( event ) ; } catch ( Exception ex ) { ... | Notifies all connection listeners that the session has been terminated normally . |
22,176 | private void fireConnectionClosedOnError ( final Throwable cause ) { assertUnlocked ( ) ; BOSHClientConnEvent event = null ; for ( BOSHClientConnListener listener : connListeners ) { if ( event == null ) { event = BOSHClientConnEvent . createConnectionClosedOnErrorEvent ( this , pendingRequestAcks , cause ) ; } try { l... | Notifies all connection listeners that the session has been terminated due to the exceptional condition provided . |
22,177 | public static void checkStatus ( CloseableHttpResponse httpResponse , final int httpStatus ) throws SDKException { if ( httpResponse . getStatusLine ( ) . getStatusCode ( ) != httpStatus ) { log . error ( "Status expected: " + httpStatus + " obtained: " + httpResponse . getStatusLine ( ) . getStatusCode ( ) ) ; log . e... | Check whether a json repsonse has the right http status . If not an SDKException is thrown . |
22,178 | public final Set < BodyQName > getAttributeNames ( ) { Map < BodyQName , String > attrs = getAttributes ( ) ; return Collections . unmodifiableSet ( attrs . keySet ( ) ) ; } | Get a set of all defined attribute names . |
22,179 | public final String getAttribute ( final BodyQName attr ) { Map < BodyQName , String > attrs = getAttributes ( ) ; return attrs . get ( attr ) ; } | Get the value of the specified attribute . |
22,180 | boolean isAccepted ( final String name ) { for ( String str : encodings ) { if ( str . equalsIgnoreCase ( name ) ) { return true ; } } return false ; } | Determines whether or not the specified encoding is supported . |
22,181 | public static String buildAuthHeader ( String username , String token ) { if ( username == null || "" . equals ( username ) ) { throw new IllegalArgumentException ( "Username must be specified" ) ; } if ( token == null || "" . equals ( token ) ) { throw new IllegalArgumentException ( "Token must be specified" ) ; } ret... | Builds a new HTTP Authorization header for Librato API requests |
22,182 | @ Help ( help = "Create NetworkServiceRecord from NetworkServiceDescriptor id" ) public NetworkServiceRecord create ( final String id , HashMap < String , ArrayList < String > > vduVimInstances , ArrayList < String > keys , HashMap < String , Configuration > configurations , String monitoringIp ) throws SDKException { ... | Create a new NetworkServiceRecord from a NetworkServiceDescriptor . |
22,183 | @ Help ( help = "Get all the VirtualNetworkFunctionRecords of NetworkServiceRecord with specific id" ) public List < VirtualNetworkFunctionRecord > getVirtualNetworkFunctionRecords ( final String id ) throws SDKException { String url = id + "/vnfrecords" ; return Arrays . asList ( ( VirtualNetworkFunctionRecord [ ] ) r... | Returns a List of all the VirtualNetworkFunctionRecords that are contained in a NetworkServiceRecord . |
22,184 | @ Help ( help = "Get the VirtualNetworkFunctionRecord of NetworkServiceRecord with specific id" ) public VirtualNetworkFunctionRecord getVirtualNetworkFunctionRecord ( final String id , final String idVnfr ) throws SDKException { String url = id + "/vnfrecords" + "/" + idVnfr ; return ( VirtualNetworkFunctionRecord ) r... | Returns a specific VirtualNetworkFunctionRecord which is contained in a NetworkServiceRecord . |
22,185 | @ Help ( help = "Delete the VirtualNetworkFunctionRecord of NetworkServiceRecord with specific id" ) public void deleteVirtualNetworkFunctionRecord ( final String id , final String idVnfr ) throws SDKException { String url = id + "/vnfrecords" + "/" + idVnfr ; requestDelete ( url ) ; } | Deletes a specific VirtualNetworkFunctionRecord . |
22,186 | @ Help ( help = "Switch to standby" ) public void switchToStandby ( final String idNsr , final String idVnfr , final String idVdu , final String idVnfc , final VNFCInstance failedVnfcInstance ) throws SDKException { String url = idNsr + "/vnfrecords/" + idVnfr + "/vdunits/" + idVdu + "/vnfcinstances/" + idVnfc + "/swit... | Make a VNFCInstance switch into standby mode . |
22,187 | @ Help ( help = "Execute a specific action specified in the nfvMessage" ) public void postAction ( final String idNsr , final String idVnfr , final String idVdu , final String idVnfc , final NFVMessage nfvMessage ) throws SDKException { String url = idNsr + "/vnfrecords/" + idVnfr + "/vdunits/" + idVdu + "/vnfcinstance... | Trigger the execution of a specific LifecycleEvent on a VNFCInstance . Currently only the HEAL LifecycleEvent is supported . |
22,188 | @ Help ( help = "create VirtualNetworkFunctionRecord" ) public VirtualNetworkFunctionRecord createVNFR ( final String idNsr , final VirtualNetworkFunctionRecord virtualNetworkFunctionRecord ) throws SDKException { String url = idNsr + "/vnfrecords" ; return ( VirtualNetworkFunctionRecord ) requestPost ( url , virtualNe... | Create a new VirtualNetworkFunctionRecord and add it to a NetworkServiceRecord . |
22,189 | @ Help ( help = "create VNFCInstance. Aka SCALE OUT" ) public void createVNFCInstance ( final String idNsr , final String idVnfr , final VNFComponent vnfComponent , ArrayList < String > vimInstanceNames ) throws SDKException { String url = idNsr + "/vnfrecords/" + idVnfr + "/vdunits/vnfcinstances" ; HashMap < String , ... | Create a new VNFCInstance from a VNFComponent without specifying the VirtualDeploymentUnit to which the VNFCInstance shall be added . This is also called a scale out operation . |
22,190 | @ Help ( help = "remove VNFCInstance. Aka SCALE IN" ) public void deleteVNFCInstance ( final String idNsr , final String idVnfr ) throws SDKException { String url = idNsr + "/vnfrecords/" + idVnfr + "/vdunits/vnfcinstances" ; requestDelete ( url ) ; } | Delete a VNFCInstance from a VirtualNetworkFunctionRecord . This operation is also called scaling in . This method does not require you to specify the VirtualDeploymentUnit from which a VNFCInstance shall be deleted . |
22,191 | @ Help ( help = "update VirtualNetworkFunctionRecord" ) public String updateVNFR ( final String idNsr , final String idVnfr , final VirtualNetworkFunctionRecord virtualNetworkFunctionRecord ) throws SDKException { String url = idNsr + "/vnfrecords" + "/" + idVnfr ; return requestPut ( url , virtualNetworkFunctionRecord... | Updates a VirtualNetworkFunctionRecord . |
22,192 | @ Help ( help = "Get all the VirtualNetworkFunctionRecord dependencies of NetworkServiceRecord with specific id" ) public List < VNFRecordDependency > getVNFDependencies ( final String idNsr ) throws SDKException { String url = idNsr + "/vnfdependencies" ; return Arrays . asList ( ( VNFRecordDependency [ ] ) requestGet... | Returns a List of all the VNFRecordDependencies contained in a particular NetworkServiceRecord . |
22,193 | @ Help ( help = "Get the VirtualNetworkFunctionRecord Dependency of a NetworkServiceRecord with specific id" ) public VNFRecordDependency getVNFDependency ( final String idNsr , final String idVnfrDep ) throws SDKException { String url = idNsr + "/vnfdependencies" + "/" + idVnfrDep ; return ( VNFRecordDependency ) requ... | Returns a specific VNFRecordDependency from a particular NetworkServiceRecord . |
22,194 | @ Help ( help = "Delete the VirtualNetworkFunctionRecord Dependency of a NetworkServiceRecord with specific id" ) public void deleteVNFDependency ( final String idNsr , final String idVnfrDep ) throws SDKException { String url = idNsr + "/vnfdependencies" + "/" + idVnfrDep ; requestDelete ( url ) ; } | Deletes a specific VNFRecordDependency from a NetworkServiceRecord . |
22,195 | @ Help ( help = "Create the VirtualNetworkFunctionRecord Dependency of a NetworkServiceRecord with specific id" ) public VNFRecordDependency postVNFDependency ( final String idNsr , final VNFRecordDependency vnfRecordDependency ) throws SDKException { String url = idNsr + "/vnfdependencies" + "/" ; return ( VNFRecordDe... | Add a new VNFRecordDependency to a NetworkServiceRecord . |
22,196 | @ Help ( help = "Update the VirtualNetworkFunctionRecord Dependency of a NetworkServiceRecord with specific id" ) public VNFRecordDependency updateVNFDependency ( final String idNsr , final String idVnfrDep , final VNFRecordDependency vnfRecordDependency ) throws SDKException { String url = idNsr + "/vnfdependencies" +... | Update a VNFRecordDependency . |
22,197 | @ Help ( help = "Start the specified VNFC Instance" ) public void startVNFCInstance ( final String nsrId , final String vnfrId , final String vduId , final String vnfcInstanceId ) throws SDKException { String url = nsrId + "/vnfrecords/" + vnfrId + "/vdunits/" + vduId + "/vnfcinstances/" + vnfcInstanceId + "/start" ; r... | Start a specific VNFCInstance . |
22,198 | @ Help ( help = "Get all the PhysicalNetworkFunctionRecords of a specific NetworkServiceRecord with id" ) public List < PhysicalNetworkFunctionRecord > getPhysicalNetworkFunctionRecords ( final String idNsr ) throws SDKException { String url = idNsr + "/pnfrecords" ; return Arrays . asList ( ( PhysicalNetworkFunctionRe... | Returns a List of all the PhysicalNetworkFunctionRecords that are contained in a particular NetworkServiceRecord . |
22,199 | @ Help ( help = "Get the PhysicalNetworkFunctionRecord of a NetworkServiceRecord with specific id" ) public PhysicalNetworkFunctionRecord getPhysicalNetworkFunctionRecord ( final String idNsr , final String idPnfr ) throws SDKException { String url = idNsr + "/pnfrecords" + "/" + idPnfr ; return ( PhysicalNetworkFuncti... | Returns a specific PhysicalNetworkFunctionRecord . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.